(no title)
monadic2 | 5 years ago
More problems: default scopes causing large refactor pain, modular queries leading to accidental joins and index misses, models containing all of the combinations of models-to-be-rows, models-that-may-be-up-to-date, and models-that-have-already-been-deleted. I prefer explicit lifecycles to avoid semantic ambiguity when it comes to what data to expect where and wehen. Generally, all the places you would expect treating database queries as code against domain objects with different semantics than database tables.
Or, my personal least favorite game, "spend three hours translating this performant query into horrendous, unreadable ruby that technically produces the sql you wanted all along". I've found this comes up repeatedly with aggregate queries and joins and window functions.
Hey ORMs have their place, but I don't get the point of pretending it's even equivalent to SQL when they were built with completely different intentions and constraints.
No comments yet.