database

package
v0.1.46 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbFactory added in v0.1.22

type DbFactory interface {
	Register(newDb func(DbFactory) any) DbFactory
	PgDb() *PgDB
	Get(name reflect.Type) any
}

func NewDBFactory added in v0.1.22

func NewDBFactory(cfg config.CfgManager) (DbFactory, error)

type PgDB

type PgDB struct {
	Pool *pgxpool.Pool
}

func NewPostgresConnection

func NewPostgresConnection(cfg config.CfgManager) (*PgDB, error)

func (PgDB) WithConnection

func (db PgDB) WithConnection(ctx context.Context, fn func(*pgxpool.Conn) error) error

func (PgDB) WithTransaction

func (db PgDB) WithTransaction(ctx context.Context, fn func(pgx.Tx) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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