database

package
v0.0.0-...-8b97ac1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTxAlreadyStarted = errors.New("transaction already started")

Functions

func New

func New(ctx context.Context, cnf *config.Config) (*poolDB, error)

func NewSingle

func NewSingle(ctx context.Context, cnf *config.Config) (*singleDB, error)

func Transaction

func Transaction(ctx context.Context, f func(c context.Context) error) error

func WithDB

func WithDB(ctx context.Context, db DB) context.Context

Types

type DB

type DB interface {
	Queries() *sqlc.Queries
	Close()
	Ping(ctx context.Context) error
}

func FromContext

func FromContext(ctx context.Context) DB

Jump to

Keyboard shortcuts

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