Documentation
¶
Overview ¶
Package changeset names atlas schema changes as selectable, typed migration changes and filters a diff down to a reviewed selection before planning.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶
type Dialect struct {
// Name prefixes errors, e.g. "sqlserver".
Name string
// DefaultSchema names objects whose atlas schema is unset (SQLite: main).
DefaultSchema string
// Object names a dialect-specific schema object; ok is false for an unknown one.
Object func(schema.Object) (kind string, name migrate.Name, ok bool)
// Destructive reports whether a described change may lose data, and why.
Destructive func(schema.Change) (bool, string)
// Rebuilds reports whether a table member change forces the whole table to
// be rebuilt from its desired definition, which applies every sibling change.
Rebuilds func(schema.Change) bool
}
Dialect supplies the parts of a change description that differ per backend.
type Set ¶
Set is the described diff: every selectable change in diff order, the atlas change each came from, and the table member changes per table.
func Describe ¶
Describe names every change of a diff, recursing into table modifications, and records which other changes each one requires.
func (*Set) Lookup ¶
Lookup returns the change IDs a planned statement implements. Planners synthesize sources for table rebuilds and their recreated indexes; those resolve to the table's member changes.