Versions in this module Expand all Collapse all v0 v0.8.3 Feb 14, 2025 v0.8.2 Feb 14, 2025 Changes in this version + var ErrColumnOrderingChanged = fmt.Errorf("column ordering changed: %w", ErrNotImplemented) + var ErrNotImplemented = fmt.Errorf("not implemented") + type MigrationHazard struct + Message string + Type MigrationHazardType + func (p MigrationHazard) String() string + type MigrationHazardType = string + const MigrationHazardTypeAcquiresAccessExclusiveLock + const MigrationHazardTypeAcquiresShareLock + const MigrationHazardTypeAcquiresShareRowExclusiveLock + const MigrationHazardTypeAuthzUpdate + const MigrationHazardTypeCorrectness + const MigrationHazardTypeDeletesData + const MigrationHazardTypeExtensionVersionUpgrade + const MigrationHazardTypeHasUntrackableDependencies + const MigrationHazardTypeImpactsDatabasePerformance + const MigrationHazardTypeIndexBuild + const MigrationHazardTypeIndexDropped + const MigrationHazardTypeIsUserGenerated + type Plan struct + CurrentSchemaHash string + Statements []Statement + func Generate(ctx context.Context, fromSchema SchemaSource, targetSchema SchemaSource, ...) (Plan, error) + func GeneratePlan(ctx context.Context, queryable sqldb.Queryable, tempdbFactory tempdb.Factory, ...) (Plan, error) + func (p Plan) ApplyLockTimeoutModifier(regex *regexp.Regexp, timeout time.Duration) Plan + func (p Plan) ApplyStatementTimeoutModifier(regex *regexp.Regexp, timeout time.Duration) Plan + func (p Plan) InsertStatement(index int, statement Statement) (Plan, error) + type PlanOpt func(opts *planOptions) + func WithDataPackNewTables() PlanOpt + func WithDoNotValidatePlan() PlanOpt + func WithExcludeSchemas(schemas ...string) PlanOpt + func WithGetSchemaOpts(getSchemaOpts ...externalschema.GetSchemaOpt) PlanOpt + func WithIncludeSchemas(schemas ...string) PlanOpt + func WithLogger(logger log.Logger) PlanOpt + func WithRespectColumnOrder() PlanOpt + func WithTempDbFactory(factory tempdb.Factory) PlanOpt + type SchemaSource interface + GetSchema func(ctx context.Context, deps schemaSourcePlanDeps) (schema.Schema, error) + func DBSchemaSource(queryable sqldb.Queryable) SchemaSource + func DDLSchemaSource(stmts []string) SchemaSource + func DirSchemaSource(dirs []string) (SchemaSource, error) + type Statement struct + DDL string + Hazards []MigrationHazard + LockTimeout time.Duration + Timeout time.Duration + func (s Statement) MarshalJSON() ([]byte, error) + func (s Statement) ToSQL() string