this post was submitted on 03 Dec 2025
866 points (98.9% liked)

Programmer Humor

27690 readers
446 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] ricecake@sh.itjust.works 3 points 2 days ago

My standard for an orm is that if it's doing something wrong or I need to do something special that it's trivial to move it aside and either use plain SQL or it's SQL generator myself.

In production code, plain SQL strings are a concern for me since they're subject to the whole array of human errors and vulnerabilities.

Something like stmt = select(users).where(users.c.name == 'somename') is basically as flexible as the string, but it's not going to forget a quote or neglect to use SQL escaping or parametrize the query.

And sometimes you just need it to get out of the way because your query is reaaaaaal weird, although at that point a view you wrap with the orm might be better.

If you've done things right though, most of the time you'll be doing simple primary key lookups and joins with a few filters at most.