Subject: Re: [boost] quince: queries in C++ expressions
From: pfultz2 (pfultz2_at_[hidden])
Date: 2014-07-16 12:13:55
> Could you clarify what you mean by "do this"? QUINCE_MAP_CLASS builds a
> class with exactly the data members, function members, and bases that
> quince requires.
Boost.Fusion already provides the ability to map the classes to fusion
sequences. Here is a very simple example how to build an ORM using
Boost.Fusion in C++14:
Of course as a simple example, it doesn't map the types to the database
types(it just uses `typeid` for illustration purposes only).
Now this example just demonstrates mapping to the database with fusion. The
other half is building queries in C++. This can easily be done by taking
advantage that the structs are adapted as associative sequences. So we can
the keys to refer to the fields. So we could build queries something like
auto query = from(p)
.where(at_key<fields::age>(p) > 60)
Of course, some additional macros would be useful to reduce the boilerplate,
but an ORM in C++ should really start with Boost.Fusion.
> I'm not actually doing tuple manipulation here. That's not to say the
> task couldn't be solved by a detour through tuples, but it /would/ be a
But it would be a 'detour' that would save you from writing mapping macros.
-Paul Fultz II
-- View this message in context: http://boost.2283326.n4.nabble.com/quince-queries-in-C-expressions-tp4665143p4665226.html Sent from the Boost - Dev mailing list archive at Nabble.com.