Registry / database / jugglingdb

jugglingdb

JSON →
library2.0.1jsnpmunverified

JugglingDB is a JavaScript cross-database ORM designed for Node.js, offering a common interface to interact with various popular relational and NoSQL databases such as MySQL, PostgreSQL, MongoDB, Redis, SQLite, CouchDB, and Neo4j, along with an in-memory storage option. It also supported client-side usage via WebService and Memory adapters, enabling rich client-side applications to communicate with server-side JSON APIs. The npm package shows version 2.0.1 as the latest. However, active development on JugglingDB ceased around 2017-2018, as its core concepts and codebase were forked to create `loopback-datasource-juggler`, which continues to be actively maintained as part of the LoopBack framework. Consequently, JugglingDB itself is no longer maintained and does not receive updates or security patches. Its release cadence is non-existent, and it is not compatible with modern Node.js environments.

npm install jugglingdb
INSTALL
IMPORT
SIG · JUGGLINGDB
J
jugglingdb
databasejavascriptv2.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Schema
const Schema = require('jugglingdb').Schema;
import { Schema } from 'jugglingdb';
JugglingDB was developed for older Node.js environments and primarily uses CommonJS `require()` syntax. It does not natively support ES Modules (`import`/`export`).
Post
const Post = schema.define('Post', { /* ... */ });
const { Post } = require('jugglingdb');
Models are defined dynamically through a `Schema` instance, not directly imported as named exports from the `jugglingdb` package.

This quickstart demonstrates defining a schema with the in-memory adapter, creating a model, and performing basic CRUD operations (create, find, update, delete) using async/await.

const Schema = require('jugglingdb').Schema; // Use the in-memory adapter for a quick, no-install example const schema = new Schema('memory', { debug: true }); const User = schema.define('User', { name: { type: String, limit: 50, index: true }, email: { type: String, unique: true }, age: { type: Number, default: 18 }, createdAt: { type: Date, default: Date.now } }); async function runExample() { try { // Auto-migrate the schema (create tables/collections if they don't exist) await schema.autoupdate(); console.log('Schema autoupdated.'); // Create a new user const newUser = await User.create({ name: 'Alice', email: 'alice@example.com', age: 30 }); console.log('Created user:', newUser.toJSON()); // Find a user by ID const foundUser = await User.findById(newUser.id); console.log('Found user by ID:', foundUser.toJSON()); // Update a user await foundUser.updateAttributes({ age: 31 }); console.log('Updated user:', foundUser.toJSON()); // Find all users const allUsers = await User.all(); console.log('All users:', allUsers.map(u => u.toJSON())); // Delete a user await foundUser.destroy(); console.log('User deleted.'); const remainingUsers = await User.count(); console.log('Remaining users:', remainingUsers); } catch (err) { console.error('An error occurred:', err); } finally { // In a real application, you'd disconnect from the database here. // For 'memory' adapter, no explicit disconnect is usually needed. console.log('Example finished.'); } } runExample();
Debug
Known issues
breakingThe `jugglingdb` package is officially abandoned and no longer maintained. Its development activity effectively ceased around 2017-2018. This means it receives no new features, bug fixes, or security updates. Using it in production environments is highly discouraged due to potential vulnerabilities and compatibility issues with modern Node.js versions.
fix
Migrate to `loopback-datasource-juggler` or another actively maintained ORM/ODM like Sequelize, TypeORM, or Mongoose. `loopback-datasource-juggler` is the direct successor and maintains a similar API.
affects: >=2.0.1
gotchaJugglingDB was built for older Node.js versions (e.g., node >= 0.6) and is primarily CommonJS-based (`require`). It does not natively support ES Modules (`import`/`export`) and may have significant compatibility issues or require complex transpilation to run in modern Node.js or browser environments.
fix
Stick to CommonJS `require()` syntax if you must use JugglingDB. For new projects, prefer modern ORMs with full ESM and TypeScript support.
affects: >=2.0.1
gotchaJugglingDB does not ship with built-in TypeScript definitions, nor is it designed with TypeScript in mind. Using it in a TypeScript project will require manual type declarations or extensive `@ts-ignore` usage.
fix
Consider `loopback-datasource-juggler` which is actively maintained and provides TypeScript definitions. Alternatively, use a modern ORM built for TypeScript.
affects: >=2.0.1
breakingThe `jugglingdb` core package requires a separate adapter package (e.g., `jugglingdb-mongodb`, `jugglingdb-mysql`) to connect to a specific database. Many of these adapter packages are also abandoned and may not work with current database server versions or their native drivers.
fix
Ensure you install the correct adapter (`npm install jugglingdb-ADAPTERNAME`). However, even with the correct adapter, compatibility with modern database versions is not guaranteed.
affects: >=2.0.1
Errors
Common errors & fixes
TypeError: Schema is not a constructor
Attempting to instantiate `jugglingdb` directly as a constructor (e.g., `new jugglingdb.Schema()`) instead of accessing its `Schema` property.
fix
Correct the import and instantiation to `const Schema = require('jugglingdb').Schema;` and then `const schema = new Schema('memory');`.
Error: Adapter 'myadapter' is not installed or cannot be found.
The specified database adapter (e.g., `jugglingdb-myadapter`) has not been installed via npm, or the path to a custom adapter is incorrect.
fix
Run `npm install jugglingdb-myadapter` (replace 'myadapter' with your actual adapter name) in your project directory. For custom adapters, ensure the path provided to `new Schema()` is correct and the module exports an adapter conforming to the JugglingDB API.
jdb.BaseSQL undefined
This specific error often occurred in older `jugglingdb-mysql` adapter versions (e.g., 0.0.1-6) when an incompatible version of the `jugglingdb` core was installed or there was a dependency resolution issue.
fix
This is an indicator of deep-seated dependency incompatibility within an abandoned ecosystem. There is no simple fix other than to avoid this legacy version combination. If encountering this, it's a strong signal to migrate away from JugglingDB entirely.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
jugglingdb-ADAPTERNAMErequiredJugglingDB requires a specific database adapter package (e.g., jugglingdb-mongodb, jugglingdb-redis-hq, jugglingdb-mysql) for connecting to a database. The core package only provides the ORM logic.
Agent activity
4 hits · last 30 days
node
4
Resources