diff

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowAllDrops added in v0.14.0

type AllowAllDrops struct{}

AllowAllDrops is a DropChecker that allows all drops.

func (AllowAllDrops) IsDropAllowed added in v0.14.0

func (AllowAllDrops) IsDropAllowed(string) bool

type DenyAllDrops added in v0.14.0

type DenyAllDrops struct{}

DenyAllDrops is a DropChecker that denies all drops.

func (DenyAllDrops) IsDropAllowed added in v0.14.0

func (DenyAllDrops) IsDropAllowed(string) bool

type DomainDiffResult added in v0.12.0

type DomainDiffResult struct {
	Stmts     []string
	DropStmts []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.

func NormalizeDropChecker added in v0.14.0

func NormalizeDropChecker(dc DropChecker) DropChecker

NormalizeDropChecker returns dc if non-nil, otherwise returns DenyAllDrops.

type EnumDiffResult added in v0.9.0

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

func DiffEnums added in v0.9.0

func DiffEnums(current, desired *orderedmap.Map[string, *model.Enum], dc DropChecker) (*EnumDiffResult, 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)
}

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 (should run before table changes)
	CreateStmts []string // ALTER VIEW RENAME, CREATE OR REPLACE VIEW, comments (should run after table changes)
}

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