forge-orm is a multi-database ORM/wrapper (v1.3.0) that provides a Prisma-shaped query API for MongoDB, PostgreSQL, MySQL, and SQLite from a single codebase with no code generation and no query engine. You define models in plain TypeScript and the same queries run against any of the four databases by parsing the connection URL to select the correct driver. It ships TypeScript types, supports relations, transactions, aggregates, full-text search, soft delete, views, and raw SQL. Compared to alternatives like Prisma or Drizzle, forge-orm is significantly smaller (~5,000 lines of TypeScript), has no build step or generated client, and is MIT-licensed. However, it is a young library with a smaller ecosystem and no production track record. Peer dependencies include better-sqlite3, mongodb, mysql2, and pg; you only need to install the driver you require.
npm install forge-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a User model, creates a database connection, inserts a record, and queries with a filter and limit.
Pin to a specific version and test upgrades carefully.
Run `npm install pg` (or mysql2, better-sqlite3, mongodb) alongside forge-orm.
Ensure DATABASE_URL is set correctly for your chosen database (e.g., postgresql://, mysql://, sqlite://, mongodb://).
Install the required driver: npm install pg (replace with your driver).
Use `import { createDb } from 'forge-orm'` instead of `import createDb from 'forge-orm'`.