Comment

Comment by nijave

Imo they work well for dynamic query composition.

Say you want to combine a few sets with dynamic where clauses then intersect a couple other sets. For example, you have a "products" API that lets the user pick from a bunch of different filters

It's pretty easy to composite all that together with a decent ORM

Also migration management and having a programmatic DB schema to object schema mapping is very convenient

I do tend to see a lot of bastardized queries, though from treating ORM objects like they're native in memory objects (N+1, using programming functions where SQL equiv would have been more efficient, pulling data back only to dump it into the where clause of another query)

parent nijave 6 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton