massive-js
Massive.js is a data mapper for Node.js and PostgreSQL that embraces the full power of PostgreSQL rather than abstracting it away behind a generic SQL interface…
Installation
npm install massive
yarn add massive
pnpm add massive
Import
import massive from 'massive';
Quick Example
import massive from 'massive';
const db = await massive({ connectionString: process.env.DATABASE_URL });
const users = await db.users.find({ active: true });
const user = await db.users.insert({ name: 'Alice', email: '[email protected]' });
await db.users.update({ id: 1 }, { name: 'Bob' });About massive-js
Massive.js is a data mapper for Node.js and PostgreSQL that embraces the full power of PostgreSQL rather than abstracting it away behind a generic SQL interface. Unlike traditional ORMs that model the database in application code, Massive introspects the database at startup and builds a JavaScript API that mirrors the actual database structure — tables become objects with find, insert, update, and destroy methods, views are queryable, and stored functions are callable as JavaScript methods. This database-first approach means the database schema is the source of truth, and Massive adapts to it automatically. The library provides a powerful criteria query system for filtering, full-text search support leveraging PostgreSQL's built-in capabilities, document table support for JSONB columns that function like schemaless document stores within PostgreSQL, and streaming for large result sets. Massive handles bulk operations efficiently and supports CTEs (Common Table Expressions), window functions, and other advanced PostgreSQL features through its criteria system and raw SQL fallback. Massive is ideal for PostgreSQL-centric applications where developers want to leverage PostgreSQL's unique features without an abstraction layer.
Quick Facts
| Package | massive-js |
| Category | Database |
| Weekly Downloads | 10K+ |
| License | MIT |
| Install | npm install massive |
Related Packages
pg (node-postgres) is the standard PostgreSQL client for Node.js, providing low-level access to Post…
Knex.js is a batteries-included SQL query builder for Node.js that supports PostgreSQL, MySQL, Maria…
Slonik is a Node.js PostgreSQL client with strict types, detailed logging, and assertions that encou…
Prisma is a next-generation Node.js and TypeScript ORM that provides a declarative data modeling lan…
Postgres.js is the fastest full-featured PostgreSQL client for Node.js and Deno, using tagged templa…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.