database

package
v0.0.0-...-7bca6fd Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, dsn string, log logrus.FieldLogger) (*pgxpool.Pool, error)

func NewLoaderContext

func NewLoaderContext(ctx context.Context, dbConn *pgxpool.Pool) context.Context

func NewPool

func NewPool(ctx context.Context, dsn string, log logrus.FieldLogger, migrate bool) (*pgxpool.Pool, error)

func Transaction

func Transaction(ctx context.Context, callback func(ctx context.Context) error) error

Transaction executes a callback function within a transaction. Multiple calls to Transaction will start "nested" transactions (https://www.postgresql.org/docs/current/sql-savepoint.html).

func TransactionFromContext

func TransactionFromContext(ctx context.Context) pgx.Tx

TransactionFromContext will return a potentially open transaction from the context, nil if none exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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