Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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.



    Class.filter(insurance_end_date < today_date)
Which ORM is that? It would be cool to compare some approaches to common problems.


ASP.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.


The 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/#loo...


Diesel 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))


C++ has a similar thing with sqlpp11: https://github.com/rbock/sqlpp11


Looks similar to Laravel’s Eloquent, which is inspired by Rails.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: