#Best ORMs for Ts?

30 messages · Page 1 of 1 (latest)

shut burrow
#

I've been using prisma for quite a while and I'm looking to switch to another orm. The developer experience is great, however the performance is not.

Some people have recommended Drizzle though from seeing some other benchmarks it's more or less the same as prisma.

frosty pumiceBOT
#
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by staff
pulsar gazelle
#

use raw stuff like postgres.js

shut burrow
#

No, thanks. I would like to keep my sanity for now

#

Surely there is some ORM that has good performance

long sorrel
#

Pretty sure drizzle merely uses whatever driver you give it

strange galleon
#

Drizzle is not fast. Drizzle doesn't slow you down

onyx swallow
#

You'll always lose performance over raw queries with ORMs. The trade-off is better dev management and code structure.

shut burrow
#

I'm aware of this, though I was looking for an ORM that didn't add much overhead because prisma adds a ton. Some people suggested TypeORM though from what I've seen it's not in a good state right now

long sorrel
#

can't really see how drizzle that's barely an orm has as much overhead as prisma (also there's some fancy list of limitations when you plug drizzle into prisma, but that's besides)

#

also, do you really need that much performance?

lean salmon
#

if you're looking for best performance an orm isn't the best pick

onyx swallow
#

Prisma does have a raw method

#

bypasses their engine and submits the query directly to the database

#

You just need to build the query manually

lean salmon
#

yeah but if you're going to do that, at that point you're not using it as an orm

#

and you could just use a query builder

#

eg kysely

onyx swallow
#

Depends on the query. I can see why an ORM is good for repeatable querys like fetching user data based on ids. But doing lots of joins and union most ORMs struggle with.

long sorrel
#

prisma apparently just can't even

#

(per the limitations drizzle lists)

lean salmon
#

they have recently improved their performance

long sorrel
lean salmon
#

I'm not saying an orm isn't good, I use prisma myself, but if one of the requirements is best performance then maybe they can reconsider

#

you could use kysely and wrap it on a repository

shut burrow
shut burrow
#

I know they said that they'll be doing a ts port of the engine but I'd rather migrate to something else than wait for that. After all, with ORMs you tend to build your app around them, not with them

shut burrow
#

I tried kysely (more specifically prisma-kysely since I like prisma's schema language). I think it's probably the best way to interact with your db so far while maintaining decent performance and harnessing the power of raw sql

long sorrel
#

This isn't really a spot for empty opinions like that, and even more so almost a month after the original question was answered and resolved