PostgreSQL
Provides an API for accessing PostgreSQL databasesThis is a module for Project Forge. It provides an API for accessing PostgreSQL databases.
https://github.com/kyleu/projectforge/tree/master/module/postgres
License
Licensed under CC0
Usage
- To configure a Postgres connection pool, call
database.OpenPostgresDatabase
, passingPostgresParams
- You can load the params from the environment by calling
PostgresParamsFromEnv
(with optional prefix), this will read the following by default:DB_HOST
- hostname to use, defaults tolocalhost
DB_PORT
- port to use, defaults to 5432DB_USER
- username for connectionsDB_PASSWORD
- password for connections (optional)DB_DATABASE
- database to useDB_SCHEMA
- schema to use (optional)DB_MAX_CONNECTIONS
- max active and idle connectionsDB_DEBUG
- if set totrue
, will log all statements and parameters