Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Change ¶
type Change struct {
Kind ChangeKind
Table string
Subject string // column/index name, or empty for table-level changes
Detail string // e.g. "TEXT→VARCHAR"
}
Change is a single atomic schema or data change.
type ChangeKind ¶
type ChangeKind string
ChangeKind describes what kind of change was observed.
const ( KindTableAdded ChangeKind = "table added" KindTableRemoved ChangeKind = "table removed" KindColumnAdded ChangeKind = "column added" KindColumnRemoved ChangeKind = "column removed" KindColumnChanged ChangeKind = "column type changed" KindIndexAdded ChangeKind = "index added" KindIndexRemoved ChangeKind = "index removed" KindDataRowsChanged ChangeKind = "row count out of range" )
type ColumnSpec ¶
type DataSpec ¶
type DataSpec map[string]TableDataSpec
type Result ¶
type Result struct {
Passed bool
Confirmed []Change // expected and found
Unexpected []Change // found but not expected
Missing []Change // expected but not found
}
Result is the outcome of a validation run.
type SchemaSpec ¶
type SchemaSpec struct {
AddedTables []string `yaml:"added_tables" json:"added_tables,omitempty"`
RemovedTables []string `yaml:"removed_tables" json:"removed_tables,omitempty"`
ModifiedTables []TableChange `yaml:"modified_tables" json:"modified_tables,omitempty"`
}
type Spec ¶
type Spec struct {
Version int `yaml:"version" json:"version"`
Description string `yaml:"description" json:"description,omitempty"`
Schema SchemaSpec `yaml:"schema" json:"schema"`
Data DataSpec `yaml:"data" json:"data,omitempty"`
}
Spec is the expectation file loaded from YAML or JSON.
type TableChange ¶
type TableChange struct {
Table string `yaml:"table" json:"table"`
AddedColumns []ColumnSpec `yaml:"added_columns" json:"added_columns,omitempty"`
RemovedColumns []ColumnSpec `yaml:"removed_columns" json:"removed_columns,omitempty"`
AddedIndexes []IndexSpec `yaml:"added_indexes" json:"added_indexes,omitempty"`
RemovedIndexes []IndexSpec `yaml:"removed_indexes" json:"removed_indexes,omitempty"`
}
type TableDataSpec ¶
Click to show internal directories.
Click to hide internal directories.