Registry / database / ormso
library0.0.151jsnpmunverified

ORMSO is a JavaScript object-relational mapper for SQLite (with extensibility to other databases) supporting object-to-database mapping, cross-database synchronization, and client data publishing. Current stable version is 0.0.151, released with pre-1.0 cadence meaning frequent breaking changes. Key differentiators: built-in sync between databases, and a publish layer for clients (with basic OData planned). Early-stage library, documentation sparse; not recommended for production without thorough vetting.

npm install ormso
INSTALL
IMPORT
SIG · ORMSO
O
ormso
databasejavascriptv0.0.151
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.

ormso
import ormso from 'ormso'
const ormso = require('ormso')
Primary default export; ESM-only as of v0.0.151 (no CJS support).
ORM
import { ORM } from 'ormso'
const ORM = require('ormso').ORM
Named export for class ORM; ESM-only.
Model
import { Model } from 'ormso'
Named export for base Model class; ESM-only.

Shows how to create a SQLite database, define a model with ORMSO, sync schema, create and query records.

import ormso, { ORM, Model } from 'ormso'; import Database from 'better-sqlite3'; const db = new Database(':memory:'); const orm = new ORM(db); class User extends Model { static tableName = 'users'; static fields = { id: { type: Number, primaryKey: true }, name: { type: String }, email: { type: String } }; } orm.register(User); await orm.sync({ force: true }); const user = new User({ name: 'John', email: 'john@example.com' }); await user.save(); const found = await User.findOne({ where: { name: 'John' } }); console.log(found);
Debug
Known issues
breakingVersion 0.x is pre-1.0, breaking changes occur frequently. No semantic versioning adherence between minor/patch bumps.
fix
Pin exact version in package.json and test upgrades thoroughly.
affects: <1.0.0
deprecatedThe `ormso` default export may be deprecated in favor of named exports in future versions.
fix
Use named exports like `ORM` and `Model` instead of default import when possible.
affects: >=0.0.100
gotchaDatabase schema sync with `{ force: true }` drops existing tables. Data loss risk.
fix
Use `{ alter: true }` for safe migrations if supported, or backup database before sync.
affects: *
gotchaESM-only: `require('ormso')` will fail. Package does not provide CommonJS bundle.
fix
Use `import` syntax and ensure project is configured for ESM (type: 'module' in package.json).
affects: >=0.0.151
gotchaSQLite driver `better-sqlite3` must be installed separately as a peer dependency.
fix
Run `npm install better-sqlite3` alongside `ormso`.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'better-sqlite3'
Missing peer dependency `better-sqlite3`.
fix
Run `npm install better-sqlite3`.
ERR_REQUIRE_ESM: require() of ES Module .../ormso/index.js not supported.
Using CommonJS `require` on an ESM-only package.
fix
Switch to `import` or use dynamic `import('ormso')` in a CommonJS context.
TypeError: ormso.default is not a function
Using default import incorrectly, possible version mismatch.
fix
Check version; use `import { ORM } from 'ormso'` instead.
Upgrade
Version history
0.0.151latest on npm
Audit
Dependencies
better-sqlite3requiredSQLite driver for database operations.
Agent activity
2 hits · last 30 days
node
2
Resources
ormso — npm install ormso · libregistry