Orange ORM is a TypeScript-first object-relational mapper supporting multiple SQL databases: PostgreSQL, MySQL, SQLite, MSSQL, Oracle, PGlite, and Cloudflare D1. Current stable version is 5.3.4, with an active release cadence. Key differentiators include first-class TypeScript support, automatic inference of TypeORM-like decorators, and compatibility with various Node.js SQL drivers. It emphasizes type safety and provides both active record and data mapper patterns.
npm install orange-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a User entity, creates an in-memory SQLite connection, saves and queries a user.
Ensure all entity classes are decorated with @Entity() and listed in the entities array of connection options.
Use 'mssql' as database type? Actually use 'mssql' only if tedious driver is installed. For newer versions, use 'mssql' with tedious or msnodesqlv8.
Replace getConnection() with getManager() from 'orange-orm'.
Add "type": "module" in package.json or use .mjs extension for ESM.
Add import 'reflect-metadata' at the top of your entry file.
Install the appropriate driver: npm install pg for PostgreSQL, npm install mysql2 for MySQL, etc.
Run npm install orange-orm, then import from 'orange-orm' (not 'orange-orm/src').
Install the peer dependency for your database: e.g., npm install pg.
Add import 'reflect-metadata' at the beginning of your application.
Add 'database' property to createConnection options (e.g., database: ':memory:').
No dependency data recorded yet.