[odb-users] ORDER BY clause in ODB query language
Markus Klemm
markus at markusklemm.net
Mon Sep 7 10:59:42 EDT 2015
Hi Boris,
I didn't use the += operator, because it causes compiler errors for at least the wstring members. Surprisingly the bit type works.
I updated the according gist ( https://gist.github.com/Superlokkus/a994d42534beca9ed5c6 ), added the erros to the relevant lines and also added the object definition.
But as always, already a big thank you, for your efforts and this still great library.
Regards
Markus Klemm
> Am 04.09.2015 um 16:41 schrieb Boris Kolpackov <boris at codesynthesis.com>:
>
> Hi Markus,
>
> Markus Klemm <markus at markusklemm.net> writes:
>
>> Raw Sourcecode below [...]
>
> Wouldn't something like this work:
>
> using dir_query = odb::query<directory>;
>
> dir_query q ("ORDER BY");
>
> switch (column)
> {
> case added:
> q += dir_query::added;
> ...
> }
>
> switch (order)
> {
> case desc:
> q += "DESC";
> ...
> }
>
> db.query (q);
>
> Boris
More information about the odb-users
mailing list