| > I'm just asking myself: why invent the custom DSL for that? Fair question. Besides all the type safety features I mentioned above, having the DSL (Prisma schema) allows generating database clients in more than one language, e.g. Go without the database declaration being tied to a specific programming language. It's also the reason it's declarative in contrast with most ORMs that rely on an imperative language to define these mappings. The second reason is that the Prisma schema is used for declarative database migrations with Prisma Migrate. The third reason is that Prisma supports introspection of an existing database. So if you were to introduce Prisma to an existing project, you'd introspect the database which would populate the Prisma schema based on the database schema. This would then allow you to use Prisma for migrations. Could all that be achieved without a custom DSL? Perhaps. But it'd probably tie Prisma to a specific language
ecosystem and would diminish the developer experience of the features it offers. I can understand the reluctance around a new DSL, but in reality, I haven't seen many complaints about the need to use it. |