load

package
v1.4.14 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package load applies verified bundles to fresh, started targets. Purpose: target preconditions. Inputs: loaded config. Outputs: refusal before writes. Constraints: Docker reads use the funnel; SQL identifiers are sanitized.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, cfg *config.Config, r *portable.Reader, opts Options) ([]portable.Exemption, error)

func ApplyStorage

func ApplyStorage(ctx context.Context, r *portable.Reader, store *objstore.Client, skip bool) ([]portable.Exemption, error)

func ApplyUsers

func ApplyUsers(ctx context.Context, db *pgx.Conn, users []verify.User) error

func AuthPreflight

func AuthPreflight(ctx context.Context, db queryRower, bundleUsers int) error

AuthPreflight refuses a bundle with users when the target already holds auth users: the load would add to them and verification (which counts every target user) could never reach zero.

func Connect

func Connect(ctx context.Context, cfg *config.Config) (*pgx.Conn, error)

func Empty

func Empty(ctx context.Context, db *pgx.Conn, schemas []string, storage bool) error

func Image

func Image(ctx context.Context, cfg *config.Config) (string, error)

func Started

func Started(ctx context.Context, dir string) error

func StoragePreflight

func StoragePreflight(m portable.Manifest, store *objstore.Client, skip bool) error

func Store

func Store(cfg *config.Config) (*objstore.Client, error)

func SystemTable

func SystemTable(schema, name string, storage bool) bool

func TryLock

func TryLock(ctx context.Context, db queryRower) error

TryLock takes the import lock on db without waiting.

func TypeFunctionCollisions

func TypeFunctionCollisions(ctx context.Context, db queryRower, toc string, schemas []string) error

Types

type Options

type Options struct {
	SkipStorage bool
	// Progress, when set, records whether the target was written and the last finished step.
	Progress *Progress
}

type Progress

type Progress struct {
	Wrote bool
	Step  string
}

Progress tells the caller whether Apply changed the target. Wrote is set immediately before the first statement that can change it (the compat or pre-data one-shot), so any error with Wrote false left the target untouched.

Jump to

Keyboard shortcuts

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