Live data from Hacker News

Prisma – ORM for Node.js and TypeScript

prisma.io

121–130 of 260 posts

Re: Prisma – ORM for Node.js and TypeScript

#121
post #109

Earlier quoted context omitted.

It took me all of 1 hour to learn how to use prisma. It’s not as hard as you make it seem. They have a vs code extension for editing the prisma schema. It’s not hard to see that you make fields “String” @unique, etc. Just make one model and that’s 80% of anything you ever need. Want to make a relation? Make a new model model Posts { users User[] } Hit save, it adds the required code to relate it to the User model. Ru…

>It took me all of 1 hour to learn how to use prisma. That is not how this works at all. You don't know what you don't know until you need "how do I do this query in prisma". You then spend an hour trying to figure it out, and maybe it isn't possible, then on to the next thing. It takes more than an hour to learn SQL, so if it takes you an hour to learn Prisma, you are missing something.

Have you even looked at Prisma's docs?

I would rather forget everything about Prisma the second I wake up in the morning and have to read their docs on how to do everything all over again, every single day, than try to understand what the heck is going on in SQL's docs.

Re: Prisma – ORM for Node.js and TypeScript

#122
New idiom - "Well that was a complete ORM"

(sorry just a joke, ORMs do have their place and this looks useful. I'd think of Prisma as a lightweight ORM because it doesn't try to do "Business Rules" as they are known. But then, trying to do Business Rules will generally turn everything into a nightmare anyway so maybe lightweight ORM is the way to go)

Re: Prisma – ORM for Node.js and TypeScript

#124
post #109

Earlier quoted context omitted.

It took me all of 1 hour to learn how to use prisma. It’s not as hard as you make it seem. They have a vs code extension for editing the prisma schema. It’s not hard to see that you make fields “String” @unique, etc. Just make one model and that’s 80% of anything you ever need. Want to make a relation? Make a new model model Posts { users User[] } Hit save, it adds the required code to relate it to the User model. Ru…

>It took me all of 1 hour to learn how to use prisma. That is not how this works at all. You don't know what you don't know until you need "how do I do this query in prisma". You then spend an hour trying to figure it out, and maybe it isn't possible, then on to the next thing. It takes more than an hour to learn SQL, so if it takes you an hour to learn Prisma, you are missing something.

I’ve had to write complicated queries with prisma.

In fact. One that prisma didn’t support.

Ordering by the count of a relationship, and returning the few highest counts.

So I added a GitHub issue that is being tracked.

And what did I do for now?

I wrote the SQL using prisma’ raw query function.

You can learn SQL and use an ORM.

Things don’t always have to be one vs the other

Re: Prisma – ORM for Node.js and TypeScript

#125

Earlier quoted context omitted.

>Prisma is not a community-project but built by a VC-funded company Thanks for clarifying this. I know there tend to be a kneejerk reaction towards VC-funded software projects. How do you guys plan to make money on this?

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…

I’ve read the post you linked and I still don’t know how you plan to make money. Also, the blurb you copy pasted it tells me nothing in a clear way.

Re: Prisma – ORM for Node.js and TypeScript

#126
post #109

Earlier quoted context omitted.

>It took me all of 1 hour to learn how to use prisma. That is not how this works at all. You don't know what you don't know until you need "how do I do this query in prisma". You then spend an hour trying to figure it out, and maybe it isn't possible, then on to the next thing. It takes more than an hour to learn SQL, so if it takes you an hour to learn Prisma, you are missing something.

Have you even looked at Prisma's docs? I would rather forget everything about Prisma the second I wake up in the morning and have to read their docs on how to do everything all over again, every single day, than try to understand what the heck is going on in SQL's docs.

Yeah exactly.

Most queries you can figure out just from typescript auto complete too...

Majority of queries in an app are basic relationships and crud actions... doesn’t take endless hours figuring this out with prisma.

If it did, we wouldn’t use it.

Re: Prisma – ORM for Node.js and TypeScript

#127
post #74

Earlier quoted context omitted.

using `new PrismaClient({ log: ["query"] });` it'll log all the actual sql queries it's running, so you'll be able to see if queries are being combined

Awesome, thanks! Turns out Prisma wasn’t optimizing my queries, I think it has to do with me not using the sub query API and instead querying tables seperately (e.g posts.findMany({ where: { owner: user } }))

Pleeeeeease open an issue if you have a simple reproduction for this. That will make sure we will make sure this _does_ work (sooner or later, not committing to a timeline here on HN of course :p).

Re: Prisma – ORM for Node.js and TypeScript

#129

How are they going to make money?

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?

Re: Prisma – ORM for Node.js and TypeScript

#130

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!

And once you're good at SQL, it will never let you down. Query builders + reasonably abstracted libraries for the repetitive things (the repository pattern in TypeORM gets me just about all the CRUD I need), and query building/raw queries for the rest.

The things that the DB can do (I'm thinking about postgres) are amazing, and you just aren't going to get a chance to use a lot of it really from a lowest common denominator ORM. Yeah, you probably don't need it -- but then again why not just use a tool like Postgrest from the start?

Post reply on HN