{"id":28018,"library":"ormso","title":"ORMSO","description":"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.","status":"active","version":"0.0.151","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install ormso","lang":"bash","label":"npm"},{"cmd":"yarn add ormso","lang":"bash","label":"yarn"},{"cmd":"pnpm add ormso","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"SQLite driver for database operations.","package":"better-sqlite3","optional":false}],"imports":[{"note":"Primary default export; ESM-only as of v0.0.151 (no CJS support).","wrong":"const ormso = require('ormso')","symbol":"ormso","correct":"import ormso from 'ormso'"},{"note":"Named export for class ORM; ESM-only.","wrong":"const ORM = require('ormso').ORM","symbol":"ORM","correct":"import { ORM } from 'ormso'"},{"note":"Named export for base Model class; ESM-only.","wrong":"","symbol":"Model","correct":"import { Model } from 'ormso'"}],"quickstart":{"code":"import ormso, { ORM, Model } from 'ormso';\nimport Database from 'better-sqlite3';\n\nconst db = new Database(':memory:');\nconst orm = new ORM(db);\n\nclass User extends Model {\n  static tableName = 'users';\n  static fields = {\n    id: { type: Number, primaryKey: true },\n    name: { type: String },\n    email: { type: String }\n  };\n}\n\norm.register(User);\nawait orm.sync({ force: true });\n\nconst user = new User({ name: 'John', email: 'john@example.com' });\nawait user.save();\n\nconst found = await User.findOne({ where: { name: 'John' } });\nconsole.log(found);","lang":"typescript","description":"Shows how to create a SQLite database, define a model with ORMSO, sync schema, create and query records."},"warnings":[{"fix":"Pin exact version in package.json and test upgrades thoroughly.","message":"Version 0.x is pre-1.0, breaking changes occur frequently. No semantic versioning adherence between minor/patch bumps.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Use named exports like `ORM` and `Model` instead of default import when possible.","message":"The `ormso` default export may be deprecated in favor of named exports in future versions.","severity":"deprecated","affected_versions":">=0.0.100"},{"fix":"Use `{ alter: true }` for safe migrations if supported, or backup database before sync.","message":"Database schema sync with `{ force: true }` drops existing tables. Data loss risk.","severity":"gotcha","affected_versions":"*"},{"fix":"Use `import` syntax and ensure project is configured for ESM (type: 'module' in package.json).","message":"ESM-only: `require('ormso')` will fail. Package does not provide CommonJS bundle.","severity":"gotcha","affected_versions":">=0.0.151"},{"fix":"Run `npm install better-sqlite3` alongside `ormso`.","message":"SQLite driver `better-sqlite3` must be installed separately as a peer dependency.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `npm install better-sqlite3`.","cause":"Missing peer dependency `better-sqlite3`.","error":"Error: Cannot find module 'better-sqlite3'"},{"fix":"Switch to `import` or use dynamic `import('ormso')` in a CommonJS context.","cause":"Using CommonJS `require` on an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module .../ormso/index.js not supported."},{"fix":"Check version; use `import { ORM } from 'ormso'` instead.","cause":"Using default import incorrectly, possible version mismatch.","error":"TypeError: ormso.default is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}