Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.75 KB

README.md

File metadata and controls

31 lines (21 loc) · 1.75 KB

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 Variable Required Default Description
DATABASE_URL yes The connection string of the remote database.
LOG_SQL_QUERIES false Whether or not to log parameterized SQL queries.