Registry / database / reactive-orm

reactive-orm

JSON →
library0.3.5-alpha.0jsnpmunverified

reactive-orm is a lightweight ORM library for reactive programming, designed to maximize the utility of reactive variables in frontend frameworks (e.g., Vue 3, React with signals). As of version 0.3.5-alpha.0, it is in early alpha stage with irregular releases. Unlike traditional ORMs, it focuses on binding database reactivity to UI state, reducing boilerplate. Key differentiators include automatic data synchronization and minimal configuration, though it lacks maturity and documentation.

npm install reactive-orm
INSTALL
IMPORT
SIG · REACTIVE-ORM
R
reactive-orm
databasejavascriptv0.3.5-alpha.0
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.

Model
import { Model } from 'reactive-orm'
const reactiveOrm = require('reactive-orm'); const Model = reactiveOrm.Model
ESM-only; no default export. Use named import.
ReactiveORM
import { ReactiveORM } from 'reactive-orm'
Main class for creating ORM instance.
defineReactiveModel
import { defineReactiveModel } from 'reactive-orm'
import defineReactiveModel from 'reactive-orm'
Function, not a default export.

Demonstrates defining a model, registering it, querying with reactively, and auto-updating.

import { Model, ReactiveORM } from 'reactive-orm'; const orm = new ReactiveORM(); class User extends Model { static table = 'users'; static fields = { id: 'number', name: 'string', email: 'string' }; } orm.register(User); // Reactive query const users = await orm.query(User).where({ id: 1 }).first(); console.log(users); // Auto-reactive update users.name = 'John'; // UI updates automatically (if integrated) orm.sync(); // Persist changes
Debug
Known issues
breakingVersion 0.3.x changed the API: Model.database is replaced with orm.register(Model).
fix
Update to 0.3.x and use orm.register(Model) instead of Model.database.
affects: <0.3.0
deprecatedThe method `orm.query().find()` is deprecated; use `orm.query().first()` instead.
fix
Replace .find() with .first() in queries.
affects: >=0.3.0 <0.4.0
gotchaReactive variables only work with supported frontend frameworks (e.g., Vue 3, React with signals). Plain JavaScript does not update UI automatically.
fix
Ensure your project uses Vue 3 Composition API or React with signals library (e.g., @preact/signals); otherwise, reactivity is lost.
affects: all
gotchaModel fields must be defined with types as strings; does not support complex types or default values.
fix
Define fields as plain string types; use hooks for defaults.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'reactive-orm'
Package not installed or missing dependency.
fix
Run `npm install reactive-orm@0.3.5-alpha.0`
TypeError: orm.register is not a function
Using a version <0.3.0 where API was different.
fix
Upgrade to version 0.3.x and use `orm.register(Model)`. Check installed version with `npm ls reactive-orm`.
Uncaught TypeError: Cannot read properties of undefined (reading 'name')
Query returned null/undefined; reactive update on non-existent object.
fix
Check if `users` exists before assigning properties: `if (users) { users.name = 'John'; }`
Upgrade
Version history
0.3.5-alpha.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
reactive-orm — npm install reactive-orm · libregistry