Live data from Hacker News

Prisma 2.0 – Type-safe and auto-generated database client

prisma.io

111–112 of 112 posts

Re: Prisma 2.0 – Type-safe and auto-generated database client

#111

I love the idea of a type safe interface to a database, but I'll pass on learning yet another DSL. Seems like inevitably you get to a certain complexity and the DSL just falls apart and you wind up writing SQL regardless. Then you end up with half your queries written in one language (SQL) and the other half in the ORM DSL. SQL isn't that hard and if you are using a SQL database, you can't really escape knowing the c…

the DSL is only for table management, and pretty similar to GraphQL type definition The ORM layer is not a DSL but some nicely done JS/TS functions

> The ORM layer is not a DSL but some nicely done JS/TS functions

You are splitting hairs here as far as I'm concerned. You need to learn the an API so you can do 70% of your queries. Then you need to learn SQL so you can do the other 30% of your queries and actually understand how to design a database. The queries that the "nicely done JS/TS functions" are replacing are almost always the simplest, most basic queries. Do you really need a special query language to say `select * from widgets`?

The big problem with every ORM layer is you are essentially learning a disposable language. Every ORM says it's the best way to Query ever, and yet here we are, 5000 ORMs later and SQL is still an essential skill for developers.

I know... "This time it's different!".

Re: Prisma 2.0 – Type-safe and auto-generated database client

#112
post #86

Earlier quoted context omitted.

I'm very glad to see work being done on db bindings, but until migrations reach the level of django/active record, I won't be using postgres + node.js seriously (again).

I'm with the product team at Prisma. Prisma Migrate is different from ActiveRecord migrations (which are very familiar with) because the DB schema is state-based. The Prisma schema file acts as source of truth and the DB schema will be migrated to match it. Can you elaborate on what you would perceive as reaching the level of Django/ActiveRecord? I'd be interesting in specific aspects/items.

That sounds great! I'm not super familiar with ActiveRecord, but I use Django migrations regularly. For me the things that stand out are

1. a declarative model - ie. defining the db schema rather than the migrations

2. auto generated migrations with the ability to customize

3. integration with tools for deployment and testing

You probably have a much better idea of the landscape, but reach out to Andrew Godwin [1], he wrote south and then rewrote it to become django migrations.

[1] - https://www.aeracode.org/

Post reply on HN