Documentation
¶
Overview ¶
Package storage owns the Postgres connection pool and runs migrations.
In the new arch the catalog "domain repos" that used to live here moved out: each `app/X.Store` constructs its own sqlc-backed queries via `gen.New(pool)` against the pool surfaced by Storage.Pool(). Storage's remaining job is composition-root plumbing — open, ping, hand out the pool, close.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is the data-access handle the composition root passes around.
func Open ¶
Open opens a connection pool, runs pending migrations, and returns a ready-to-use *Storage. The returned Storage must be closed with Close when no longer needed.
func WrapPool ¶
WrapPool wraps an existing *pgxpool.Pool into a *Storage without opening a new pool or running migrations. Intended for tests that supply their own pool. The returned Storage must NOT be closed — the caller owns the pool's lifetime.