Registry / database / plump-store-postgres

plump-store-postgres

JSON →
library0.27.0jsnpmunverified

Postgres adapter for the Plump ORM/activerecord-style datastore. Current stable version is 0.27.0, released on an as-needed cadence. It provides a PostgreSQL endpoint for Plump models, supporting queries, migrations, and transactions. Differentiators include tight integration with Plump's schema and migration system, TypeScript-first design with full type support, and a simple promise-based API. Not recommended for standalone use; requires the core `plump` package.

npm install plump-store-postgres
INSTALL
IMPORT
SIG · PLUMP-STORE-POSTGR
P
plump-store-postgres
databasejavascriptv0.27.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.

PostgresStore
import { PostgresStore } from 'plump-store-postgres'
import PostgresStore from 'plump-store-postgres'
Named export, not default. For CJS: const { PostgresStore } = require('plump-store-postgres')

Initializes a PostgresStore, plugs it into the main Plump instance, connects, runs a query, and disconnects.

import { PostgresStore } from 'plump-store-postgres'; import { Plump } from 'plump'; const store = new PostgresStore({ host: process.env.PGHOST ?? 'localhost', port: parseInt(process.env.PGPORT ?? '5432'), database: process.env.PGDATABASE ?? 'myapp', user: process.env.PGUSER ?? 'postgres', password: process.env.PGPASSWORD ?? '' }); const plump = new Plump({ store }); async function main() { await plump.connect(); const user = await plump.one('users', { email: 'test@example.com' }); console.log(user); await plump.disconnect(); } main().catch(console.error);
Debug
Known issues
breakingRequires Plump core 0.x – breaking changes may occur across minor versions before 1.0.
fix
Pin exact versions of both plump and plump-store-postgres in package.json.
affects: >=0.0 <1.0
deprecatedConfiguration via environment variables is the recommended pattern; passing plain objects is not deprecated but less secure in some contexts.
fix
Use env vars or a secret manager for production; avoid hardcoding credentials.
affects: >=0.0
gotchaThe store does not pool connections by default – each connect() creates a new client.
fix
Use an external pool or call connect() once and reuse the plump instance.
affects: >=0.0
Errors
Common errors & fixes
Error: Cannot find module 'pg'
pg is a peer dependency not auto-installed.
fix
Run: npm install pg
TypeError: plump.one is not a function
Using an older version of Plump core that does not include the 'one' method.
fix
Upgrade plump to at least 0.20.0.
Error: relation "users" does not exist
Migrations not run or table not created.
fix
Run plump migration commands before querying: await plump.migrate() or use plump CLI.
Upgrade
Version history
0.27.0latest on npm
Audit
Dependencies
plumprequiredCore Plump ORM – this adapter is an add-on and requires plump to be installed.
pgrequiredPostgreSQL client driver for Node.js.
Agent activity
2 hits · last 30 days
node
2
Resources
plump-store-postgres — npm install plump-store-postgres · libregistry