Documentation
¶
Index ¶
- func New(ctx context.Context, dsn string, log logrus.FieldLogger, opts ...OptFunc) (*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
- type OptFunc
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).
Types ¶
type OptFunc ¶
type OptFunc func(*settings)
func WithCloudSQLInstance ¶
func WithSlowQueryLogger ¶
WithSlowQueryLogger enables slow query logging This exposes attributes of the slow query to the logger, so it should not be used in production
Click to show internal directories.
Click to hide internal directories.