Categorygithub.com/go-nacelle/pgutil
repositorypackage
0.0.0-20240920022133-93ba6c1800f1
Repository: https://github.com/go-nacelle/pgutil.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Nacelle Postgres Utilities

PkgGoDev Build status Latest release

Postgres utilities for use with nacelle.


Usage

This library creates a Postgres connection wrapped in a nacelle logger. The supplied initializer adds this connection into the nacelle service container under the key db. The initializer will block until a ping succeeds.

func setup(processes nacelle.ProcessContainer, services nacelle.ServiceContainer) error {
    processes.RegisterInitializer(pgutil.NewInitializer())

    // additional setup
    return nil
}

Configuration

The default service behavior can be configured by the following environment variables.

Environment VariableRequiredDefaultDescription
DATABASE_URLyesThe connection string of the remote database.
LOG_SQL_QUERIESfalseWhether or not to log parameterized SQL queries.