[odb-users] Re: Pagination and "join","groupby" in odb

Boris Kolpackov boris at codesynthesis.com
Thu Sep 13 08:11:22 EDT 2012


Hi Scott,

Scott Zhang <macromarship at gmail.com> writes:

> Especially for pagination, odb should hide the different implement of
> database from end users.

That would be a good idea if all the databases that ODB supports had
a way to implement pagination without incurring any extra overheads
(e.g., dynamic queries, etc). Unfortunately, in some databases (e.g.,
Oracle, SQL Server prior to 2012) pagination requires a non-trivial
effort to implement which would in turn also require changes to the
fairly optimal query model that ODB currently implements.


> Is there a plan for this (order by, pagination)?

ORDER BY, yes. Pagination, probably not at this stage.

ORDER BY is already quite easy to do:

query<person> ((query::age < 30) + "ORDER BY" + query::name);

But, I agree, we should wrap it in some syntactic sugar. Something
along these lines:

query<person> (query::age < 30, order_by (query::name));

Boris



More information about the odb-users mailing list