Documentation
¶
Overview ¶
Package sqlite reconciles SQLite tables with programmatic Atlas declarations. Filesystem-backed HCL migrations use the target-aware parent migrate package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PendingChanges ¶
func PendingChanges(ctx context.Context, database schema.ExecQuerier, options ReconcileOptions, tables ...*schema.Table) ([]schema.Change, error)
PendingChanges reports the changes ReconcileTables would apply, without applying them. It only reads the schema, so a caller can skip opening a migration transaction when nothing is pending. It applies the same drop policy as ReconcileTables.
func ReconcileTables ¶
func ReconcileTables(ctx context.Context, database schema.ExecQuerier, options ReconcileOptions, tables ...*schema.Table) error
ReconcileTables brings database's tables up to the tables declared: Atlas inspects each declared table, diffs it against its declaration, and applies the plan. Column and table drops are skipped unless AllowDrops is enabled. Other supported changes may rebuild tables. Views are outside the declared table schema.
A column may be declared by its raw SQLite type alone (ColumnType.Raw); ReconcileTables parses it as inspection does, so a declaration and the table it created compare equal.