psql

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternalDB = errors.New(
		"an error occurred that was not possible to recover from",
	)
	ErrBeginTx             = errors.New("could not begin transaction")
	ErrRollbackTx          = errors.New("could not rollback transaction")
	ErrCommitTx            = errors.New("could not commit transaction")
	ErrNoRowWithIdentifier = errors.New(
		"could not find requested row in database",
	)
)
View Source
var Migrations embed.FS

Functions

func CreatePooledConnection

func CreatePooledConnection(
	ctx context.Context,
	uri string,
) (*pgxpool.Pool, error)

Types

type Postgres

type Postgres struct {
	Pool  *pgxpool.Pool
	Queue *river.Client[pgx.Tx]
}

func NewPostgres

func NewPostgres(dbPool *pgxpool.Pool, queue *river.Client[pgx.Tx]) Postgres

func (Postgres) BeginTx

func (p Postgres) BeginTx(ctx context.Context) (pgx.Tx, error)

func (Postgres) CommitTx

func (p Postgres) CommitTx(ctx context.Context, tx pgx.Tx) error

func (Postgres) RollBackTx

func (p Postgres) RollBackTx(ctx context.Context, tx pgx.Tx) error

Jump to

Keyboard shortcuts

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