Registry / database / most-data

most-data

JSON →
library1.8.28jsnpmunverified

The most-data package (v1.8.28) is the ORM module for MOST Web Framework v1.x, providing JSON-schema-based data modeling, constraints, triggers, associations, privileges, and data views for building scalable data-driven Node.js applications. It supports RDBMS backends with a query builder and OData compatibility. Note that the project recommends migrating to v2.x (Blueshift, @themost package), as v1.x is in maintenance mode. Compared to other ORMs, it emphasizes a schema-first approach with built-in access control and expandable relations.

npm install most-data
INSTALL
IMPORT
SIG · MOST-DATA
M
most-data
databasejavascriptv1.8.28
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.

DataContext
import { DataContext } from 'most-data';
const DataContext = require('most-data');
Package supports both ESM and CJS, but ESM is preferred for modern Node.js. CJS require will work, but named exports may be missed.
SqliteAdapter
import { SqliteAdapter } from 'most-data';
const SqliteAdapter = require('most-data').SqliteAdapter;
Named export; available in both ESM and CJS.
MemoryAdapter
import { MemoryAdapter } from 'most-data';
const MemoryAdapter = require('most-data').MemoryAdapter;
For in-memory data store, useful for testing.

Quickstart showing how to initialize a DataContext with SQLite adapter, open connection, query a model, and close.

import { DataContext, SqliteAdapter } from 'most-data'; const context = new DataContext(); context.setAdapter('default', new SqliteAdapter()); await context.open(); const users = await context.model('User').getItems(); console.log(users); await context.close();
Debug
Known issues
deprecatedmost-data v1.x is deprecated; upgrade to @themost framework v2.x.
fix
Migrate to @themost packages (https://github.com/themost-framework/themost).
affects: >=1.0.0 <2.0.0
gotchaSchema models must be registered before context.open(); otherwise queries fail silently.
fix
Ensure all model schemas are loaded via context.use() or included in the models directory before opening context.
affects: >=1.0.0
gotchaDefault adapter is 'memory'; using SQLite requires explicit adapter set and sqlite3 native addon.
fix
Install sqlite3 package and call context.setAdapter('default', new SqliteAdapter());
affects: >=1.0.0
Errors
Common errors & fixes
Error: No adapter configured for data source 'default'
Trying to open context without setting an adapter.
fix
Call context.setAdapter('default', new SqliteAdapter()) before context.open().
TypeError: context.model is not a function
Import/require not resolving to the correct DataContext class or using an older version.
fix
Ensure you import DataContext from 'most-data' and instantiate correctly: new DataContext().
Error: Cannot find module 'sqlite3'
SqliteAdapter requires the 'sqlite3' native module but it is not installed.
fix
Run npm install sqlite3 --save
Upgrade
Version history
1.8.28latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
most-data — npm install most-data · libregistry