mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-05-05 10:49:14 -05:00
Added schema qualified tables`
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user