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`).fixUpgrade 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.fixReplace 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.fixInstall 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.fixUse 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.fixReplace `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.
fixRun `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.
fixAdd `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.
fixUse `const { ... } = require('outlet-orm')` or wrap with dynamic import. 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)