Versions in this module Expand all Collapse all v2 v2.0.0 Dec 22, 2025 Changes in this version + const PgDuplicatedForeignKey + const PgDuplicatedKey + const PqDbAlreadyExistsCode + const PqInvalidDBCode + func CreatePostgresDbIfNotExists(ctx context.Context, gormConfig *gorm.Config, pgConfig PostgresConfig) (*gorm.DB, error) + func CreatePostgresReadOnlyDbConnection(ctx context.Context, gormConfig *gorm.Config, pgConfig PostgresConfig) (*gorm.DB, error) + func GetDB(ctx context.Context, dbConfig *DbConfig, logConfig *logger.Config) (*gorm.DB, error) + func GetGormLogger(ctx context.Context, logConfig *logger.Config) gormLogger.Interface + func GetReadOnlyDB(ctx context.Context, dbConfig *DbConfig, logConfig *logger.Config) (*gorm.DB, error) + func IsPgErrorWithCode(err error, code string) bool + func Migrate(ctx context.Context, databaseConfig *DbConfig, ...) error + func Rollback(ctx context.Context, databaseConfig *DbConfig, ...) error + type DbConfig struct + ConnMaxLifeTime config.Duration + DeprecatedDbName string + DeprecatedDebug bool + DeprecatedExtraOptions string + DeprecatedHost string + DeprecatedPassword string + DeprecatedPasswordPath string + DeprecatedPort int + DeprecatedUser string + EnableForeignKeyConstraintWhenMigrating bool + MaxIdleConnections int + MaxOpenConnections int + Postgres PostgresConfig + SQLite SQLiteConfig + func GetConfig() *DbConfig + func (cfg DbConfig) GetPFlagSet(prefix string) *pflag.FlagSet + type PostgresConfig struct + DbName string + Debug bool + ExtraOptions string + Host string + Password string + PasswordPath string + Port int + ReadReplicaHost string + User string + func (s PostgresConfig) IsEmpty() bool + type SQLiteConfig struct + File string + func (s SQLiteConfig) IsEmpty() bool Other modules containing this package github.com/flyteorg/flyte/flytestdlib