News for hackers. Stuff that matters.
Re:Prisma 2.0 – Type-safe and auto-generated database client by tirumaraiselvan on Tuesday June 09, 2020 @11:45AM (#23467633)
> 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 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 by nikolasburk on Tuesday June 09, 2020 @11:55AM (#23467738)
Thanks a lot for the clarification, Tirumarai! (Remote JOINs look awesome btw, congrats on the release :)
Re:Prisma 2.0 – Type-safe and auto-generated database client by albertgao on Tuesday June 09, 2020 @11:07PM (#23473492)
I love both Prisma 2 and Hasura! 2 awesome products!
Re:Prisma 2.0 – Type-safe and auto-generated database client by e12e on Tuesday June 09, 2020 @06:13PM (#23471555)
It's my impression that hasura caters more to (also) those that need to integrate with an existing database and schema, possibly with views and functions - would that be accurate?

Does it make sense to slap prisma on top of an existing g production database?

Re:Prisma 2.0 – Type-safe and auto-generated database client by tango12 on Tuesday June 09, 2020 @07:43PM (#23472239)
(I'm from Hasura).

It was a definitely a design goal for us to make the existing production database use-cases as seamless as possible.

Instead of adding a new DSL on top of the database, Hasura maps much of the DML subset of SQL over to GraphQL (tables, views, functions) so that we're not re-inventing that bit and the translation is restricted to the "relation set" to "tree" transformation. json aggregation and json operations in Postgres are phenomenal! Hasura's authz RLS-like layer injects authorization in as well to make that GraphQL API actually useful.

JOOQ has probably done the most phenomenal job in mapping almost all database constructs to a native language library, but there's a solid amount of type magic there which I'm not sure is portable to every language.

Re:Prisma 2.0 – Type-safe and auto-generated database client by lukaseder on Wednesday June 10, 2020 @04:05AM (#23474972)
> but there's a solid amount of type magic there which I'm not sure is portable to every language.

It is, but I've just been too lazy so far to actually do it.

Re:Prisma 2.0 – Type-safe and auto-generated database client by sorenbs on Tuesday June 09, 2020 @06:39PM (#23471756)
It certainly make ssense to use Prisma with an existing database. In fact, Prisma is able to introspect your database and create a typesafe data access client for you.

If you give it a try and have a database handy, I bet you can have it up and running in less than 10 minutes.

Re:Prisma 2.0 – Type-safe and auto-generated database client by e12e on Wednesday June 10, 2020 @09:54AM (#23477016)
Thank you both for replies (hasura and prisma).

Regarding prisma, I see my impression was off a bit from talking with our team that used prisma in a green field project with migrations quite happily. And I somehow forgot that migrations are still marked experimental and are kind of new.

https://www.prisma.io/docs/reference/tools-and-interfaces/pr...

Re:Prisma 2.0 – Type-safe and auto-generated database client by o_____________o on Tuesday June 09, 2020 @04:27PM (#23470536)
What do you think of Hasura vs Postgraphile?

https://www.graphile.org/postgraphile/

Re:Prisma 2.0 – Type-safe and auto-generated database client by jamil7 on Tuesday June 09, 2020 @02:15PM (#23469151)
Got it. Thank you both for your replies!