Registry / database / mythix-orm

mythix-orm

JSON →
library1.15.0jsnpmunverified

Mythix ORM (v1.15.0) is a modular, extensible Node.js ORM supporting SQLite and PostgreSQL with plans for MongoDB and MySQL. Its key differentiators include a unified query engine across SQL and NoSQL databases, a clean model system with no hidden auto-magic, and deliberate design for extension via plugins and custom drivers. It offers full-feature parity with other ORMs (validation, hooks, relations, transactions) while staying slim and framework-agnostic. Release cadence is active but early-stage; ship stable with node >=18.0.0 and TypeScript definitions.

npm install mythix-orm
INSTALL
IMPORT
SIG · MYTHIX-ORM
M
mythix-orm
databasejavascriptv1.15.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 'mythix-orm'
✗ const Model = require('mythix-orm').Model
Default export is not available; named import is required.
Types
✓ import { Types } from 'mythix-orm'
✗ const { Types } = require('mythix-orm').default
Types is a named export, not a default. In CJS, use const { Types } = require('mythix-orm').
SQLiteConnection
✓ import { SQLiteConnection } from 'mythix-orm-sqlite'
✗ const SQLiteConnection = require('mythix-orm-sqlite')
SQLiteConnection is a named export from the driver package, not default.

Defines a User model with XID primary key, creates table, saves and retrieves a record using SQLite.

const { Model, Types } = require('mythix-orm'); const { SQLiteConnection } = require('mythix-orm-sqlite'); class User extends Model { static fields = { id: { type: Types.XID(), defaultValue: Types.XID.Defaults.XID, allowNull: false, primaryKey: true, }, email: { type: Types.STRING(128), allowNull: false, index: true, unique: true, }, firstName: { type: Types.STRING(64), allowNull: false, index: true, }, lastName: { type: Types.STRING(64), allowNull: false, index: true, }, }; } (async () => { const connection = new SQLiteConnection({ models: [User] }); await connection.start(); await connection.createTables([User]); const user = new User({ email: 'test@example.com', firstName: 'Test', lastName: 'User' }); await user.save(); const loaded = await User.findOne({ where: { email: 'test@example.com' } }); console.log(loaded.firstName); await connection.stop(); })();
Debug
Known issues
breakingMythix ORM requires Node.js >=18.0.0. Older versions are unsupported.
fix
Upgrade Node.js to 18.0.0 or later.
affects: <1.0.0
deprecatedThe default export from 'mythix-orm' was removed in v1.0.0. Use named exports instead.
fix
Replace import mythixOrm from 'mythix-orm' with import { Model, Types } from 'mythix-orm'.
affects: >=1.0.0
gotchaField definitions must use Types.* constructors (e.g., Types.STRING(128)), not plain constructor calls like String or Number.
fix
Always use the Types object for field types, e.g., type: Types.STRING(128).
affects: >=1.0.0
gotchaThe primary key field must be explicitly marked with primaryKey: true. There is no automatic 'id' field.
fix
Add primaryKey: true to the field definition you want as primary key.
affects: >=1.0.0
gotchaDrivers like mythix-orm-sqlite must be installed separately. There is no bundled driver.
fix
Run npm install mythix-orm-sqlite (or your chosen driver) alongside mythix-orm.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Class extends value undefined is not a constructor or null
Importing Model incorrectly (e.g., default import instead of named import).
fix
Use import { Model } from 'mythix-orm' or const { Model } = require('mythix-orm').
Error: Cannot find module 'mythix-orm-sqlite'
Missing SQLite driver package.
fix
Install the driver: npm install mythix-orm-sqlite
SequelizeValidationError: notNull Violation: ... cannot be null
Field not defined with allowNull: false but value is missing.
fix
Set allowNull: false on required fields or provide a value.
TypeError: (intermediate value).XID is not a function
Calling Types.XID without parentheses (Types.XID instead of Types.XID()).
fix
Use Types.XID() (with parentheses) to create the type instance.
Upgrade
Version history
1.15.0latest on npm
Audit
Dependencies
mythix-orm-sqliteoptionalSQLite driver required for SQLite support; separate package.
Agent activity
11 hits · last 30 days
node
10
Resources
mythix-orm — npm install mythix-orm · libregistry