require

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gate

func Gate(ctx context.Context, d *db.DB, stepsCfg *steps.Config, dbDir string) error

Gate scans, verifies, and records requirements for the deploy. A target that cannot satisfy a requirement stops the deploy. New requirements since the last run are reported.

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

type Requirement struct {
	Kind string
	Name string
}

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.

Jump to

Keyboard shortcuts

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