Documentation
¶
Overview ¶
Package db provides database connection helpers for the Mote backend.
It reads the DATABASE_URL from the environment and exposes a Connect function that returns a ready-to-use pgx connection. Integration tests should call Connect directly; unit tests can use the pool from this package's test helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect creates a new connection pool using MOTE_DATABASE_URL. The pool is configured with reasonable defaults for local development and will be closed when the provided context is cancelled.
func ConnectURL ¶
ConnectURL creates a new connection pool for the given database URL.
func DefaultURL ¶
DefaultURL returns the default database URL from the MOTE_DATABASE_URL environment variable. It returns a useful error if the variable is unset.
Types ¶
This section is empty.