Stabilize ORM v2.1.0 is a modern, type-safe ORM for Bun (primary), Node.js >=18, and Deno, supporting SQLite, MySQL, PostgreSQL, Redis caching, optimistic locking, cursor pagination, and a full-featured query builder. Released under MIT, primarily maintained by ElectronSz with monthly releases. Key differentiators: programmatic model definitions, automatic versioning/travel, built-in migration CLI (stabilize-cli), soft deletes, lifecycle hooks, and pluggable logging. Compared to other Bun ORMs (e.g., Drizzle, Prisma), Stabilize emphasizes a unified API across databases, automatic retry logic, and bundled Redis cache layer.
npm install stabilize-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a SQLite in-memory database, defines a User model, synchronizes schema, creates a record, and queries it.
Upgrade Node.js to >=18.
Use `defineModel({...})` instead of class-based models.Replace `db.query('SELECT * FROM users')` with `User.findAll()` or use the query builder API.Ensure you are using Bun or install a Redis adapter (not provided out-of-the-box for Node.js).
Add `softDelete: true` to model config if you want soft delete; otherwise deleted records are hard-deleted.
Change to `import { Stabilize } from 'stabilize-orm'`Ensure your tsconfig.json has `moduleResolution: 'node'` or `'nodenext'` and install the package (`npm install stabilize-orm`)
Ensure each model is defined only once, or use a singleton pattern per model definition