Originally published byDev.to
I'm Hamid β Software Engineer & Ophthalmologist in Algeria.
My clinic's software needed to run on Oracle (government mandate), but my team writes TypeScript with Prisma.
Prisma doesn't support Oracle. Rewriting everything wasn't an option.
So I built @mostajs/orm β a Hibernate-inspired ORM with 13 database backends.
## The problem
Prisma is excellent for DX. But:
- 6 databases (PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, CockroachDB). No Oracle. No DB2. No SAP HANA.
- 30MB engine binary shipped with every deployment
- 100K-line generated client that grows with your schema
- No cross-dialect replication
If your enterprise client says "we use Oracle" β you're stuck.
## The solution
@mostajs/orm β one API, 13 databases:
SQLite Β· PostgreSQL Β· MySQL Β· MariaDB Β· MongoDB Β· Oracle Β· SQL Server Β· CockroachDB Β· DB2 Β· SAP HANA Β· HSQLDB Β·
Spanner Β· Sybase
bash
npm install @mostajs/orm better-sqlite3
import { registerSchemas, getDialect, BaseRepository } from '@mostajs/orm'
registerSchemas([UserSchema])
const dialect = await getDialect() // reads DB_DIALECT from .env
const repo = new BaseRepository(UserSchema, dialect)
await repo.create({ email: '[email protected]', name: 'Ada' })
await repo.findAll({ status: 'active' })
Switch databases with one env var. Same code everywhere.
No engine, no codegen
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β β Prisma β @mostajs/orm β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β Engine β 30MB WASM binary β None β ~200 lines per dialect β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β Codegen β 100K-line generated client β Plain objects (EntitySchema) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β Databases β 6 β 13 β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β Bundle impact β Heavy (serverExternalPackages needed) β Lazy-loaded, bundler-friendly β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
Already using Prisma? 3-line migration
// Before (Prisma)
import { PrismaClient } from '@prisma/client'
export const db = new PrismaClient()
// After (@mostajs/orm-bridge)
import { createPrismaLikeDb } from '@mostajs/orm-bridge'
export const db = await createPrismaLikeDb()
Your db.User.findMany({ include, orderBy, take }) keeps working. The bridge translates Prisma's API to our
dialect layer.
Or migrate an entire Prisma project in one command:
npx @mostajs/orm-cli bootstrap
This does: codemod + install deps + convert schema + create tables + optional data migration.
Cross-dialect replication
This is the feature nobody else has:
SQLite (dev) β PostgreSQL (prod) β MongoDB (analytics)
One config, live monitor dashboard, promoteToMaster failover in one CLI command. No Kafka, no infrastructure.
Data backup β 1 source β N destinations
npx mostajs-copy \
--source db --source-dialect postgres --source-uri "$PROD_URI" \
--dest db --dest-dialect sqlite --dest-uri ./backup.sqlite \
--dest sql-dump --dest-file ./backup.sql \
--dest json --dest-file ./backup.json \
--schemas entities.json --create-tables
Supports: DB β DB, DB β SQL dump, DB β CSV, DB β JSON, and reverse.
8 demo videos
I recorded the full workflow β from project init to live replication to Prisma migration. All videos are in the
GitHub README.
The ecosystem
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Package β What it does β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/orm β Core ORM β 13 dialects β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/orm-bridge β Prisma drop-in replacement β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/orm-cli β Interactive CLI (convert, init, seed, replicate, bootstrap) β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/replicator β Cross-dialect CDC replication β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/replica-monitor β Live replication dashboard β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/orm-copy-data β One-shot data copy & backup β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β @mostajs/media β Screen capture + video editor (ffmpeg.wasm) β
ββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Links
- GitHub: github.com/apolocine/mosta-orm
- npm: @mostajs/orm
Open source (AGPL-3.0) + commercial license available.
---
Built by a doctor who codes, in Algeria. Because government mandates don't care about your ORM's database
support list.
πΊπΈ
More news from United StatesUnited States
NORTH AMERICA
Related News
What Does "Building in Public" Actually Mean in 2026?
19h ago
The Agentic Headless Backend: What Vibe Coders Still Need After the UI Is Done
19h ago
Why Iβm Still Learning to Code Even With AI
21h ago
I gave Claude a persistent memory for $0/month using Cloudflare
1d ago
NYT: 'Meta's Embrace of AI Is Making Its Employees Miserable'
1d ago