Registry / database / outlet-orm

outlet-orm

JSON →
library15.2.0jsnpmunverified

outlet-orm is an Active Record ORM for Node.js 18+ supporting MySQL, PostgreSQL, and SQLite (current stable version 15.2.0). It extends beyond traditional ORM features to include schema builder, migrations, seeders, backup/restore, reverse engineering, a REST/GraphQL API layer, a multi-provider AI bridge, and an MCP server for AI agents. Key differentiators: all-in-one SQL ORM + tools + AI integration, ship TypeScript types, passive peer dependencies (only install needed drivers).

npm install outlet-orm
INSTALL
IMPORT
SIG · OUTLET-ORM
O
outlet-orm
databasejavascriptv15.2.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.

DatabaseConnection
const { DatabaseConnection } = require('outlet-orm')
import { DatabaseConnection } from 'outlet-orm'
Package is CommonJS only; ESM import will fail.
Model
const { Model } = require('outlet-orm')
import Model from 'outlet-orm'
Model is a named export, not default. CJS destructuring required.
Schema
const { Schema } = require('outlet-orm')
import { Schema } from 'outlet-orm';
Works only with dynamic import or CJS. ESM import may work with wrapper but not officially supported.

Demonstrates basic setup: create SQLite in-memory database, define User model, run schema migration, insert and query records.

const { DatabaseConnection, Model, Schema, Migration } = require('outlet-orm'); const db = new DatabaseConnection({ driver: 'sqlite', database: ':memory:' }); class User extends Model { static tableName = 'users'; static connection = db; } const schema = new Schema(db); schema.createTable('users', (table) => { table.increments('id'); table.string('name'); table.timestamps(); }); async function main() { await db.connect(); await schema.execute(); const user = new User({ name: 'Alice' }); await user.save(); console.log('User created:', user.id); const users = await User.query().where('name', 'Alice').get(); console.log('Users:', users); await db.disconnect(); } main().catch(console.error);
Debug
Known issues
breakingv14 dropped support for Node.js <18.0.0 and removed the `outlet` CLI for reverse engineering (split into `outlet-reverse`).
fix
Upgrade to v15 or use `outlet-reverse` package.
affects: >=14.0.0 <15.0.0
deprecatedThe `BackupSocketServer` and `BackupSocketClient` are deprecated in v15; use the `BackupManager` with direct file operations instead.
fix
Replace socket-based backup with direct file-based backup using BackupManager.
affects: >=15.0.0
gotchaPeer dependencies for database drivers are optional; if no driver is installed, `DatabaseConnection` will throw an error at connect time.
fix
Install at least one of mysql2, pg, or sqlite3.
affects: >=0.0.0
gotchaThe package is CommonJS-only. Using ES modules (import) will fail unless using a dynamic import or a CJS-to-ESM wrapper.
fix
Use require() or configure Node.js to load CJS packages.
affects: >=0.0.0
breakingv12 renamed `AIManager` to `Ai` and changed the provider interface. Old code using `AIManager` will break.
fix
Replace `AIManager` with `Ai` and update provider configuration to new interface.
affects: >=12.0.0 <13.0.0
Errors
Common errors & fixes
Cannot find module 'outlet-orm'
Package not installed or path incorrect.
fix
Run `npm install outlet-orm` from the project root.
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server
MySQL 8+ uses caching_sha2_password by default; mysql2 needs extra configuration.
fix
Add `authPlugins: { sha256_password: () => require('mysql2/lib/auth_plugins/caching_sha2_password') }` to MySQL connection options.
TypeError: (0 , ...) is not a function
Attempted to import a CJS package with ESM `import` statement.
fix
Use `const { ... } = require('outlet-orm')` or wrap with dynamic import.
Upgrade
Version history
15.2.0latest on npm
Audit
Dependencies
mysql2optionalMySQL driver (peer dependency, optional)
pgoptionalPostgreSQL driver (peer dependency, optional)
sqlite3optionalSQLite driver (peer dependency, optional)
graphql-wsoptionalWebSocket support for GraphQL subscriptions (peer, optional)
Agent activity
4 hits · last 30 days
node
4
Resources
outlet-orm — npm install outlet-orm · libregistry