🗄️
Database10K+/wkMIT

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
npm install massive
yarn
yarn add massive
pnpm
pnpm add massive

Import

ESM
import massive from 'massive';

Quick Example

usage
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

Packagemassive-js
CategoryDatabase
Weekly Downloads10K+
LicenseMIT
Installnpm install massive

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.