database

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package database provides shared database connectivity utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, cfg Config) (*sql.DB, error)

Connect opens a Postgres connection, applies pool settings, and pings the database to verify connectivity.

The caller is responsible for closing the returned *sql.DB.

TODO: import a driver (e.g. github.com/jackc/pgx/v5/stdlib) before calling.

Types

type Config

type Config struct {
	DSN             string
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime time.Duration
}

Config holds Postgres connection parameters.

Jump to

Keyboard shortcuts

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