postgres

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package postgres owns the resources schema and data access identity.

Index

Constants

This section is empty.

Variables

View Source
var Schema string

Functions

func Migrate

func Migrate(ctx context.Context, db *sql.DB) error

Migrate uses a separate migration identity. Initial categories are ordinary persisted settings; repeated migrations never overwrite operator changes.

Types

type Repository

type Repository struct{ DB *sql.DB }

func (*Repository) CheckRuntime

func (r *Repository) CheckRuntime(ctx context.Context) error

CheckRuntime rejects migration credentials and cross-module access at startup.

func (*Repository) Claim

func (r *Repository) Claim(ctx context.Context, worker string, now time.Time, lease time.Duration) (resources.Job, error)

func (*Repository) ConfirmOutbox

func (r *Repository) ConfirmOutbox(ctx context.Context, id string) error

func (*Repository) DiscoverySnapshot

func (r *Repository) DiscoverySnapshot(ctx context.Context, cursor string, limit int) (out c.DiscoveryPage, err error)

DiscoverySnapshot preserves object versions using transaction visibility on immutable history. Retention invalidates existing cursors, never silently resets.

func (*Repository) PendingOutbox

func (r *Repository) PendingOutbox(ctx context.Context, limit int, excludeSubjects []string) ([]m.Envelope, error)

func (*Repository) PrunePackages

func (r *Repository) PrunePackages(ctx context.Context, now time.Time, n int) error

PrunePackages removes only expired selection snapshots, never business records or idempotency receipts.

func (*Repository) ReadAccount

func (r *Repository) ReadAccount(ctx context.Context, s aq.Selection) ([]aq.Record, error)

ReadAccount filters authoritative module facts before the stable exclusive page.

func (*Repository) ReadAudit

func (r *Repository) ReadAudit(ctx context.Context, q a.Request) (out a.Batch, err error)

ReadAudit reads only explicitly projected fields inside a repeatable-read transaction. Visibility excludes late commits; epoch invalidates changed data.

func (*Repository) Transaction

func (r *Repository) Transaction(ctx context.Context, run func(resources.Transaction) error) error

Jump to

Keyboard shortcuts

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