Registry / database / super-orm

super-orm

JSON →
library0.1.3jsnpmunverified

Super-orm is a Node.js MySQL ORM module (v0.1.3) with caching support via Redis and multi-connection (master/slave) capability. It bundles TypeScript definitions. Unlike many ORMs, it automatically routes SELECT queries to slave connections and other statements to master. It also supports JSON field serialization/deserialization natively. The lib is in early development (major version 0) with limited docs and unknown release cadence.

npm install super-orm
INSTALL
IMPORT
SIG · SUPER-ORM
S
super-orm
databasejavascriptv0.1.3
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.

Manager
const { Manager } = require('super-orm')
const Manager = require('super-orm')
Only named export. CommonJS only (no ESM).
Manager
import { Manager } from 'super-orm'
TypeScript/ESM import works if using bundler or Node >=13 with experimental modules.
Manager
const Manager = require('super-orm').Manager
const { default: Manager } = require('super-orm')
Default export is undefined; must destructure.

Shows full setup: initializing Manager with Redis and MySQL connections, registering a Model with JSON field, and fetching by primary key.

const { Manager } = require('super-orm'); const manager = new Manager({ redis: { host: '127.0.0.1', port: 6379, db: 0, password: '' }, prefix: 'TEST:', ttl: 60, connections: [ { host: '127.0.0.1', port: 3306, user: 'root', password: '', database: 'test', connectionLimit: 10, charset: 'utf8mb4', }, ], }); manager.registerModel('User', { table: 'users', primary: 'id', autoIncrement: true, fields: { id: true, name: true, email: true, info: 'json', created_at: 'date', }, }); manager.model('User').getByPrimary({ id: 123 }) .then(ret => console.log(ret)) .catch(err => console.error(err));
Debug
Known issues
breakingAll methods return promise and also accept callback; mix can cause double execution.
fix
Use only promises or callbacks, not both in the same call.
affects: >=0.0.1
deprecatedPackage is at version 0.1.3, API may change without notice.
fix
Pin to exact version and expect breaking changes on minor bumps.
affects: >=0.0.1
gotchaRedis is required if caching is enabled. If redis config is omitted, getByPrimary may fail.
fix
Either provide redis config or set ttl to 0 to disable caching (check API).
affects: >=0.0.1
gotchaOnly the first connection is used as master; others are slaves. SELECT goes to slaves, writes to master.
fix
Ensure first connection has write access and slaves are read-only.
affects: >=0.0.1
gotchaFields not defined in registerModel are stripped on save.
fix
Define all fields in the model, or use raw connection.query.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: Manager is not a constructor
Importing default instead of named export.
fix
Use `const { Manager } = require('super-orm');`
Error: Redis connection failed
Redis server not running or config wrong.
fix
Ensure Redis is running and config matches; or omit redis to disable caching.
Error: Cannot find module 'mysql'
Peer dependency mysql not installed.
fix
Run `npm install mysql` alongside super-orm.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
mysqlrequiredUnderlying MySQL driver for database connections.
ioredisoptionalRedis client for caching layer.
Agent activity
15 hits · last 30 days
node
12
Meta
1
Amazon
1
OpenAI (training)
1
Resources
super-orm — npm install super-orm · libregistry