Registry / database / mythix-orm-sql-base

mythix-orm-sql-base

JSON →
library1.12.2jsnpmunverified

SQL base support library for Mythix ORM (npm: mythix-orm), providing shared SQL dialect infrastructure for MySQL, PostgreSQL, MSSQL, and Snowflake drivers. Version 1.12.2 is the latest stable release, with updates following Mythix ORM's release cadence. It is not intended for standalone use; instead, it serves as a dependency for SQL-specific driver packages. Key differentiators include a unified SQL generation layer and type-safe query building. Ships TypeScript definitions and requires Node >=18. Peer dependency on mythix-orm ^1.14.0.

npm install mythix-orm-sql-base
INSTALL
IMPORT
SIG · MYTHIX-ORM-SQL-BAS
M
mythix-orm-sql-base
databasejavascriptv1.12.2
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.

SQLBase
import { SQLBase } from 'mythix-orm-sql-base'
const SQLBase = require('mythix-orm-sql-base').SQLBase
ESM-only module since v1. No CommonJS export.
SQLDialect
import { SQLDialect } from 'mythix-orm-sql-base'
import { SQLDialect } from 'mythix-orm-sql-base/dist/index.js'
Do not deep import from dist; top-level barrell export works.
default
import mythixOrmSqlBase from 'mythix-orm-sql-base'
import * as mythixOrmSqlBase from 'mythix-orm-sql-base'
Default export is the module namespace, not a single class.

Shows how to define a model extending SQLBase from mythix-orm-sql-base, using Mythix ORM's Model mixin.

import { SQLBase } from 'mythix-orm-sql-base'; import { Model } from 'mythix-orm'; class User extends SQLBase(Model) { static fields = { id: { type: 'integer', primaryKey: true, autoIncrement: true }, name: { type: 'string', required: true }, email: { type: 'string', unique: true }, }; } console.log(User.getTableName()); // 'users' console.log(User.fields.email.type); // 'string'
Debug
Known issues
breakingESM-only from v1.0.0: require() will throw ERR_REQUIRE_ESM.
fix
Use import syntax or dynamic import() in CommonJS projects.
affects: >=1.0.0
gotchaPeer dependency mythix-orm must be manually installed; npm only warns.
fix
Run npm install mythix-orm alongside this package.
affects: >=1.0.0
deprecatedField type 'text' is deprecated in favor of 'string'.
fix
Use type: 'string' instead of type: 'text'.
affects: >=1.10.0
gotchaSQLBase mixes in Model from mythix-orm; order of imports matters for type inference.
fix
Import SQLBase before Model, or use SQLBase(Model) directly.
affects: >=1.0.0
breakingDropped support for Node <18 in v1.11.0.
fix
Upgrade Node.js to v18.0.0 or higher.
affects: >=1.11.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module [...] not supported.
Using require() on an ESM-only package.
fix
Switch to import syntax or use dynamic import().
Cannot find module 'mythix-orm'
Missing peer dependency mythix-orm.
fix
Run 'npm install mythix-orm'.
TypeError: SQLBase is not a constructor
Using SQLBase directly without calling it as a mixin (e.g., SQLBase(Model)).
fix
Usage: class User extends SQLBase(Model) { ... }
Upgrade
Version history
1.12.2latest on npm
Audit
Dependencies
mythix-ormrequiredpeer dependency providing core ORM functionality
Agent activity
4 hits · last 30 days
node
4
Resources
mythix-orm-sql-base — npm install mythix-orm-sql-base · libregistry