Documentation ¶
Index ¶
- func New(ctx context.Context, dsn string, log logrus.FieldLogger) (*pgxpool.Pool, error)
- func NewLoaderContext(ctx context.Context, dbConn *pgxpool.Pool) context.Context
- func NewPool(ctx context.Context, dsn string, log logrus.FieldLogger, migrate bool) (*pgxpool.Pool, error)
- func Transaction(ctx context.Context, callback func(ctx context.Context) error) error
- func TransactionFromContext(ctx context.Context) pgx.Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoaderContext ¶
func Transaction ¶
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 ¶
TransactionFromContext will return a potentially open transaction from the context, nil if none exists.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.