Added schema qualified tables`

This commit is contained in:
rbock
2015-04-30 21:32:50 +02:00
parent 49a538ce52
commit a6a969a4d8
7 changed files with 168 additions and 2 deletions
+6
View File
@@ -183,6 +183,12 @@ int main()
printer.reset();
std::cerr << serialize(select(all_of(t)).from(t).where(t.alpha.in(select(f.epsilon).from(f).where(true))), printer).str() << std::endl;
auto schema = db.attach("lorem");
auto s = schema_qualified_table(schema, t).as(sqlpp::alias::x);
printer.reset();
std::cerr << serialize(select(all_of(s)).from(s).where(true), printer).str() << std::endl;
return 0;
+7
View File
@@ -28,6 +28,7 @@
#include <sstream>
#include <iostream>
#include <sqlpp11/schema.h>
#include <sqlpp11/serializer_context.h>
#include <sqlpp11/connection.h>
@@ -245,6 +246,12 @@ struct MockDbT: public sqlpp::connection
return {};
}
auto attach(std::string name)
-> ::sqlpp::schema_t
{
return {name};
}
};
using MockDb = MockDbT<false>;