Registry / database / dipswitch-postgres

dipswitch-postgres

JSON →
library1.0.0jsnpmunverified

dipswitch-postgres v1.0.0 provides a PostgreSQL-backed store for the dipswitch feature toggle library. It integrates with dipswitch to persist and retrieve toggle states in a PostgreSQL database. The package is stable but minimal, designed specifically for dipswitch and requiring a PostgreSQL connection string. Compared to other stores (e.g., in-memory or Redis), dipswitch-postgres offers persistent storage for production use. Release cadence is low; no recent updates.

npm install dipswitch-postgres
INSTALL
IMPORT
SIG · DIPSWITCH-POSTGRES
D
dipswitch-postgres
databasejavascriptv1.0.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.

createStore
import createStore from 'dipswitch-postgres';
import { createStore } from 'dipswitch-postgres';
Default export is a factory function that takes a connection string.
dipswitch
import Dipswitch from 'dipswitch';
const Dipswitch = require('dipswitch').default;
dipswitch is a CommonJS package; require or import default works.
commonjs require
const createStore = require('dipswitch-postgres');
CommonJS require works as the package does not specify 'type': 'module'.

Shows how to create a PostgreSQL-backed dipswitch store and check a feature toggle.

import createPostgresStore from 'dipswitch-postgres'; import Dipswitch from 'dipswitch'; const connectionString = 'postgres://user:password@localhost:5432/dipswitch_db'; const store = createPostgresStore(connectionString); const dipswitch = new Dipswitch({ store: store }); const isEnabled = await dipswitch.isEnabled('my-feature', { user: '123' }); console.log('Feature enabled:', isEnabled);
Debug
Known issues
gotchaConnection string must be provided as a single string argument; using an object will fail.
fix
Pass a valid PostgreSQL connection string (string type) to the default export function.
affects: >=1.0.0
gotchaThe store does not create the database or tables automatically; they must exist.
fix
Ensure PostgreSQL database and required tables are created before using the store.
affects: >=1.0.0
gotchaThe package has no TypeScript definitions; using in TypeScript may require custom type declarations.
fix
Create a declaration file: declare module 'dipswitch-postgres';
affects: >=1.0.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED
PostgreSQL server is not running or connection string is incorrect.
fix
Verify PostgreSQL is started and connection string is correct.
Error: relation "features" does not exist
The required database tables have not been created.
fix
Create the necessary tables as per dipswitch documentation.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
dipswitchrequiredThis store is designed to be used with dipswitch, which is required for creating the toggle instance.
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
dipswitch-postgres — npm install dipswitch-postgres · libregistry