db

package
v0.11.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package db provides shared PostgreSQL connections and central bootstrap migrations. Call Open once at boot, pass the *sql.DB to every store constructor.

Independent persistent stores retain their own constructor migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *sql.DB) error

Migrate atomically creates bootstrap-owned tables and upgrades shared suspension/routine, goal and gateway definitions. Other stores migrate separately. Concurrent updated bootstraps coordinate with shared-store owner locks.

func Open

func Open(connStr string) (*sql.DB, error)

Open connects to PostgreSQL and verifies connectivity. connStr should be a PostgreSQL connection string, e.g. "postgres://user:***@localhost:5432/overkill?sslmode=disable".

func OpenContext

func OpenContext(ctx context.Context, connStr string) (*sql.DB, error)

OpenContext opens a shared pool and verifies connectivity within the caller's deadline. The caller owns the returned pool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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