On Friday, 5 January 2018 at 08:34:00 UTC, user789 wrote:
On Friday, 5 January 2018 at 07:40:14 UTC, Brian wrote:
I think code style like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
struct User
{
int id;
string name;
string email;
}
class ORM
{
}
auto db = new ORM;
auto users =
db.select(User).where(email.like("*@hotmail.com")).limit(10);
foreach(user; users)
{
writeln("user: " + user.name + "\n");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this rust code is support it:
https://github.com/diesel-rs/diesel/blob/master/examples/postgres/all_about_updates/src/lib.rs
Well in D this would be more something like that:
auto users = db.select!(User).map!(a =>
a.email.like("*@hotmail.com")).take(10);
Oh, I realize that your Q was more: "which package should i use
to write this way ?"