pgdb

package
v0.0.0-...-549d4bb Latest Latest
Warning

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

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

Documentation

Overview

Package pgdb will hold the PostgreSQL-backed implementation of the internal/eds/pkg/store interface (phase 3). For now it only provides the schema migration runner: it is not wired into any production code path.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = cerr.NewAsertoError("E20150", codes.NotFound, http.StatusNotFound, "key not found")

ErrNotFound is returned by Get* methods when no row matches. It maps to codes.NotFound via status.Code(err), the same contract internal/eds/pkg/bdb's errors satisfy, so callers written against store.Tx don't need to know which backend they're talking to.

Functions

func Down

func Down(dsn string) error

Down rolls back every migration, dropping the schema Migrate created. For tests and local development; not used by any production path.

func Migrate

func Migrate(dsn string) error

Migrate applies every pending migration to the Postgres database at dsn.

Types

type Store

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

Store is a store.Store implementation backed by a Postgres connection pool. It is not wired into any production code path yet (phase 4).

func Open

func Open(ctx context.Context, dsn string) (*Store, error)

Open creates a connection pool for dsn and verifies it is reachable.

func (*Store) Batch

func (s *Store) Batch(ctx context.Context, fn func(store.Tx) error) error

Batch runs fn in a regular read-write transaction: Postgres has no equivalent of bbolt's optimistic-batching Update mode, so this is the closest match.

func (*Store) Close

func (s *Store) Close()

Close releases the connection pool.

func (*Store) Update

func (s *Store) Update(ctx context.Context, fn func(store.Tx) error) error

func (*Store) View

func (s *Store) View(ctx context.Context, fn func(store.Tx) error) error

Jump to

Keyboard shortcuts

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