Custom library developed by Voicer for interacting with PostgreSQL databases. Current stable version is 2.1.3. Provides a simplified wrapper around the `pg` (node-postgres) driver for common database operations like querying and connection management using environment variables. Designed for internal use within Voicer projects; not actively maintained for public adoption. Release cadence is low, with updates tied to internal needs. Key differentiator: opinionated setup via .env variables, reducing boilerplate for Voicer's infrastructure. Note: the library is not published on npm (only available via GitHub), and usage is strictly for PostgreSQL without ORM features.
npm install voicer-pg-libNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic query execution and connection pooling using voicer-pg-lib with environment variables for configuration.
Update imports to use named exports: `import { query } from 'voicer-pg-lib'` instead of `import pgLib from 'voicer-pg-lib'`.Ensure .env file is loaded before importing (e.g., with dotenv) or set environment variables in runtime.
Use `query` function for single queries; for complex transactions, acquire a client from `pool` and release it promptly.
Install @types/pg for type hints, but custom types may be needed for query results.
Check PG_HOST and PG_PORT values; ensure database server accepts connections from your IP.
Verify .env file has correct credentials; ensure user exists and has correct permissions.
Use `import { query } from 'voicer-pg-lib'` (ESM) or `const { query } = require('voicer-pg-lib')` (CJS).Create the database or update .env with an existing database name.