postgres

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package postgres is a drop-in PostgreSQL backend for the same storage interfaces internal/storage/sqlite implements (resource.Store, snapshot.Store, materialization.Store, manifest.Store, run.RunStore). Behavior and semantics mirror the sqlite package exactly; only the SQL dialect (positional $N placeholders) and driver differ.

Index

Constants

This section is empty.

Variables

View Source
var ErrManifestNotFound = manifest.ErrNotFound

ErrManifestNotFound is an alias for manifest.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.

View Source
var ErrRunNotFound = run.ErrNotFound

ErrRunNotFound is an alias for run.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.

View Source
var ErrSnapshotNotFound = snapshot.ErrNotFound

ErrSnapshotNotFound is an alias for snapshot.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.

View Source
var ErrTagNotFound = tag.ErrNotFound

ErrTagNotFound is an alias for tag.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.

Functions

func Migrate

func Migrate(db *sql.DB) error

func Open

func Open(dsn string) (*sql.DB, error)

Types

type ManifestStore

type ManifestStore struct {
	DB *sql.DB
}

func NewManifestStore

func NewManifestStore(db *sql.DB) *ManifestStore

func (*ManifestStore) Create

func (s *ManifestStore) Create(ctx context.Context, m manifest.Manifest) error

func (*ManifestStore) Get

func (s *ManifestStore) Get(ctx context.Context, manifestID string) (manifest.Manifest, error)

func (*ManifestStore) GetByIDOrRun

func (s *ManifestStore) GetByIDOrRun(ctx context.Context, idOrRun string) (manifest.Manifest, error)

GetByIDOrRun tries manifest_id first, then falls back to run_id.

type MaterializationStore

type MaterializationStore struct {
	DB *sql.DB
}

func NewMaterializationStore

func NewMaterializationStore(db *sql.DB) *MaterializationStore

func (*MaterializationStore) Create

func (*MaterializationStore) Get

func (*MaterializationStore) GetBySnapshot

type ResourceStore

type ResourceStore struct {
	DB *sql.DB
}

func NewResourceStore

func NewResourceStore(db *sql.DB) *ResourceStore

func (*ResourceStore) Create

func (s *ResourceStore) Create(ctx context.Context, r resource.Resource) error

Create transactionally inserts a Resource's sources+policies+resources rows — resource.Store is the single public port over all three tables.

func (*ResourceStore) Get

func (*ResourceStore) List

func (s *ResourceStore) List(ctx context.Context) ([]resource.Resource, error)

func (*ResourceStore) UpdateCurrentSnapshot

func (s *ResourceStore) UpdateCurrentSnapshot(ctx context.Context, uri, snapshotID string) error

type RunStore

type RunStore struct {
	DB *sql.DB
}

func NewRunStore

func NewRunStore(db *sql.DB) *RunStore

func (*RunStore) AppendMount

func (s *RunStore) AppendMount(ctx context.Context, runID string, e run.MountEntry) error

func (*RunStore) GetRun

func (s *RunStore) GetRun(ctx context.Context, runID string) (run.Run, error)

func (*RunStore) ListMounts

func (s *RunStore) ListMounts(ctx context.Context, runID string) ([]run.MountEntry, error)

func (*RunStore) MarkCommitted

func (s *RunStore) MarkCommitted(ctx context.Context, runID, manifestID string) error

func (*RunStore) StartRun

func (s *RunStore) StartRun(ctx context.Context, runID string) error

type SnapshotStore

type SnapshotStore struct {
	DB *sql.DB
}

func NewSnapshotStore

func NewSnapshotStore(db *sql.DB) *SnapshotStore

func (*SnapshotStore) Create

func (s *SnapshotStore) Create(ctx context.Context, snap snapshot.Snapshot) error

func (*SnapshotStore) Get

func (*SnapshotStore) ListByResource

func (s *SnapshotStore) ListByResource(ctx context.Context, uri string) ([]snapshot.Snapshot, error)

type TagStore

type TagStore struct {
	DB *sql.DB
}

func NewTagStore

func NewTagStore(db *sql.DB) *TagStore

func (*TagStore) Delete

func (s *TagStore) Delete(ctx context.Context, uri, name string) error

func (*TagStore) Get

func (s *TagStore) Get(ctx context.Context, uri, name string) (tag.Tag, error)

func (*TagStore) List

func (s *TagStore) List(ctx context.Context, uri string) ([]tag.Tag, error)

func (*TagStore) Set

func (s *TagStore) Set(ctx context.Context, t tag.Tag) error

Set upserts a tag after checking that the snapshot exists and was observed for this exact resource — the foreign keys alone would allow a tag on resource A to point at a snapshot of resource B.

Jump to

Keyboard shortcuts

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