Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.

Run the generate command. Make a client instance.

Create something: db.NameOfModel.create()

And as you’re typing, typescript is auto completing it.

There’s barely anything else to learn. And it’s a quick doc search away.

Don’t hate on it because you love sql, it’s a great tool.



>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


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.


> It took me all of 1 hour to learn how to use prisma. It’s not as hard as you make it seem.

That's because the ORM cannot do a lot. Unless you're doing extremely simple SQL queries it will not handle what you want it to do. Now what? Drop into RAW sql and lose all type safety and you are on your own.

No thanks, I started using Prisma for https://listifi.app and switched it over to knex.js because the second I hit a query that Prisma couldn't handle I was on my own. Knex on the other hand could handle everything because it's a simple query builder.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: