postgres

package
v0.70.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package postgres implements the store.Store interface using PostgreSQL with sqlc-generated query code and pgx as the driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements store.Store using PostgreSQL.

func New

func New(pool *pgxpool.Pool) *Store

New creates a new PostgreSQL store.

func (*Store) BeginTx

func (s *Store) BeginTx(ctx context.Context) (pgx.Tx, *sqlc.Queries, error)

BeginTx starts a transaction and returns queries scoped to it.

func (*Store) CreateNamespace

func (s *Store) CreateNamespace(ctx context.Context, ns *store.Namespace) error

func (*Store) CreateSchema

func (s *Store) CreateSchema(ctx context.Context, schema *store.Schema) error

func (*Store) DiscardStaging

func (s *Store) DiscardStaging(ctx context.Context, namespaceID string) error

func (*Store) GetBlob

func (s *Store) GetBlob(ctx context.Context, namespaceID, sha256hex string) (*store.ProtoBlob, error)

func (*Store) GetNamespace

func (s *Store) GetNamespace(ctx context.Context, id string) (*store.Namespace, error)

func (*Store) GetSchema

func (s *Store) GetSchema(ctx context.Context, namespaceID, schemaID string) (*store.Schema, error)

func (*Store) GetVersion

func (s *Store) GetVersion(ctx context.Context, namespaceID, schemaID string, version uint64) (*store.SchemaVersion, error)

func (*Store) GetVersionFiles

func (s *Store) GetVersionFiles(ctx context.Context, namespaceID, schemaID string, version uint64) ([]store.VersionFile, error)

func (*Store) ListNamespaces

func (s *Store) ListNamespaces(ctx context.Context) ([]*store.Namespace, error)

func (*Store) ListNamespacesPage

func (s *Store) ListNamespacesPage(ctx context.Context, after string, limit int) ([]*store.Namespace, error)

func (*Store) ListSchemas

func (s *Store) ListSchemas(ctx context.Context, namespaceID string) ([]*store.Schema, error)

func (*Store) ListSchemasPage

func (s *Store) ListSchemasPage(ctx context.Context, namespaceID, after string, limit int) ([]*store.Schema, error)

func (*Store) ListVersions

func (s *Store) ListVersions(ctx context.Context, namespaceID, schemaID string) ([]uint64, error)

func (*Store) LoadAllCurrent

func (s *Store) LoadAllCurrent(ctx context.Context) ([]*store.CurrentSchema, error)

func (*Store) LoadNamespaceCurrent

func (s *Store) LoadNamespaceCurrent(ctx context.Context, namespaceID string) ([]*store.CurrentSchema, error)

func (*Store) LoadNamespaceProposed

func (s *Store) LoadNamespaceProposed(ctx context.Context, namespaceID string) ([]*store.CurrentSchema, error)

func (*Store) Promote

func (s *Store) Promote(ctx context.Context, namespaceID string) ([]store.PromotedSchema, error)

func (*Store) PutBlob

func (s *Store) PutBlob(ctx context.Context, blob *store.ProtoBlob) error

func (*Store) PutVersion

func (s *Store) PutVersion(ctx context.Context, ver *store.SchemaVersion, files []store.VersionFile, deps []store.VersionDep) error

func (*Store) SetStaged

func (s *Store) SetStaged(ctx context.Context, namespaceID, schemaID string, version uint64) error

Directories

Path Synopsis
Package pgtest provides a shared test helper for spinning up a PostgreSQL container with migrations applied.
Package pgtest provides a shared test helper for spinning up a PostgreSQL container with migrations applied.

Jump to

Keyboard shortcuts

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