postgresql

package
v0.0.0-...-89e479d Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapDataset

func MapDataset(rows DatasetRows, limits provider.Limits) (*provider.Dataset, error)

MapDataset validates one stable PostgreSQL row snapshot through provider-neutral owners.

func MapNativeKeyMaterial

func MapNativeKeyMaterial(
	rows []KeyMaterialRow,
	generation uint64,
) ([]*signingstore.NativeKeyMaterial, error)

MapNativeKeyMaterial validates and detaches one exact native PostgreSQL key set.

func OpenAdministrator

func OpenAdministrator(
	ctx context.Context,
	snapshotConfig ConnectionConfig,
	stagingConfig ConnectionConfig,
	activationConfig ConnectionConfig,
	limits provider.Limits,
	generations datasourceadmin.GenerationLimits,
	pageSize int,
) (*sqlsnapshot.Administrator, error)

OpenAdministrator opens three distinct verified PostgreSQL role pools.

func RejectEnvironment

func RejectEnvironment() error

RejectEnvironment fails closed when libpq-compatible process variables could influence pgx parsing or cause implicit filesystem access.

Types

type ConnectionConfig

type ConnectionConfig struct {
	Address         string
	ServerName      string
	Database        string
	User            string
	Password        []byte
	RootCAs         *x509.CertPool
	ConnectTimeout  time.Duration
	MaxConnections  int32
	IdleConnections int32
}

ConnectionConfig owns one verified single-authority PostgreSQL endpoint.

func (ConnectionConfig) Format

func (ConnectionConfig) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing connection facts.

func (ConnectionConfig) GoString

func (ConnectionConfig) GoString() string

GoString returns a constant protected connection representation.

func (ConnectionConfig) MarshalJSON

func (ConnectionConfig) MarshalJSON() ([]byte, error)

MarshalJSON emits an empty object without connection facts.

func (ConnectionConfig) String

func (ConnectionConfig) String() string

String returns a constant protected connection summary.

func (ConnectionConfig) Validate

func (c ConnectionConfig) Validate() error

Validate rejects environment-derived, insecure, multi-authority, or widened settings.

type CredentialRow

type CredentialRow = sqlsnapshot.CredentialRow

CredentialRow is one explicit public credential projection.

type DatasetRows

type DatasetRows = sqlsnapshot.DatasetRows

DatasetRows contains one transactionally fenced exact generation.

type HandleRow

type HandleRow = sqlsnapshot.HandleRow

HandleRow is one explicit opaque handle projection.

type KeyMaterialRow

type KeyMaterialRow = sqlsnapshot.KeyMaterialRow

KeyMaterialRow is one explicit native private-key projection.

type Loader

type Loader = sqlsnapshot.Loader

Loader reads one repeatable-read PostgreSQL generation into an immutable snapshot.

func NewLoader

func NewLoader(
	pool Pool,
	limits provider.Limits,
	pageSize int,
	maxBytes int,
	maxDeadline time.Duration,
) (*Loader, error)

NewLoader validates one bounded PostgreSQL loader configuration.

type MetadataRow

type MetadataRow = sqlsnapshot.MetadataRow

MetadataRow is one explicit dataset metadata projection.

type PolicyRow

type PolicyRow = sqlsnapshot.PolicyRow

PolicyRow is one explicit administrative policy projection.

type Pool

type Pool = sqlsnapshot.Pool

Pool begins bounded read-only transactions and owns backend resources.

func OpenPool

func OpenPool(ctx context.Context, config ConnectionConfig) (Pool, error)

OpenPool constructs a pgx pool exclusively from validated typed fields.

type ProfileRow

type ProfileRow = sqlsnapshot.ProfileRow

ProfileRow is one explicit profile projection.

type PurgeExecutor

type PurgeExecutor struct {
	// contains filtered or unexported fields
}

PurgeExecutor owns the PostgreSQL fourth-role destruction session. It has no direct table mutation API; the schema-owned routine is the only write path.

func OpenPurgeExecutor

func OpenPurgeExecutor(ctx context.Context, config ConnectionConfig) (*PurgeExecutor, error)

OpenPurgeExecutor opens and verifies a dedicated PostgreSQL purge principal.

func (*PurgeExecutor) Close

func (e *PurgeExecutor) Close()

Close releases the dedicated purge pool.

func (*PurgeExecutor) Purge

Purge invokes the fixed schema-owned procedure exactly once per protected target. A transport or commit error remains unknown and is never retried.

func (*PurgeExecutor) Reconcile

Reconcile reads exact target and receipt state after an uncertain procedure outcome. It repeats a call only after proving that target never committed.

type TerminalExecutor

type TerminalExecutor struct {
	// contains filtered or unexported fields
}

TerminalExecutor invokes only the fixed PostgreSQL 005 terminal procedure.

func OpenTerminalExecutor

func OpenTerminalExecutor(ctx context.Context, config ConnectionConfig) (*TerminalExecutor, error)

OpenTerminalExecutor verifies a closer-only PostgreSQL principal.

func (*TerminalExecutor) Close

func (e *TerminalExecutor) Close()

Close releases the dedicated terminal-closure pool.

func (*TerminalExecutor) ReadTerminal

ReadTerminal returns only an exact immutable terminal projection.

func (*TerminalExecutor) RecordTerminal

func (e *TerminalExecutor) RecordTerminal(ctx context.Context, record datasourceadmin.TerminalRecord) error

RecordTerminal invokes once and reconciles an uncertain outcome by exact immutable row readback.

type Transaction

type Transaction = sqlsnapshot.Transaction

Transaction is one fixed-query read-only stable-snapshot boundary.

Jump to

Keyboard shortcuts

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