I empathize with the frustration that this library is trying to solve. It's pretty nifty too! Ultimately, however, I don't believe this is the correct approach. The problem with this tool, like every other multi-SQL-flavor-SQL ORM and query builder, is that it requires users to learn yet another language. In addition to Node.js and SQL, users need to learn the Prisma query language. This is not trival, and users that…
Specifically in Node.js, https://github.com/gajus/slonik has drastically improved the experience of writing and composing SQL queries. I am the author of Slonik.
Prisma 2.0 – Type-safe and auto-generated database client
31–40 of 112 posts
Re: Prisma 2.0 – Type-safe and auto-generated database client
#32I'm super excited about Prisma 2! I feel like we finally have a database client that (1) is/will be very powerful and (2) is very approachable and easy for beginners to learn. It certainly doesn't replace the need to know some SQL, but it does delay that which is great for so many people. I'm definitely using this instead of any ORM for every project I can. I really love having the fully typed interface for Typescrip…
Re: Prisma 2.0 – Type-safe and auto-generated database client
#33I'm super excited about Prisma 2! I feel like we finally have a database client that (1) is/will be very powerful and (2) is very approachable and easy for beginners to learn. It certainly doesn't replace the need to know some SQL, but it does delay that which is great for so many people. I'm definitely using this instead of any ORM for every project I can. I really love having the fully typed interface for Typescrip…
What are your thoughts on RedwoodJS? https://github.com/redwoodjs/redwood
Re: Prisma 2.0 – Type-safe and auto-generated database client
#34I don't have my head in backend too much these days and haven't kept up with all of these solutions. It seems like Hasura is the more popular option right now? or do they fit a slightly different space?
Prisma and Hasura are very different! Prisma is a database toolkit that's used by application developers to develop server-side applications in Node.js and TypeScript (e.g. REST APIs, microservices, gRPC calls, GraphQL APIs, ..., anything that talks to a database). The main tool Prisma Client is a query builder that's used to programmatically send queries to a database from Node.js/TS. Hasura is a "GraphQL-as-a-Servi…
(I’m from Hasura)
You can extend business logic in Hasura in a number of ways, including (but not exclusively) ones that work well with serverless and async architectures. Other examples follow:
1. You can extend it by adding business logic in the database via user-defined functions. Eg: You want a fulltext search or a PostGIS function that is better off in the DB anyway.
2. You can bring your own GraphQL server with custom resolvers and Hasura will merge them into its own API and let you “join” across them as well.
3. You can bring REST APIs and add graphql types for them in Hasura and use it as custom resolvers that extend the schema as well.
Hasura’s key value add is an instant GraphQL API backed by your own data-sources (database, GraphQL, REST) and then a fine-grained authorization system on it.
Like Nikolas said, very different from Prisma. Hasura aims to add value as “infrastructure” by guaranteeing performance and security where as Prisma is like an ORM/database toolkit.
Re: Prisma 2.0 – Type-safe and auto-generated database client
#35I empathize with the frustration that this library is trying to solve. It's pretty nifty too! Ultimately, however, I don't believe this is the correct approach. The problem with this tool, like every other multi-SQL-flavor-SQL ORM and query builder, is that it requires users to learn yet another language. In addition to Node.js and SQL, users need to learn the Prisma query language. This is not trival, and users that…
Re: Prisma 2.0 – Type-safe and auto-generated database client
#36Earlier quoted context omitted.
Prisma and Hasura are very different! Prisma is a database toolkit that's used by application developers to develop server-side applications in Node.js and TypeScript (e.g. REST APIs, microservices, gRPC calls, GraphQL APIs, ..., anything that talks to a database). The main tool Prisma Client is a query builder that's used to programmatically send queries to a database from Node.js/TS. Hasura is a "GraphQL-as-a-Servi…
> That setup can be great when your application doesn’t require a lot of business logic and the CRUD capabilities that are exposed in the GraphQL API fit your needs (though I believe you can add business logic in Hasura by integrating serverless functions). (I’m from Hasura) You can extend business logic in Hasura in a number of ways, including (but not exclusively) ones that work well with serverless and async archi…
Re: Prisma 2.0 – Type-safe and auto-generated database client
#37For your reference: https://github.com/prisma/prisma/discussions/2138
Re: Prisma 2.0 – Type-safe and auto-generated database client
#38If I understand correctly, transactions are currently not supported for doing any advanced business logic beyond building CRUD: https://www.prisma.io/docs/reference/tools-and-interfaces/pr... Also, no mention of aggregations, or if someone could point me to it? As far as typed query builders go, even though things like JOOQ are simply amazing, but I fear that the query building approach has not really caught on for d…
Re: Prisma 2.0 – Type-safe and auto-generated database client
#39I have a lot of experience with ORMs (the Django one in particular). I'm having a hard time finding a quick overview of how Prisma's model is different. Are there any good overviews of the similarities and differences?
Prisma takes a fundamentally different approach by generating a database client that returns plain old JS objects. We've written more extensively about this topic in the docs: https://www.prisma.io/docs/understand-prisma/why-prisma
Re: Prisma 2.0 – Type-safe and auto-generated database client
#40"The problem: Working with databases is difficult" This makes me think of all brainstorming sessions I attended in my life with people asking over and over again, not convincing themselves with most answers: "Ok, guys, seriously now, what problem do we think we solving here?"