Documentation
¶
Index ¶
- func RunPostgresMigrations(ctx context.Context, db *sql.DB, migrationFs embed.FS, migrationsPath string) error
- func RunPostgresMigrationsDown(ctx context.Context, db *sql.DB, migrationFs embed.FS, migrationsPath string) error
- func RunPostgresMigrationsDownWithGorm(ctx context.Context, db *gorm.DB, migrationFs embed.FS, migrationsPath string) error
- func RunPostgresMigrationsWithGorm(ctx context.Context, db *gorm.DB, migrationFs embed.FS, migrationsPath string) error
- type ConnectionConfig
- type DatabaseType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunPostgresMigrations ¶
Types ¶
type ConnectionConfig ¶
type ConnectionConfig struct {
DbType DatabaseType `yaml:"dbType" validate:"required,oneof=MYSQL POSTGRES MSSQL" mapstructure:"dbType"`
Host string `yaml:"host" validate:"required,min=1" mapstructure:"host"`
Port int `yaml:"port" mapstructure:"port"`
Username string `yaml:"username" validate:"required,min=1" mapstructure:"username"`
Password string `yaml:"password" mapstructure:"password"`
DbName string `yaml:"dbName" validate:"required,min=1" mapstructure:"dbName"`
Timeout time.Duration `yaml:"timeout" mapstructure:"timeout" validate:"min=3s"`
MaxIdleConns int `yaml:"maxIdleConns" mapstructure:"maxIdleConns" validate:"min=1"`
MaxOpenConns int `yaml:"maxOpenConns" mapstructure:"maxOpenConns" validate:"min=2"`
}
func (*ConnectionConfig) Dsn ¶
func (c *ConnectionConfig) Dsn() string
type DatabaseType ¶
type DatabaseType string
const ( Mysql DatabaseType = "MYSQL" Postgresql DatabaseType = "POSTGRES" MSSQL DatabaseType = "MSSQL" )
Click to show internal directories.
Click to hide internal directories.