pool
PostgreSQL connection pool instance for executing database queries.
Import
import { pool } from '@evershop/evershop/lib/postgres';
import {select} from '@evershop/postgres-query-builder';
const product = await select().from('product').where('product_id', 123).load(pool);
Type
Pool
The pool is a PostgreSQL connection pool instance from the pg library.
Configuration
The pool is configured using environment variables or configuration file:
Environment Variables
DB_HOST- Database hostDB_PORT- Database portDB_USER- Database userDB_PASSWORD- Database passwordDB_NAME- Database nameDB_SSLMODE- SSL mode (disable, require, prefer, verify-ca, verify-full, no-verify)DB_SSLROOTCERT- Path to SSL root certificateDB_SSLCERT- Path to SSL certificateDB_SSLKEY- Path to SSL key
See Also
- getConnection - Get a dedicated database connection
- getConfig - Get configuration values