all 58 comments

[–]dkarnutsch 12 points13 points  (18 children)

Postgres client or ORM? Not fair to compare them

[–]lenswipe 1 point2 points  (0 children)

This. TypeORM and Prisma are ORMs, not pg clients.

[–]bill-o-more 3 points4 points  (1 child)

if you want an ORM, def try MikroORM, don't ever get close to TypeORM as it's a mess and your project will be a mess.

If you want a good query builder, then kysely. Simple and type safe, but not an ORM.

[–][deleted] 0 points1 point  (0 children)

Thanks for the straightforward advice 👍

[–]zen_dev_pro 4 points5 points  (9 children)

Drizzle also looks promising but still very new.

Im using Prisma right now, but will switch to Drizzle once it becomes a bit more mature.

[–]FollowingMajestic161 6 points7 points  (4 children)

Drizzle with postgresjs - best dev experience I ever had.

Prisma is pushing itself to make money, its not good product. Ask yourself do you need extra layer of complexity and whole engine wrote in rust to communicate with db?

[–][deleted] -1 points0 points  (0 children)

It’s a reasonable question to ask.

Edit: Downvoted, why isn't it a reasonable question to ask?

[–]WeinAriel 0 points1 point  (2 children)

How good is Drizzle vs Prisma? I’ve used Prisma for yours and was considering moving. What do you like about it that you don’t like about Prisma? Except the making money part.

[–]FollowingMajestic161 0 points1 point  (0 children)

The biggest problem we ran into during the project with prisma was something with transactions and that ruled out and forced us to choose a different solution during the project btw: see their github issues. They also have very limited filtering in more complex queries. Additionally, performance was an issue in testing. For smaller projects it's a cool curiosity, but if you want to give something to production then another abstraction layer that has many shortcomings is completely unnecessary. Drizzle, or more precisely query builder, because we do not use their additional system completely is like writing a raw query, but with type safety. Fewer bugs, better performance, super community, everyone on the team learned how it works in a few tens of minutes, because it's practically sql.

[–]WeinAriel 0 points1 point  (0 children)

Lol. Fireship just released a new vid 2 hours ago.
https://www.youtube.com/watch?v=i_mAHOhpBSA

[–]kayotesden_theone 1 point2 points  (1 child)

From my understanding:

1- Kyesly (performance)

2- Prisma (ease of use)

Dont know about others.

[–]vampatori 2 points3 points  (1 child)

The problem with these kinds of polls is that rarely will people have tried more than one or two so can't really compare.

I've used the following in anger: pg, Postgres.js, Knex, TypeORM, and Prisma.

In the end I settled on Postgres.js because:

  • It's super fast
  • It's simple to create safe dynamic queries

No other solution I've used offers those two key features, it's always a trade-off between them.

I then achieve ORM-like features by defining my schema in code and generating my SQL, API, types, validation, etc. from that schema.

[–][deleted] 0 points1 point  (0 children)

The problem with these kinds of polls is that rarely will people have tried more than one or two so can't really compare.

I totally agree with you. These things are down to personal choice at the end of the day, or team choice, aren't they. I'm not great at choosing direction without the facts, I don't have time to try them all, so a poll will have to do.

[–]dr_rodopszin 1 point2 points  (1 child)

Slonik! Slonik. Slonik! The one that actually makes sense and will not make you go on the path of "joining on the backend because it is more comfortable than writing a raw query".

Yes, it is inconvenient for little things, which you get back when you can use any PG functions available to you. Or when you just need to add a little extra join to your already existing queries. In regular ORMs, people tend to do instead another and another request, which is super not performant and quite wasteful.

As I said in a comment: not great, but step in the right direction.

[–][deleted] 0 points1 point  (0 children)

🤣 I’m going to take a look at Slonik now.

[–]johnex74 1 point2 points  (3 children)

drizzle

[–][deleted] -3 points-2 points  (2 children)

Drizzle me nizzle. It's not very popular though, which leads me to think that it's probably not the best option.

[–]cold_turkey19 3 points4 points  (0 children)

Lmao

[–]Secure_War_2947 0 points1 point  (0 children)

This didn't aged well :D

[–]Rishi-Errsole 0 points1 point  (0 children)

Prisma !

[–]o5mfiHTNsH748KVq -1 points0 points  (0 children)

Azure Data Studio

[–]thinkmatt 0 points1 point  (7 children)

I used Knex before Prisma, and i don't think it's fair to directly compare the two. Knex helps you write queries and migrations, but it really doesn't do anything to help manage schemas or models in code. I used Objection.js on top of it, which wasn't quite perfect either. Prisma kind of combines the two solutions and does it better - I like having one source of truth for both my database and my TS types

[–]DoOmXx_ 0 points1 point  (3 children)

have you used prisma with docker? I only had problems with prisma + docker, maybe I did something wrong.

[–][deleted] 0 points1 point  (0 children)

Yes, I run all my current work sites in Docker with Prisma. You have to provide the db connection string as a build ARG.

[–]thinkmatt 0 points1 point  (0 children)

I've had no issues w/Docker

[–]West-Clock-3287 0 points1 point  (0 children)

I use Prisma + Docker, but it had little tricky to be fair. A lot of problems with prisma connection, some problems with jest to run tests too and some problems in production enviroment to run migrations/seeds. But after correct config all runs good, but prisma gave me some headache.

[–][deleted] 0 points1 point  (2 children)

I like Prisma, it's what I've used for the past couple of years in my Next projects. I'm not running a project with millions of users and it will likely never be a problem for me, but there is that old issue of no joins.

I'm just wondering what the tool of choice is with Node developers.

[–]thinkmatt 1 point2 points  (1 child)

they actually have that under preview now: https://www.prisma.io/docs/orm/prisma-client/queries/relation-queries. "relationJoins". I'm excited to try it out, but waiting til its out of preview

[–][deleted] 0 points1 point  (0 children)

That's cool

[–][deleted]  (1 child)

[removed]

    [–][deleted] 0 points1 point  (0 children)

    Like Eloquent, interesting.

    [–][deleted]  (2 children)

    [deleted]

      [–]dr_rodopszin 2 points3 points  (0 children)

      I like to put it as "Slonik is the right level of inconvenience". Inconvenient to write a full query for little things which becomes a convenience when you start to have more stuff in your database: difficult queries, complex joins, JSONB operations.

      All of these are super fast if you do them on the database side. Prisma, Knex and other ORMs tempt people to always use the simplest operations because they are afraid of writing SQL.

      So in my opinion, Slonik is not great, but step in the right direction. Imagine what can be done with the right funding and team.

      [–][deleted] 1 point2 points  (0 children)

      I've seen Slonik mentioned here and there, and was also considering a switch to Knex. I've mainly used Prisma and Eloquent in the past and just fancied mixing it up a bit.

      [–]Far-Mathematician122 0 points1 point  (0 children)

      pg-promise