How to move from Prisma to the Facet ORM
Moving from Prisma to Facet is mostly a schema port, because the syntax is close. Copy your models into schema.facet, run facet db pull against the existing database to check the result, mark the current state as the baseline with facet migrate resolve, then regenerate the client and update imports.
Last reviewed
Steps
- Run
facet initin your project and copy your models and enums intoschema.facet. - Run
facet db pullagainst your database and compare its output with your port. - Create a baseline migration and mark it applied with
facet migrate resolve --applied <name>. - Run
facet generate, switch imports to the generated client, and run your tests.
What changes in queries?
Common calls such as findMany, findUnique, create, update, upsert, delete, include and select work the same way. Review raw queries and any Prisma-specific extensions.
Frequently asked questions
Do I need to move my data?
Not if the database stays where it is. If you are also moving to Quotura, use the Import tab in the console, which copies the database server to server (see the guide on moving a Postgres database to Quotura).