Documentation
¶
Index ¶
- func CreateTable(tableName string) string
- func DeleteVersion(tableName string) string
- func GetLatestVersion(tableName string) string
- func GetMigrationByVersion(tableName string) string
- func InsertVersion(tableName string) string
- func ListMigrations(tableName string) string
- func RunDownMigration(ctx context.Context, targetVersion string, opts ...RunMigrationsOpt)
- func RunMigrations(ctx context.Context, opts ...RunMigrationsOpt) error
- func TableExists(tableName string) string
- type RunMigrationsOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTable ¶
func DeleteVersion ¶
func GetLatestVersion ¶
func GetMigrationByVersion ¶
func InsertVersion ¶
func ListMigrations ¶
func RunDownMigration ¶ added in v0.73.83
func RunDownMigration(ctx context.Context, targetVersion string, opts ...RunMigrationsOpt)
RunDownMigration runs down migrations to a specific version.
func RunMigrations ¶
func RunMigrations(ctx context.Context, opts ...RunMigrationsOpt) error
func TableExists ¶
Types ¶
type RunMigrationsOpt ¶
type RunMigrationsOpt func(*runMigrationsOpt)
func WithDatabaseURL ¶ added in v0.98.10
func WithDatabaseURL(url string) RunMigrationsOpt
WithDatabaseURL runs the migrations against the given database URL instead of the DATABASE_URL environment variable. This is used by downstream consumers (e.g. Hatchet Cloud) to apply the OSS schema to a separate database, such as a dedicated OLAP database.
func WithLogger ¶ added in v0.106.11
func WithLogger(l *zerolog.Logger) RunMigrationsOpt
WithLogger routes migration output through the given logger. Callers that embed the engine in their own process should pass their configured logger so that migrations do not write to stdout/stderr on their own terms.
func WithUpToPenultimate ¶
func WithUpToPenultimate() RunMigrationsOpt
func WithUpToVersion ¶ added in v0.102.3
func WithUpToVersion(version int64) RunMigrationsOpt
Click to show internal directories.
Click to hide internal directories.