store

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package store is the service's PostgreSQL: the SDK's postgres provider with the service's schema (templates) and migrations, plus the queries sqld generated.

Index

Constants

View Source
const Schema = "templates"

Schema every table lives in.

Variables

This section is empty.

Functions

func New

func New(cfg postgres.Config) deps.Provider[*Store]

New is the provider: the postgres driver with the schema and the migrations.

Types

type Store

type Store struct {
	*postgres.DB

	// Q runs on DB: inside the context's transaction, else the pool.
	Q *db.Queries
}

Store is the connection with the typed queries.

func (*Store) InTx

func (s *Store) InTx(ctx context.Context, fn func(ctx context.Context) error) error

InTx runs fn in one read-committed transaction; queries on Q join it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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