[odb-users] Re: Joined queries
Boris Kolpackov
boris at codesynthesis.com
Tue Mar 10 08:01:01 EDT 2015
Hi Nicholas,
Nicholas Cremonesi <nicholas.cremonesi at gmail.com> writes:
> I supposed to use views.
Yes, views are probably what you need.
> But my question is: can I define a view directly in my main.cxx when
> I need them, or I have to all possible views before hxx compilation?
A view has to be compiled by the ODB compiler so it has to be defined
in the header. But, if you have multiple queries that have the same
result (i.e., number, type, and order of columns), then you can reuse
a single view and specify the actual query at runtime. See Section
10.6, "Native Views" for details.
Boris
More information about the odb-users
mailing list