Sam Wilson's Website

July 2023

  1. I’ve got this weird little project that I’ve been working on a bit, and I keep trying to remove the ORM system. It’s not that ORMs are terrible, they’re not, they’re great sometimes. But when it comes down to it I just find it more annoying. I love looking at the database query report for any given page in the app, and knowing exactly what each is for and that each is useful. It’s just so easy to end up with lots of random look-up queries with an ORM set-up — it seems that it’s common to have a foreign key, and to not actually care about any of the attributes of the foreign record, but the ORM ends up querying for it. I don’t mean the whole “n+1 selects” problem, that’s annoying but not all that hard to avoid. It’s the extra queries that don’t really effect performance that bother me. I’d rather have a bit of a say over what’s run.