Registry / database / backbone-orm

backbone-orm

JSON →
library0.7.14jsnpmunverified

BackboneORM is a polystore ORM that provides a consistent interface for database operations across MongoDB and SQL databases (PostgreSQL, MySQL) as well as in-memory and HTTP stores. Version 0.7.14 is the latest stable release. Key differentiators include Node.js-style callbacks and streams, MongoDB-like query language, REST controller for browser search bar queries, CouchDB-inspired paging, JSON-rendering DSL, automatic ISO8601 date parsing, and versioning support via BackboneMongo. Released under MIT license with weekly or monthly updates via npm.

database
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.

Package uses default export; CommonJS require works but ESM import is preferred for modern environments.

import BackboneORM from 'backbone-orm'

Named export for Model class; CommonJS require requires .Model access.

import { Model } from 'backbone-orm'

Named export for Store class; CommonJS require requires .Store access.

import { Store } from 'backbone-orm'

This quickstart demonstrates setting up a memory store, defining a model, saving a new project, and querying for it using callbacks.

// Create a memory store const { Store, Model } = require('backbone-orm'); // Define a Model const Project = Model.extend({ url: function() { return '/projects'; }, schema: { name: String, is_active: Boolean } }); // Create a store connection (memory) const store = new Store({ type: 'memory' }); store.connect({}, function(err) { if (err) throw err; // Create and save a new project const project = new Project({ name: 'Test Project', is_active: true }); project.save(function(err, savedProject) { if (err) throw err; console.log('Saved project with id:', savedProject.get('id')); // Find it Project.findOne({ name: 'Test Project' }, function(err, found) { if (err) throw err; console.log('Found:', found.toJSON()); }); }); });
Debug
Known footguns
gotchaBackboneORM requires Backbone as a global dependency; you must have Backbone loaded before using this library. Without it, you will get 'Backbone is not defined' errors.
deprecatedCallback-based APIs are the primary pattern, but they are not deprecated; however, the library does not natively support Promises or async/await without wrapping.
gotchaThe library relies on global Backbone.sync and Backbone.history; custom sync may interfere with operation.
gotchaMongoDB-like query syntax includes a custom `$ids` shortcut that may conflict with other query patterns.
gotchaThe library uses streams for large datasets; improper handling can lead to memory issues.
gotchaThe package does not bundle TypeScript definitions; developers must write their own or find community typings.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
ahrefsbot
2
Resources