database

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InTransaction added in v0.2.0

func InTransaction(
	ctx context.Context,
	pool *pgxpool.Pool,
	operation func(pgx.Tx) error,
) error

InTransaction runs operation in a transaction and automatically commits or rolls it back.

func NewPool

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

NewPool creates a PostgreSQL connection pool and verifies that the database is available.

func OpenSQL

func OpenSQL(config Config) (*sql.DB, error)

OpenSQL creates a database/sql connection pool for migration tools.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config contains PostgreSQL connection settings loaded from the ProcessModule runtime environment.

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads PostgreSQL connection settings from environment variables and reads the password from a secret file.

Jump to

Keyboard shortcuts

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