database

package
v0.0.0-...-cfcd66d Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, cfg *PostgresConfig) (*pgxpool.Pool, error)

Connect opens a Postgres connection pool using cfg and retries Ping with exponential backoff until the connection succeeds or defaultMaxTimeout elapses.

func NewClient

func NewClient(db *pgxpool.Pool) dbpkg.Client

func ResolveURL

func ResolveURL(url, urlFile string) (string, error)

ResolveURL returns url, unless urlFile is non-empty in which case the URL is read from that file. Used by callers (e.g. the migration runner) that need the resolved connection string before a pool is created.

Types

type PostgresConfig

type PostgresConfig struct {
	URL           string
	VectorEnabled bool
}

PostgresConfig holds the connection parameters for a Postgres database. URL must be a resolved connection string — use ResolveURL to resolve from a file path before constructing this config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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