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 ¶
- Variables
- func Migrate(db *sql.DB) error
- func Open(dsn string) (*sql.DB, error)
- type ManifestStore
- type MaterializationStore
- func (s *MaterializationStore) Create(ctx context.Context, m materialization.Materialization) error
- func (s *MaterializationStore) Get(ctx context.Context, id string) (materialization.Materialization, error)
- func (s *MaterializationStore) GetBySnapshot(ctx context.Context, snapshotID string, strategy materialization.Strategy) (materialization.Materialization, bool, error)
- type ResourceStore
- func (s *ResourceStore) Create(ctx context.Context, r resource.Resource) error
- func (s *ResourceStore) Get(ctx context.Context, uri string) (resource.Resource, error)
- func (s *ResourceStore) List(ctx context.Context) ([]resource.Resource, error)
- func (s *ResourceStore) UpdateCurrentSnapshot(ctx context.Context, uri, snapshotID string) error
- type RunStore
- func (s *RunStore) AppendMount(ctx context.Context, runID string, e run.MountEntry) error
- func (s *RunStore) GetRun(ctx context.Context, runID string) (run.Run, error)
- func (s *RunStore) ListMounts(ctx context.Context, runID string) ([]run.MountEntry, error)
- func (s *RunStore) MarkCommitted(ctx context.Context, runID, manifestID string) error
- func (s *RunStore) StartRun(ctx context.Context, runID string) error
- type SnapshotStore
- type TagStore
Constants ¶
This section is empty.
Variables ¶
var ErrManifestNotFound = manifest.ErrNotFound
ErrManifestNotFound is an alias for manifest.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.
var ErrRunNotFound = run.ErrNotFound
ErrRunNotFound is an alias for run.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.
var ErrSnapshotNotFound = snapshot.ErrNotFound
ErrSnapshotNotFound is an alias for snapshot.ErrNotFound, kept exported here for callers that prefer referring to the storage package directly.
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 ¶
Types ¶
type ManifestStore ¶
func NewManifestStore ¶
func NewManifestStore(db *sql.DB) *ManifestStore
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 ¶
func NewMaterializationStore ¶
func NewMaterializationStore(db *sql.DB) *MaterializationStore
func (*MaterializationStore) Create ¶
func (s *MaterializationStore) Create(ctx context.Context, m materialization.Materialization) error
func (*MaterializationStore) Get ¶
func (s *MaterializationStore) Get(ctx context.Context, id string) (materialization.Materialization, error)
func (*MaterializationStore) GetBySnapshot ¶
func (s *MaterializationStore) GetBySnapshot(ctx context.Context, snapshotID string, strategy materialization.Strategy) (materialization.Materialization, bool, error)
type ResourceStore ¶
func NewResourceStore ¶
func NewResourceStore(db *sql.DB) *ResourceStore
func (*ResourceStore) Create ¶
Create transactionally inserts a Resource's sources+policies+resources rows — resource.Store is the single public port over all three tables.
func (*ResourceStore) UpdateCurrentSnapshot ¶
func (s *ResourceStore) UpdateCurrentSnapshot(ctx context.Context, uri, snapshotID string) error
type RunStore ¶
func NewRunStore ¶
func (*RunStore) AppendMount ¶
func (*RunStore) ListMounts ¶
func (*RunStore) MarkCommitted ¶
type SnapshotStore ¶
func NewSnapshotStore ¶
func NewSnapshotStore(db *sql.DB) *SnapshotStore