Martin Šošić
01/27/2021, 7:00 PMurl
in datasource block can be defined via an ENV var, which is great, but provider
can't, which means it is fixed.nikolasburk
provider
dynamically.
We actually used to consider this workflow (SQLite in development, Postgres in production) in the past but after talking to a number of users, we decided that this is probably not a good practice for Prisma users.
The strongest argument that speaks against this ist that the Prisma schema capabilities (as well as the generated Prisma Client code) change depending on the provider
.
For example, enum
definitions are possible with Postgres, but not with SQLite. The goal of Prisma is to be able to expose the specific features of the underlying DB, and since SQLite doesn't natively support enums, Prisma does not allow their usage in the Prisma schema either.
Does that resonate with you? Let me know if you have any further questions, always happy to help 🙂nikolasburk
provider
throughout all stages is to reduce potential surprises in behavior when deploying to production.Martin Šošić
01/28/2021, 9:34 AMnikolasburk