postgres

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package postgres implements the repo interface for all the services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropTables

func DropTables(ctx context.Context, pool *pgxpool.Pool, tables Tables) error

func Migrate

func Migrate(ctx context.Context, pool *pgxpool.Pool, tables Tables) error

func ValidateSchema

func ValidateSchema(ctx context.Context, pool *pgxpool.Pool, tables Tables) error

Types

type Repo

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

func NewRepo

func NewRepo(pool *pgxpool.Pool, tables Tables) (*Repo, error)

func (*Repo) Delete

func (r *Repo) Delete(ctx context.Context, path string) error

func (*Repo) Get

func (r *Repo) Get(ctx context.Context, path string) (stowry.MetaData, error)

func (*Repo) List

func (*Repo) ListPendingCleanup

func (r *Repo) ListPendingCleanup(ctx context.Context, q stowry.ListQuery) (stowry.ListResult, error)

func (*Repo) MarkCleanedUp

func (r *Repo) MarkCleanedUp(ctx context.Context, id uuid.UUID) error

func (*Repo) Ping

func (r *Repo) Ping(ctx context.Context) error

Ping verifies database connectivity

func (*Repo) Upsert

func (r *Repo) Upsert(ctx context.Context, entry stowry.ObjectEntry) (stowry.MetaData, bool, error)

type TableMigration

type TableMigration struct {
	TableName string
	Up        func(ctx context.Context, pool *pgxpool.Pool) error
	Down      func(ctx context.Context, pool *pgxpool.Pool) error
}

type Tables

type Tables = stowry.Tables

Tables is an alias for stowry.Tables for package compatibility.

Jump to

Keyboard shortcuts

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