db

package
v0.7.19 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package db wraps the Postgres connection pool and migration runner used by the CronFoundry service process. Callers depend on the *pgxpool.Pool type directly; this package only handles construction and lifecycle.

Index

Constants

This section is empty.

Variables

View Source
var MigrationsFS embed.FS

MigrationsFS is the embedded filesystem containing all goose SQL migrations. Migration files live under migrations/ and follow goose's NNN_name.sql naming convention.

Functions

func Migrate

func Migrate(ctx context.Context, dsn string) (retErr error)

Migrate applies all up-migrations from MigrationsFS against the database at dsn. The call is idempotent: re-running against an up-to-date database is a no-op.

func NewPool

func NewPool(ctx context.Context, dsn string) (*pgxpool.Pool, error)

NewPool builds a pgx connection pool from the given DSN and verifies reachability with a Ping before returning.

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