Registry / database / plywood-postgres-requester

plywood-postgres-requester

JSON →
library1.4.0jsnpmunverified

PostgreSQL query requester for Plywood, version 1.4.0. Provides an abstraction layer to execute SQL queries against a Postgres database, returning results as a Promise-compatible Q promise. Designed specifically for integration with the Plywood data processing library. No active development observed; primarily used within the Plywood ecosystem. Releases are infrequent.

npm install plywood-postgres-requester
INSTALL
IMPORT
SIG · PLYWOOD-POSTGRES-R
P
plywood-postgres-requester
databasejavascriptv1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

postgresRequester
import { postgresRequester } from 'plywood-postgres-requester';
const plywoodPostgresRequester = require('plywood-postgres-requester').postgresRequester;
Named export; module uses CommonJS but TypeScript types are available. Use ES import or require as shown.
postgresRequesterGenerator
import { postgresRequesterGenerator } from 'plywood-postgres-requester';
const gen = require('plywood-postgres-requester').postgresRequesterGenerator;
Same as postgresRequester; they refer to the same function. Use one or the other.

Demonstrates importing the generator, creating a requestor with environment variables for credentials, and executing a simple query.

import { postgresRequesterGenerator } from 'plywood-postgres-requester'; const postgresRequester = postgresRequesterGenerator({ host: process.env.PGHOST ?? 'localhost', database: process.env.PGDATABASE ?? 'mydb', user: process.env.PGUSER ?? 'user', password: process.env.PGPASSWORD ?? '' }); postgresRequester({ query: 'SELECT 1 AS number;' }).then((res) => { console.log('Result:', res); }).catch((err) => { console.error('Error:', err); });
Debug
Known issues
deprecatedUses Q promises instead of native Promises. The `.done()` call in examples is a Q-specific method.
fix
Convert to native Promises: replace `.done()` with `.catch()` or `.finally()`. Use `.then()` as usual.
affects: >=1.0.0
gotchaThe function exported is named both `postgresRequester` and `postgresRequesterGenerator` in different examples; they are the same function.
fix
Import either name, they are identical. Prefer `postgresRequesterGenerator` for clarity.
affects: >=1.0.0
gotchaConnection options are passed directly to the `pg` library; ensure compatibility with your pg version.
fix
Refer to pg documentation for available connection parameters.
affects: >=1.0.0
Errors
Common errors & fixes
require(...).postgresRequester is not a function
Using CommonJS require incorrectly; the export is a named export.
fix
Use `require('plywood-postgres-requester').postgresRequester` or use ES import.
Cannot find module 'plywood-postgres-requester'
Module not installed or missing from node_modules.
fix
Run `npm install plywood-postgres-requester`.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
qrequiredPromise library used for query results
pgrequiredPostgreSQL client driver
Agent activity
6 hits · last 30 days
node
6
Resources
plywood-postgres-requester — npm install plywood-postgres-requester · libregistry