Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

func Open(ctx context.Context, cfg coredb.Config, idleTimeout time.Duration) (*sql.DB, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL