Registry / database / fluent-pg

fluent-pg

JSON →
library0.3.6jsnpmunverified

fluent-pg is the official PostgreSQL driver for fluent-orm, a Node.js ORM. Version 0.3.6 is the latest stable release. It integrates seamlessly with fluent-orm's configurator pattern, enabling PostgreSQL connections via a simple configuration object. As a driver-only package, it does not include ORM features itself, making it lightweight. It ships TypeScript definitions and is designed for use with fluent-orm. It has a low release cadence.

npm install fluent-pg
INSTALL
IMPORT
SIG · FLUENT-PG
F
fluent-pg
databasejavascriptv0.3.6
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.

configure
✓ const { configure } = require('fluent-pg')
✗ const fluentPg = require('fluent-pg').default
CommonJS default export does not exist; named export 'configure' is correct. No ES module export.
configurator (from fluent-orm)
✓ const { configurator } = require('fluent-orm')
✗ import { configurator } from 'fluent-orm'
Package does not ship ES modules; must use require().
package
✓ npm install fluent-pg --save
✗ npm install fluent-pg --save-dev
Runtime dependency, not dev.

Registers the PostgreSQL driver with fluent-orm and configures a connection using environment variables for the password.

const { configurator } = require('fluent-orm'); const { configure } = require('fluent-pg'); // Register driver configurator.use(configure); // Configure connection configurator.configure({ default: 'pgsql', connections: { pgsql: { driver: 'pgsql', host: '127.0.0.1', port: '5432', database: 'postgres', user: 'postgres', password: process.env.DB_PASSWORD ?? '1234' } } }); // Now use configurator.get() etc. module.exports = configurator;
Debug
Known issues
gotchafluent-pg is solely a driver; you must install and configure fluent-orm separately.
fix
Make sure fluent-orm is installed: npm install fluent-orm
affects: >=0.0.0
deprecatedNo ES module support; CommonJS only.
fix
Use require() instead of import.
affects: >=0.0.0
gotchaPassword passed as plain text in configuration; consider using environment variables.
fix
Use process.env.DB_PASSWORD and hide config from version control.
affects: >=0.0.0
gotchaThe driver must be registered before configuring connections; otherwise fluent-orm may not recognize the pgsql driver.
fix
Always call configurator.use(configure) before configurator.configure().
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'fluent-pg'
Package not installed.
fix
Run: npm install fluent-pg --save
TypeError: configurator.use is not a function
Missing required import of fluent-orm's configurator.
fix
Ensure const { configurator } = require('fluent-orm'); is present.
Upgrade
Version history
0.3.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
fluent-pg — npm install fluent-pg · libregistry