🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 5 Min Lesezeit
0

Migrate a Prisma project to Postgres, MySQL, Mongo — or 10 other databases — with zero code change, using @mostajs/orm-cli

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Part of the app that runs on any of 13 databases — and you don't edit a single line of application code:




CODE
cd my-existing-prisma-app
npx @mostajs/orm-cli bootstrap
npm run dev
# db.User.findMany(...) now runs on SQLite / Postgres / MySQL / Mongo / Oracle / … — same code.







  • A codemod rewrites every new PrismaClient(...), backs the originals up, and is reversible.

  • Every step stops on the first error — no lying success banner.

  • Real proof: a 40-model, 67-file Next.js app migrated end-to-end with 0 files touched by hand.






The problem: Prisma marries you to one database



Prisma is great until the day you need a different database — Mongo for one service, Postgres for another, SQLite for local dev or an embedded build, Oracle because the client mandates it. Prisma's schema, client and migrations are tied to one provider; switching means rewriting data access across the whole codebase.



@mostajs/orm-cli removes that wall. Its headline command, mostajs bootstrap, performs the migration for you — codemod included — so the same db.User.findMany() calls keep working, now on top of an ORM that speaks 13 dialects.






What mostajs bootstrap actually does



Four steps, each gated on the previous succeeding (v0.4.1+):





  1. Codemod — scans the repo for new PrismaClient(...), detects each export name (prisma, db, client, default…), and rewrites each site to createPrismaLikeDb() from @mostajs/orm-bridge. Originals saved as *.prisma.bak.


  2. Install — adds @mostajs/orm + @mostajs/orm-bridge + @mostajs/orm-adapter.


  3. Convertprisma/schema.prisma.mostajs/generated/entities.json (a 13-database-ready schema).


  4. DDL — writes .mostajs/config.env (SQLite defaults) and creates the tables.



The "zero code change" isn't a slogan: @mostajs/orm-bridge exposes a Prisma-compatible client, so your db.user.findMany(...) calls hit it unchanged. The codemod just swaps what db is.






Safe by default, and reversible



The codemod (mostajs install-bridge) is dry-run by default — it reports, it doesn't write:




CODE
$ mostajs install-bridge
Found 3 PrismaClient instantiation site(s):
→ src/lib/db.ts (const db)
→ src/server/prisma.ts (const prisma)
→ scripts/seed.ts (const prisma)
Dry-run — no files written. Re-run with --apply to execute.






It only acts on files that import @prisma/client and call new PrismaClient( — and it skips files already migrated, so re-runs are idempotent. Every rewritten file leaves a .prisma.bak next to it, and one command rolls the whole thing back:




CODE
npx @mostajs/orm-cli install-bridge --restore --apply






No black box: you can see what changed, and you can undo it.






Pick your database afterwards



Bootstrap configures SQLite so it works immediately. To target any of the other twelve, edit .mostajs/config.env:




CODE
DB_DIALECT=postgres
SGBD_URI=postgres://user:pass@host:5432/mydb






The thirteen: SQLite · PostgreSQL · MySQL · MariaDB · MongoDB · Oracle · SQL Server · CockroachDB · DB2 · SAP HANA · HSQLDB · Spanner · Sybase. Same converted schema, same application code — you change two env lines and re-init.






Not just Prisma at the input



The converter auto-detects more than Prisma schemas — it also reads OpenAPI (openapi.yaml/json) and JSON Schema (schemas/*.json), routing through @mostajs/orm-adapter. So "I have an API spec but no ORM" is also a starting point, not just "I have Prisma".






Proof — FitZoneGym



This isn't a toy demo. FitZoneGym — a production-grade Next.js 15 + Prisma app, 40 models, 67 files importing Prisma — was migrated with one bootstrap:




CODE
cd FitZoneGym
npx @mostajs/orm-cli bootstrap # 15 PrismaClient sites rewritten, schema converted, DDL applied
npm run dev # login [email protected] → 302 + session, on SQLite instead of MongoDB






Files edited by hand: 0 — the codemod owned them all. Login, dashboard and API routes ran on SQLite instead of MongoDB, unchanged.






More than migration



Beyond bootstrap, the CLI carries the everyday utilities you actually need around a database: mostajs health (Node / schema / entities.json checks), mostajs detect (what's in the project), mostajs hash / verify (bcrypt for seed data), mostajs diagnose (login walkthrough), and a full interactive menu (mostajs with no args) for converting, configuring URIs, init/DDL, seeding, services and logs.




One caveat worth stating: this package is an executable, not a library — install and run it, don't import from it.







Where it fits



mostajs bootstrap is the on-ramp to (the bootstrap uses that engine internally). For ongoing replication, see

  • 🐙 GitHub






  • If escaping single-database lock-in with one reversible command is useful, a ⭐ on GitHub helps — it's the signal AI dev tools use to surface the package.



    Auteur : Dr Hamid MADANI [email protected]

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
    Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 0%
    🟡 In Evaluierung 0%
    🟢 Keine Auswirkung 0%
    Spannende Innovation 0%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    3 Quellen
    GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
    1 Quelle
    Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
    1 Quelle
    Major AI platforms go down in unprecedented simultaneous outage
    Ähnliche Beiträge
    🔍 Verwandte News

    Auch interessante Nachrichten Migrate a Prisma project to Postgres, MySQL, Mongo — or 10 other databases — with zero code change, using @mostajs/orm-cli

    Thematisch verwandte Begriffe: Migrate, Prisma, project, Postgres · 6 Treffer

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...