Documentation
¶
Index ¶
- func CreateDB(ctx context.Context, conn clickhouse.Conn, dbName string) error
- func NewMigration(tmpl string, data any, filename string) (*goose.Migration, error)
- func RunGooseMigrations(ctx context.Context, dsn, dbName string, migrations []*goose.Migration, ...) error
- type RenderFunc
- type RenderFuncs
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMigration ¶
NewMigration creates a new migration from a Go template tmpl. The data is passed to the template as the arguments. The filename is used to name the template and build the migration number.
Types ¶
type RenderFunc ¶
type RenderFuncs ¶
type RenderFuncs []RenderFunc
type TemplateData ¶
type TemplateData struct { // DatabaseName is the name of the database where migrations are running. // All migrations should act on this database. DatabaseName string // SelfHostedVersion is true if the migrations are running on a self-hosted. // This will be removed when the tenant-operator is removed. SelfHostedVersion bool // If DevelopmentMode is true then the underlying migrations are executed on a non-replicated table engine. // This flag is mutually exclusive with `SelfHostedVersion` as we expect them to run on a replicated table engine. DevelopmentMode bool }
TemplateData is has standard fields passed to every migration template. Embed this in a struct type to use these fields with other ones in a template. e.g.
type MyTemplateData struct { migrations.TemplateData MyField string }
You cannot embed any or interface{} types as the fields will not be accessible to the template.
Click to show internal directories.
Click to hide internal directories.