Documentation
¶
Overview ¶
Package database provides the cross-cutting Postgres connection pool shared by every domain: Connect builds a pgx-backed pool and hands back a *bun.DB for domains to query through.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect builds a pgxpool.Pool for dsn and returns it as a *bun.DB, still backed by pgxpool underneath so Postgres-aware pooling behavior applies.
func IsUniqueViolation ¶
IsUniqueViolation reports whether err is Postgres' unique_violation (SQLSTATE 23505).
Types ¶
type BunTransactor ¶
type BunTransactor struct {
// contains filtered or unexported fields
}
BunTransactor is the production Transactor, backed by a real top-level *bun.DB transaction.
func NewBunTransactor ¶
func NewBunTransactor(db *bun.DB) *BunTransactor
NewBunTransactor constructs a BunTransactor backed by db.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dbtest exercises Bun-backed repositories and services against a real Postgres database, rolling back every test's outer transaction so nothing is left behind.
|
Package dbtest exercises Bun-backed repositories and services against a real Postgres database, rolling back every test's outer transaction so nothing is left behind. |
Click to show internal directories.
Click to hide internal directories.