diff

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainDiffResult added in v0.12.0

type DomainDiffResult struct {
	Stmts               []string
	DropStmts           []string
	DisallowedDropStmts []string
}

func DiffDomains added in v0.12.0

func DiffDomains(current, desired *orderedmap.Map[string, *model.Domain], dc DropChecker) (*DomainDiffResult, error)

type DropChecker added in v0.14.0

type DropChecker interface {
	IsDropAllowed(objectType string) bool
}

DropChecker checks whether dropping a specific object type is allowed.

type EnumDiffResult added in v0.9.0

type EnumDiffResult struct {
	Stmts               []string
	DropStmts           []string
	DisallowedDropStmts []string
}

func DiffEnums added in v0.9.0

func DiffEnums(current, desired *orderedmap.Map[string, *model.Enum], dc DropChecker) (*EnumDiffResult, error)

type SequenceDiffResult added in v1.17.0

type SequenceDiffResult struct {
	Stmts               []string
	DropStmts           []string
	DisallowedDropStmts []string
}

func DiffSequences added in v1.17.0

func DiffSequences(current, desired *orderedmap.Map[string, *model.Sequence], dc DropChecker) (*SequenceDiffResult, error)

type TableDiffResult added in v0.16.0

type TableDiffResult struct {
	FKDropStmts         []string // FK drops (should run first)
	Stmts               []string // CREATE/ALTER TABLE, columns, constraints, indexes, comments
	FKAddStmts          []string // FK adds and renames (should run last)
	DropStmts           []string // DROP TABLE (separate from Stmts for ordering)
	DisallowedDropStmts []string // DROP TABLE / DROP COLUMN / DROP CONSTRAINT (incl. FK) / DROP INDEX suppressed by DropChecker, with "-- skipped: " prefix
	HasConcurrently     bool     // true if any index operation uses CONCURRENTLY
}

TableDiffResult separates FK operations from other statements to allow correct ordering: FK drops first, then schema changes, then FK adds last.

func DiffTables

func DiffTables(current, desired *orderedmap.Map[string, *model.Table], dc DropChecker) (*TableDiffResult, error)

type ViewDiffResult added in v0.18.0

type ViewDiffResult struct {
	DropStmts           []string // DROP VIEW / DROP MATERIALIZED VIEW (should run before table changes)
	CreateStmts         []string // ALTER VIEW RENAME, CREATE OR REPLACE VIEW, CREATE MATERIALIZED VIEW, indexes, comments (should run after table changes)
	DisallowedDropStmts []string // DROP VIEW / DROP MATERIALIZED VIEW / DROP INDEX (on matview) suppressed by DropChecker, with "-- skipped: " prefix
	HasConcurrently     bool     // true if any index operation uses CONCURRENTLY
}

ViewDiffResult separates view DROP and CREATE/MODIFY statements. Drops should run before table changes, creates after.

func DiffViews

func DiffViews(current, desired *orderedmap.Map[string, *model.View], dc DropChecker) (*ViewDiffResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL