Live data from Hacker News

Prisma – ORM for Node.js and TypeScript

prisma.io

131–140 of 260 posts

Re: Prisma – ORM for Node.js and TypeScript

#131

Earlier quoted context omitted.

We've explained this in the blog post here: https://www.prisma.io/blog/prisma-the-complete-orm-inw24qjea... I think this quote summarizes our plans nicely: Prisma's vision is to democratize the custom data access layer used by companies like Facebook, Twitter and Airbnb and make it available to development teams and organizations of all sizes. The open-source ORM we're launching today will of course remain open-sourc…

How does “democratize the custom data access layer” make money?

I have no idea what this means either. Sounds like a bunch of buzzwords about nothing.

Re: Prisma – ORM for Node.js and TypeScript

#132
My team experimented with Prisma, and we ended up deciding to continue using raw SQL. Each of us has 10-20 years of experience writing SQL for PostgreSQL, so it wasn't a surprise that we decided against using an ORM yet again. But Prisma is probably the best ORM for Node.js that we've tried.

For anyone who uses PostgreSQL and is interested in Prisma, check out the following message, which has a section that includes a list of features that were deemed out-of-scope (e.g., bulk upserts):

https://github.com/prisma/prisma/issues/4998#issuecomment-76...

Re: Prisma – ORM for Node.js and TypeScript

#133

I'm completely perplexed at some of the functionality that's absent in Prisma? I'm coming from the Rails/Django world for reference. Can anyone help me understand if I'm out in left field or does this technology only cover basic use cases? - No supported way to do a case-insensitive sorting. https://github.com/prisma/prisma/issues/5068 - Can’t sort by an aggregate value like user’s post count. https://github.com/pris…

@nikolasburk can you comment? Before compiling this list I was seriously considering using Prisma to kick off a big upcoming project. In the spirit of being open-minded I'd really like to know if I'm fundamentally misunderstanding Prisma capabilities.

This is a pretty extensive list! Are all of these points are full blockers for you or are there individual points that you care more about while others might be rather "nice to have"? If most of them are real blockers, you probably shouldn't use Prisma [1], and that's ok :)

Prisma certainly is not perfect and whether you should use it depends on your project and individual requirements. What I can tell you is that we are shipping releases [2] with new features and improvements every two weeks. We are also very eager to learn about more use cases that people want to accomplish with Prisma. The best way to bring these to our attention is by commenting on existing GitHub issues and creating new ones if the one for your use case doesn't exist yet. This helps us prioritze and implement these new features. We also have a roadmap [3] where you can see all the features that we are currently working on.

Hope that helps for now!

[1] https://www.prisma.io/docs/concepts/overview/should-you-use-...

[2] https://github.com/prisma/prisma/releases

[3] http://pris.ly/roadmap

Re: Prisma – ORM for Node.js and TypeScript

#134
post #25

Earlier quoted context omitted.

> GraphQL N+1 issues are a thing of the past. Huh, care to explain this one? I’m using Prisma with Apollo Server without doing anything fancy in my resolvers. I just assumed I’m getting N+1 issues but didn’t bother to optimize yet.

in short the separate engine process allows them to combine every findX call you make during one tick of the event loop into a single SQL query, following the dataloader pattern, so you don’t have to implement it yourself. i’m sure @nikolasburk can shed some more light if you’re interested.

If it's optimizing with figuring the calls in a single tick out, one can probably still optimize further by using db specific features, like postgres supports json_agg which let's you not only break n+1 in a way, but also prevents cartesian product explosion with joins

Re: Prisma – ORM for Node.js and TypeScript

#135
post #57

We tried converting from Sequelize to Prisma and learned transactions were not fully supported... Can't build an app without transactions

Is this for real? And what are people building that wouldn't need this?

Transactions are supported in Prisma, see this guide in our docs [1].

I guess the post refers to our opinionated stance on "long-running transactions" which Prisma indeed does not at the moment. The best resources to learn about this are on GitHub [2] and our blog [3].

[1] https://www.prisma.io/docs/guides/performance-and-optimizati...

[2] https://github.com/prisma/prisma/issues/1844

[3] https://www.prisma.io/blog/how-prisma-supports-transactions-...

Re: Prisma – ORM for Node.js and TypeScript

#136

I'm completely perplexed at some of the functionality that's absent in Prisma? I'm coming from the Rails/Django world for reference. Can anyone help me understand if I'm out in left field or does this technology only cover basic use cases? - No supported way to do a case-insensitive sorting. https://github.com/prisma/prisma/issues/5068 - Can’t sort by an aggregate value like user’s post count. https://github.com/pris…

I can clarify one point, relative to migration rollbacks. We indeed chose not to implement down migrations as they are in most other migration tools. Down migrations are useful in two scenarios: in development, when you are iterating on a migration or switching branches, and when deploying, when something goes wrong.

- In development, we think we already have a better solution. Migrate will tell you when there is a discrepancy between your migrations and the actual schema of your dev database, and offer to resolve it for you.

- In production, currently, we will diagnose the problem for you. But indeed, rollbacks are manual: you use `migrate resolve` to mark the migration as rolled back or forward, but the action of rolling back is manual. So I would say it _is_ supported, not just as convenient and automated as the rest of the workflows. Down migrations are somewhat rare in real production scenarios, and we are looking into better ways to help users recover from failed migrations.

Re: Prisma – ORM for Node.js and TypeScript

#137
post #131

Earlier quoted context omitted.

How does “democratize the custom data access layer” make money?

I have no idea what this means either. Sounds like a bunch of buzzwords about nothing.

It means that Prisma will provide a data access layer (we call it "application data platform" [1]) similar to the custom data access layers built by big companies [2] (e.g. TAO by Facebook or Strato by Twitter) that enables application developers to better access their databases.

We've explained that in the blog post here in the "Open-source, and beyond"-section [3].

Does that help? :)

[1] https://imgur.com/O1lwo0v.png

[2] https://imgur.com/Hb9VOWN.png

[3] https://www.prisma.io/blog/prisma-the-complete-orm-inw24qjea...

Re: Prisma – ORM for Node.js and TypeScript

#138

Earlier quoted context omitted.

Interesting -- I actually haven't had as many problems as you have with TypeORM -- it's just mostly worked. Then again, maybe I'm a rare case, because I basically ignore the ORM side and use a little repository pattern, the query builder, and write my own migrations in SQL (as in all the migrations are `await queryRunner.query(...);`). It's been excellent for me -- I ignore the bad abstractions, have a good underlyin…

This is the one upside I’ve had of using TypeORM: I find its query abstractions so unreliable and surprising that it’s forced me to get better at SQL!

Lmao. This happened to me too no joke

Re: Prisma – ORM for Node.js and TypeScript

#139
post #58

I am a noob in these matters which one is advised if one is to start a GraphQL API from the beginning - use DBs that directly provide GraphQL endpoints such as Fauna, Upstash, etc. - use an ORM with more traditional DBs. What are the pros and cons of each?

I prefer having the database as a single source of truth and use something like [Hasura]( https://nhost.io ) to generate the GraphQL API.

I second this, Hasura is a solid choice.

Re: Prisma – ORM for Node.js and TypeScript

#140
post #107
post #63

Earlier quoted context omitted.

I think SQL gets a lot of undeserved praise that I’m having a difficult time understanding. The only impressive thing about SQL is its prevalence but that’s a pretty poor yardstick unless one thinks that an appeal to popularity is an indicator of quality. Now let me count the ways in which SQL is bad: - it composes poorly due to its unwieldy cobolesque syntax - it is a leaky abstraction revealing a lot of underlying…

An ORM API on the other hand is completely meaningless adhoc "whatever works". It doesn't have grounding in anything.

I'm making no statements about ORMs. I'm just picking apart the mindless "SQL is the bee's knees" mantra so prevalent on HN.
Post reply on HN