Documentation
¶
Overview ¶
Package database initializes shared PostgreSQL pools for SQL and GORM callers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open initializes and verifies a PostgreSQL pool using the supplied configuration. Connection setup is bounded by ten seconds or the caller's earlier deadline. The caller owns the returned pool and must close it on shutdown.
func OpenGORM ¶
func OpenGORM(ctx context.Context, cfg coredb.Config, idleTimeout time.Duration) (*gorm.DB, *sql.DB, error)
OpenGORM initializes one PostgreSQL pool and a GORM handle sharing that pool. The caller must close the returned SQL pool on shutdown. Initialization failures close the pool before returning; GORM does not open or ping a second connection.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.