How does session.query< std::tuple<ptr<A>, ptr<B> > > work?
Added by Albert Zenkoff about 1 month ago
Hi! I am trying to get a join working and I cannot understand how to get this construct right. Your help will be appreciated.
If I use the construct as in the documentation:
using ReleasePart = std::tupleWt::Dbo::ptr
Wt::Dbo::collection col =
session_->query("SELECT r, p FROM releases r JOIN parts p ON p.id = r.part_id");
This fails to compile (template argument deduction/substitution failed).
If I try to list raw data like "long, string..." instead, it also does not compile.
If I try to use a reference to the tuple
Wt::Dbo::collectiondbo::ptr
session_->querydbo::ptr
it compiles but fails to map at run time
WResource: Uncaught exception from handleRequest (aborting request): Class St5tupleIJN2Wt3Dbo3ptrI7ReleaseEENS2_I4PartEEEE was not mapped.
which is, I suppose, to be expected.
What is the correct way to use this?
Replies (1)
RE: How does session.query< std::tuple<ptr<A>, ptr<B> > > work? - Added by Albert Zenkoff about 1 month ago
Using 4.12.0 on Ubuntu with Postgres if it matters
Simple queries work fine.