I didn't want to write all those "copy from row to object", so I hacked together something with UDAs

    @dbexpr("FROM user ORDER BY username ASC")
    struct UserListItem
    {
        @dbexpr("user_id")
        int user_id;

        @dbexpr("username")
        string username;
    }
    const users = db.queryExpr!UserListItem;

    res.render!("user.list.dt", req, users);

The little queryExpr method just translates this to a standard select.
Every struct/class field is added as a sql field, and the one at the top is added last.
They can be as complex as you'd like, and they can use query parameters (although the parameter values isn't added from the struct).

And of course, everything is build in at compile time, so there is no performance overhead - gotta love D! :)