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
- func Apply(ctx context.Context, cfg *config.Config, r *portable.Reader, opts Options) ([]portable.Exemption, error)
- func ApplyStorage(ctx context.Context, r *portable.Reader, store *objstore.Client, skip bool) ([]portable.Exemption, error)
- func ApplyUsers(ctx context.Context, db *pgx.Conn, users []verify.User) error
- func AuthPreflight(ctx context.Context, db queryRower, bundleUsers int) error
- func Connect(ctx context.Context, cfg *config.Config) (*pgx.Conn, error)
- func Empty(ctx context.Context, db *pgx.Conn, schemas []string, storage bool) error
- func Image(ctx context.Context, cfg *config.Config) (string, error)
- func SkipKinds(r *portable.Reader) ([]string, error)
- func SkipPlatformOwned(ctx context.Context, db queryRower, toc, source string) (string, error)
- func Started(ctx context.Context, dir string) error
- func StorageCollisions(ctx context.Context, m portable.Manifest, store lister, skip bool) error
- func StoragePreflight(m portable.Manifest, store *objstore.Client, skip bool) error
- func Store(cfg *config.Config) (*objstore.Client, error)
- func SystemTable(schema, name string, storage bool) bool
- func TryLock(ctx context.Context, db queryRower) error
- func TypeFunctionCollisions(ctx context.Context, db queryRower, toc string, schemas []string) error
- type Options
- type Progress
Constants ¶
const RestoreSkipMember = "db/restore.skip"
RestoreSkipMember is the bundle member that names the archive entry kinds to leave out.
Variables ¶
This section is empty.
Functions ¶
func ApplyStorage ¶
func AuthPreflight ¶
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 SkipKinds ¶ added in v1.4.15
SkipKinds reads the bundle's restore.skip member; a bundle without one skips nothing.
func SkipPlatformOwned ¶ added in v1.4.15
SkipPlatformOwned comments out of a pg_restore list the platform function public.uuidv7() when the bundle was written by nSelf and the target already has that function, so a round trip does not refuse its own platform function (E519 in TypeFunctionCollisions). Bundles from any other source keep the line, so a foreign public.uuidv7() is still refused; a target without the function keeps the line too and gets the function from the dump.
func StorageCollisions ¶ added in v1.4.15
StorageCollisions refuses, before the first write, a bundle whose objects would replace objects the target store already holds (D-0723): the load is an unconditional PUT and verification compares against the bundle, so an overwrite would otherwise pass. Keys are compared in the store's canonical form, because a PUT to "a//b" replaces "a/b" without listing differently; a key with no canonical form, or two bundle keys that share one, are refused. A bucket the target does not have yet is empty. Errors name no key.