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

postgres

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package postgres opens the application's Postgres connection pool and exposes a golang-migrate driver constructor for use by internal/migrate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DSN

func DSN(cfg config.Config) string

DSN builds the libpq-style DSN from the config.

func MigrateDriver

func MigrateDriver(cfg config.Config) (database.Driver, error)

MigrateDriver opens a *sql.DB via the pgx stdlib shim and wraps it as a golang-migrate database.Driver. The returned driver owns its own *sql.DB; the migrate runner closes it via the underlying source-close path. Callers should not Close the returned driver themselves (migrate.Run closes it).

func Open

func Open(ctx context.Context, cfg config.Config) (*pgxpool.Pool, error)

Open returns a connected pgx pool, with a Ping verified.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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