0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Added prepared_execute to MockDb

This commit is contained in:
rbock 2014-11-07 09:34:48 +01:00
parent be3292b6ce
commit 55ed36ff33
2 changed files with 10 additions and 4 deletions

View File

@ -37,7 +37,7 @@ int main()
test::TabFoo f;
test::TabBar t;
auto c = custom_query(select(all_of(t)).from(t), sqlpp::verbatim("INTO"), t);
auto c = custom_query(select(all_of(t)).from(t), sqlpp::verbatim("INTO"), f);
std::cerr << serialize(c, printer).str() << std::endl;
db(c);
@ -45,11 +45,11 @@ int main()
p.params.alpha = 8;
printer.reset();
auto x = custom_query(sqlpp::verbatim<sqlpp::boolean>("PRAGMA writeable_schema") == true);
auto x = custom_query(sqlpp::verbatim("PRAGMA writeable_schema = "), true);
std::cerr << serialize(x, printer).str() << std::endl;
db(x);
db.prepare(x);
db.run_prepared_execute(db.prepare(x));
return 0;
}

View File

@ -114,7 +114,8 @@ struct MockDbT: public sqlpp::connection
void execute(const std::string& command);
template<typename Statement>
template<typename Statement,
typename Enable = typename std::enable_if<not std::is_convertible<Statement, std::string>::value, void>::type>
void execute(const Statement& x)
{
_serializer_context_t context;
@ -179,6 +180,11 @@ struct MockDbT: public sqlpp::connection
return nullptr;
}
template<typename PreparedExecute>
void run_prepared_execute(const PreparedExecute& x)
{
}
template<typename PreparedInsert>
size_t run_prepared_insert(const PreparedInsert& x)
{