|
|
|
|
|
by rtpg
121 days ago
|
|
The one thing I really appreciate with the ORM is that you really can get the ORM to make... more or less any sort of SQL query you want. It can take a while to wrap your head around what fields get used in aggregates and the like, but when working with big models with like 65 fields and juggling a bunch of stuff, not having to futz with serialization/deserialization and "just" expressing your problem in the dumb way is nice. I want to say this all comes back to bite you in the end but honestly it's more just having wide tables that comes to bite you. A service layer wouldn't really save you. Meanwhile you save yourself a bunch of tedium in the mean time |
|
And if you can't make the ORM make the SQL query you want, you can just write it as a SQL query, like this godawful monstrosity:
... which calculates the Haversine distance from where you are now to the five nearest points.I am in roughly equal parts proud of and horrified by this creation.