Registry / database / acidjs

acidjs

JSON →
library1.0.2jsnpmunverified

A simple, promise-based PostgreSQL query builder built on pg 4.x and psqljs. Version 1.0.2 (last released in 2016) targets Node 0.12.x and CommonJS only. Provides basic CRUD helpers (insert, where, update, delete) and raw SQL execution. No TypeScript types, no connection pooling, and no migration tooling. Deprecated in favor of modern alternatives like pg-promise, knex, or Sequelize.

npm install acidjs
INSTALL
IMPORT
SIG · ACIDJS
A
acidjs
databasejavascriptv1.0.2
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.

default (factory function)
var acid = require('acidjs')('postgres://...');
import acid from 'acidjs';
Package does not support ESM. Use CommonJS require with connection string argument.

Initializes acid.js with a PostgreSQL connection string and runs a raw SQL query.

var acid = require('acidjs')('postgres://postgres:@localhost:5432/mydb'); acid.sql('SELECT NOW()') .then(function(rows) { console.log('Current time:', rows[0].now); }) .catch(function(err) { console.error('Query failed:', err); });
Debug
Known issues
deprecatedPackage is unmaintained since 2016. No support for Node.js >=4.0, ESM, or current pg versions.
fix
Migrate to a maintained library like pg-promise or knex.
affects: >=1.0.0
breakingRequires Node 0.12.x – will not work on modern Node.js due to removed APIs (e.g., old Buffer, async patterns).
fix
Use Node 0.12 or upgrade to a modern library.
affects: >=1.0.0
breakingPeer dependency pg 4.x is incompatible with pg >=5.0. Installing with newer pg will cause runtime errors.
fix
Pin pg to 4.x or use a different library.
affects: >=1.0.0
gotchaThe insert, update, and delete methods return arrays even for single records. Always iterate to access results.
fix
Use .then(function(rows) { rows.forEach(...) }) or rows[0].
affects: >=1.0.0
gotchaNo connection pooling – opens a new connection per query by default. Can exhaust database connections under load.
fix
Implement your own pool with pg directly, or switch to a library with built-in pooling.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'acidjs'
Package name is 'acidjs', not 'acid.js' or 'acid'.
fix
npm install acidjs --save
TypeError: require(...) is not a function
Calling require('acidjs') without parentheses – the module exports a factory function that must be called with a connection string.
fix
var acid = require('acidjs')('postgres://user:pass@host/db');
error: relation "<table>" does not exist
Using a table name that hasn't been created. acid.js does not auto-create tables.
fix
Run CREATE TABLE via psql or raw SQL before using CRUD methods.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
pgrequiredPeer dependency – required at runtime for PostgreSQL connectivity
Agent activity
48 hits · last 30 days
node
40
OpenAI (training)
2
Resources
packageacidjs
acidjs — npm install acidjs · libregistry