Documentation
¶
Overview ¶
Package dialect is what the reviewed workflows need from the registered engine dialects besides planning: the desired schema a dialect reads from HCL, a schema snapshot, and the script a plan's statements make. Importing it registers the "sqlserver", "postgres" and "sqlite" dialects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DesiredFromHCL ¶
DesiredFromHCL evaluates declared HCL to the desired schema of a dialect.
Types ¶
type Snapshot ¶
type Snapshot struct {
Dialect string `json:"dialect"`
Schemas []string `json:"schemas"`
Schema migrate.Schema `json:"schema"`
// Refusals are the objects the dialect could not read faithfully; they are
// not in Schema.
Refusals []engine.Refusal `json:"refusals,omitempty"`
}
Snapshot is the complete schema of a database, as a dialect inspects it. It is what `inspect --snapshot` prints and what a "snapshot" migration source holds as the desired state.
func Inspect ¶
func Inspect(ctx context.Context, q engine.Querier, name string, schemas []string) (Snapshot, error)
Inspect reads every object of schemas through the dialect's own inspector.
func (Snapshot) CheckWithin ¶
CheckWithin refuses a snapshot holding an object outside schemas.
func (Snapshot) RefuseTouched ¶
RefuseTouched fails when a planned change acts on an object this snapshot could not read. A snapshot used as the desired state leaves a refused object out, so planning would drop the target's copy of it.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package atlasdriver is the shared engine.Dialect implementation for the dialects that plan with an upstream Atlas driver (Postgres and SQLite).
|
Package atlasdriver is the shared engine.Dialect implementation for the dialects that plan with an upstream Atlas driver (Postgres and SQLite). |
|
Package postgres registers the "postgres" engine dialect, planned with the upstream Atlas PostgreSQL driver.
|
Package postgres registers the "postgres" engine dialect, planned with the upstream Atlas PostgreSQL driver. |
|
Package sqlite registers the "sqlite" engine dialect, planned with the upstream Atlas SQLite driver.
|
Package sqlite registers the "sqlite" engine dialect, planned with the upstream Atlas SQLite driver. |
|
Package sqlserver is the database half of the SQL Server dialect of the schema engine: it reads capabilities, schemas and the live dependents of columns, and runs a unit on one connection.
|
Package sqlserver is the database half of the SQL Server dialect of the schema engine: it reads capabilities, schemas and the live dependents of columns, and runs a unit on one connection. |