Documentation
¶
Overview ¶
Package internal contains utilities and helper functions useful in the scope of eventually's postgres implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunTransaction ¶
func RunTransaction( ctx context.Context, db TxBeginner, options pgx.TxOptions, do func(ctx context.Context, tx pgx.Tx) error, ) (err error)
RunTransaction runs a critical data change path in a transaction, seamlessly handling the transaction lifecycle (begin, commit, rollback).
Types ¶
type PostgresContainer ¶
type PostgresContainer struct { *postgres.PostgresContainer ConnectionDSN string PostgresConfig *pgx.ConnConfig }
PostgresContainer returns an handle on a Postgres container started through testcontainers.
func NewPostgresContainer ¶
func NewPostgresContainer(ctx context.Context) (*PostgresContainer, error)
NewPostgresContainer creates and starts a new Postgres container using testcontainers, then returns a handle to said container to manage its lifecycle.
type TxBeginner ¶
TxBeginner represents a pgx-related component that can initiate transactions.
Click to show internal directories.
Click to hide internal directories.