Documentation
¶
Overview ¶
Package dbpool provides the process-wide Postgres pool used by server-side features that read the project database directly — the Studio SQL runner and Studio membership lookups.
One pool, opened lazily on first use, because these features are optional: a deployment without a DSN must still start and serve everything else. Callers get a plain error when no DSN is configured and are expected to fail closed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoDSN = errors.New("no database DSN configured (SUPATYPE_SQL_DATABASE_URL or DATABASE_URL)")
ErrNoDSN is returned when neither DSN environment variable is set.
Functions ¶
func DSN ¶
func DSN() string
DSN returns the configured connection string, preferring the explicit Supatype variable over the generic one so a deployment can point admin features at a different role than the app's.
func Pool ¶
Pool returns the shared pool, opening it on first call.
The returned error is stable across calls: it can only come from a missing or unparseable DSN, both of which are fixed at startup. Reaching the database is not attempted here — pgxpool connects lazily — so a database that is merely slow to come up does not permanently poison the pool.
Types ¶
This section is empty.