9 ms·
One headline is: Focus on your data – not on complex SQL queries Looks like just another SQL DSL trying to make you not learn SQL. TS's structural typing and
by Scarbutt 7y ago
One headline is:
Focus on your data – not on complex SQL queries
Looks like just another SQL DSL trying to make you not learn SQL. TS's structural typing and plain SQL can get you far into a simpler/robust system IMO.
Also, the "introspection" part of Prisma seems very crippled, Postgres has so many useful features for writing application code that it seems wasteful to just treat it as dumb data store.
- nerdponx 7y agoComposability and encapsulation are both somewhat lacking in SQL and there are valid reasons to want to write queries in a different DSL that can be compiled to SQL.
- jbverschoor 7y agoJust stop the anti-ORM bs. Most applications need simple select queries, and often want to walk the obejct / relation graph. Prism looks awesome, and has great TS support. If you want to concatenate sql for each frikking query, be my guest. I have better things to do with my time, such as responding to this kind of stuff. For "small" and "large" queries, just use the ORM. For "complex" queries, just use SQL.
- david-cako 7y agoI find the process of writing database access functions annoying, and for the most part, arbitrary and repetitive. ORM functionality that bakes types/accessors, migrations, graphQL, and even infrastructure into your codebase is where it’s at. The fact that you are writing your models once and automatically exposing them as types in any project’s language is a huge value. I don’t need the same language everywhere, but I want types that plug together without hassle. Next generation “serverless” databases will fully abstract object mapping away. It’s tedious and arbitrary. Even indexing is relatively easy to automate. I am incredibly excited for what Apple is brewing up right now for developers.
- ithrow 7y agoWhat is apple brewing?
- servercobra 7y agoIs Apple working on some sort of serverless/Firebase type thing?
- applecrazy 7y agoI think they're referring to this: https://developer.apple.com/icloud/cloudkit/ https://developer.apple.com/icloud/cloudkit/ It kind of flew under the radar, because it's not super clear how to use it from the landing page.
- david-cako 7y agoCloudKit, edge, etc
- throwaway894345 7y agoSQL isn't type-safe, so Prisma has that over it if nothing else. There's also a lot to be said for the difficulty in composing efficient SQL queries. If this tool can do that (I would be surprised) it would be a significant advancement (yes, this would be "making you not learn SQL" in the same way C makes you "not learn assembly").
- jayd16 7y agoHmm, in what sense is SQL not type safe where this would be type safe, though? You could still use out of date client code connected to a DB that has had its schema change, no? The DB and the code are not packaged together so is there even such a thing as compile time type safety?
- throwaway894345 7y agoSomething like this would make sure that all queries are correct per some expected schema and processes keep the expected and live schemas in sync. Such a process might be "database migrations run in the CD pipeline and nothing else changes the database". Of course there are edge cases here and there (someone will eventually need to log into a production database), but these processes go a long way toward reducing risk.
- alde 7y agoSQL is as type-safe as the DB engine allows it to be. PostgreSQL is type-safe. Extracting these types and making them available and usable in your lang-of-choice at compile time is a different problem though.
- throwaway894345 7y agoYes, when we talk about type safety, we generally mean "compile time" type safety. Python is also "type safe" at runtime (which is to say, "it's strongly typed"), but we don't conventionally consider Python to be type-safe.
- 7y ago
- skrebbel 7y ago> Postgres has so many useful features for writing application code Except versioning, maintainability, testability, source control, migration, or just about 80% of what an application developers expects from the thing that runs their code. I mean, I really really love the idea of stored procedures and triggers, it's so much more elegant than putting all the code in some Node app and just doing read-modify-write cycles into the DB, but until DBs get their ass together wrt being a properly useable platform to run code on, it's not gonna happen.
- jayd16 7y agoYou can use things like Flyway or other tools that track schemas and migrations in source control quite easily.