CHANGE ORDERMigrate to kastor
Migrate to kastor from Prisma and other ORMs
Your database and your data stay where they are. You swap the layer on top: a TypeScript schema instead of a model file, a typed client instead of the old one, and kastor migrations that start from what is already deployed.
Em português: Como migrar do Prisma para o kastor and Vindo do Laravel e do Eloquent
Three commands do the heavy lifting
- 1
Get a TypeScript schema
From Prisma, convert the model file directly with the first command. From any other ORM or language, use the second: it reads the live database, with tables, columns, indexes, foreign keys and the relations between them.
npx kastor import prisma --schema prisma/schema.prisma --out src/db/schema.ts npx kastor db pull --out src/db/schema.ts - 2
Adopt the database as it is
A baseline records the current schema as the first kastor migration and marks it applied, so nothing is created twice and no data moves. Prisma projects use the second form, which also keeps every migration Prisma already applied as history.
npx kastor migrate baseline --name init npx kastor migrate baseline --from-prisma prisma/migrations - 3
Move queries, then let kastor own migrations
Rewrite one module at a time while both clients share the database. When the old ORM has no importers left, new schema changes go through kastor, and CI runs
migrate deploy.npx kastor migrate status npx kastor migrate dev --name add_slug_to_posts npx kastor migrate deploy
From another TypeScript or JavaScript ORM
From PHP, Python or Ruby
kastor runs in JavaScript runtimes: Node.js, Bun, Deno, Cloudflare Workers and other edge platforms. It does not run inside PHP, Python or Ruby. These guides cover the two honest paths: moving a service to TypeScript, or running a TypeScript API next to the existing app on the same database.
Where each guide starts
| Coming from | First command | Migration history |
|---|---|---|
| Prisma | npx kastor import prisma | Kept: migrate baseline --from-prisma |
| Drizzle ORM | npx kastor db pull | Baseline, then kastor owns new migrations |
| TypeORM | npx kastor db pull | Baseline, then kastor owns new migrations |
| Sequelize | npx kastor db pull | Baseline, then kastor owns new migrations |
| Knex | npx kastor db pull | Baseline, then kastor owns new migrations |
| Mongoose | npx kastor db pull | Validators and indexes from the schema |
| Laravel Eloquent (PHP) | npx kastor db pull | Baseline, PHP and TypeScript share the database |
| Django ORM (Python) | npx kastor db pull | Baseline, Django keeps or hands over migrations |
| Rails Active Record (Ruby) | npx kastor db pull | Baseline, Rails keeps or hands over migrations |
Then wire it into your framework
Every framework guide shows the project structure, one client reused across hot reloads and serverless invocations, the environment variables and how migrations run in CI. Start from the framework overview or the list of framework guides.