Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopyScanner ¶
type CopyScanner struct {
// contains filtered or unexported fields
}
CopyScanner will scan COPY statements, returning TableSnapshots.
func NewCopyScanner ¶
func NewCopyScanner(r io.Reader) *CopyScanner
NewCopyScanner will return a new CopyScanner.
func (*CopyScanner) Err ¶
func (d *CopyScanner) Err() error
func (*CopyScanner) Scan ¶
func (d *CopyScanner) Scan() bool
Scan will scan the next COPY statement.
func (*CopyScanner) Table ¶
func (d *CopyScanner) Table() TableSnapshot
type IgnoreRule ¶
type IgnoreRule struct { // MigrationName is the name of the migration this rule applies to. MigrationName string TableName string ColumnName string // ExtraRows will ignore extra/leftover rows in the table when migrating down. ExtraRows bool // MissingRows will ignore missing rows in the table when migrating down (e.g., table was dropped). MissingRows bool }
IgnoreRule is a rule to ignore differences in a snapshot.
type RuleSet ¶
type RuleSet []IgnoreRule
RuleSet is a set of IgnoreRules.
func (RuleSet) RequireEqualDown ¶
RequireEqualDown will compare two snapshots and ignore any differences based on the rules in the RuleSet after a Down migration.
type Snapshot ¶
type Snapshot struct { Schema *pgdump.Schema TableData []TableSnapshot }
Snapshot is a snapshot of a database's schema and data.
func NewSnapshot ¶
NewSnapshot will create a new Snapshot from a database connection.
type TableSnapshot ¶
type TableSnapshot struct { // Name is the name of the table. Name string Columns []string Rows [][]string }
TableSnapshot is a snapshot of a table's data.
func (TableSnapshot) EntityName ¶
func (t TableSnapshot) EntityName() string
func (*TableSnapshot) Sort ¶
func (data *TableSnapshot) Sort()
Sort sorts the columns and rows of the snapshot.
Click to show internal directories.
Click to hide internal directories.