3 ms·
That’s how I have seen it done in Perl, PHP, Django, etc as well. It’s not an ORM thing it is a naive programmer thing. The ORM makes it easier to do things li
by manicdee 8y ago
That’s how I have seen it done in Perl, PHP, Django, etc as well. It’s not an ORM thing it is a naive programmer thing.
The ORM makes it easier to do things like Class.filter(insurance_end_date < today_date)
But hey what do I know, I am not berating the youf of today so I don’t belong in this skit.
- TekMol 8y agoClass.filter(insurance_end_date < today_date) Which ORM is that? It would be cool to compare some approaches to common problems.
- blowski 8y agoLooks similar to Laravel’s Eloquent, which is inspired by Rails.
- irishsultan 8y agoDiesel has something similar (except that it can't overload < (you can overload < in Rust, but the type doesn't match what's needed), so you need to specify it as insurance_end_date.lt(today_date))
- brobdingnagians 8y agoC++ has a similar thing with sqlpp11: https://github.com/rbock/sqlpp11 https://github.com/rbock/sqlpp11
- funkydata 8y agoThe Django ORM for example. You can ever traverse relations and still use the same syntax: https://docs.djangoproject.com/en/2.0/topics/db/queries/#lookups-that-span-relationships https://docs.djangoproject.com/en/2.0/topics/db/queries/#loo...
- manicdee 8y agoASP.NET MVC4 also has Linq so you can do stuff like Class.All(x => x.attribute == value).ForEach(foo => foo.method()) Django has similar functionality through Q and F expressions. Most ORMs have this functionality of specific language constructs to allow complex queries to be expressed without writing SQL, just with slightly different semantics.