News for hackers. Stuff that matters.
Re:How not to structure database-backed web apps: performanc... by manicdee on Thursday June 28, 2018 @03:48AM (#17414879)
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.

Re:How not to structure database-backed web apps: performanc... by TekMol on Thursday June 28, 2018 @03:51AM (#17414895)

    Class.filter(insurance_end_date < today_date)
Which ORM is that? It would be cool to compare some approaches to common problems.
Re:How not to structure database-backed web apps: performanc... by manicdee on Thursday June 28, 2018 @08:06PM (#17421464)
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.

Re:How not to structure database-backed web apps: performanc... by funkydata on Thursday June 28, 2018 @08:48AM (#17416393)
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...

Re:How not to structure database-backed web apps: performanc... by irishsultan on Thursday June 28, 2018 @03:54AM (#17414918)
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))
Re:How not to structure database-backed web apps: performanc... by brobdingnagians on Thursday June 28, 2018 @04:29AM (#17415070)
C++ has a similar thing with sqlpp11: https://github.com/rbock/sqlpp11
Re:How not to structure database-backed web apps: performanc... by blowski on Thursday June 28, 2018 @03:53AM (#17414909)
Looks similar to Laravel’s Eloquent, which is inspired by Rails.