Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MissingError ¶
type MissingError struct {
Missing []Requirement
// contains filtered or unexported fields
}
MissingError names every requirement the target database cannot satisfy.
func (*MissingError) Error ¶
func (e *MissingError) Error() string
type Requirement ¶
Requirement is one object the deploy SQL needs the target database to provide before any statement can run. Kind is extension, language, or role.
func Record ¶
func Record(ctx context.Context, d *db.DB, reqs []Requirement) ([]Requirement, error)
Record upserts the scanned set into samna_migrate.requirement and returns the requirements that were not recorded before this run.
func Scan ¶
func Scan(stepsCfg *steps.Config, dbDir string) ([]Requirement, error)
Scan walks every active step's SQL and returns the net set of requirements: every referenced extension, plus languages and roles the SQL references but does not itself create. The set is deduped and sorted.
func Verify ¶
func Verify(ctx context.Context, d *db.DB, reqs []Requirement) ([]Requirement, error)
Verify returns the requirements the target database cannot satisfy: an extension absent from pg_available_extensions, a language absent from pg_language, or a role absent from pg_roles.