From 55ed36ff33e20bf41064d6454a29fda4c704f735 Mon Sep 17 00:00:00 2001 From: rbock Date: Fri, 7 Nov 2014 09:34:48 +0100 Subject: [PATCH] Added prepared_execute to MockDb --- tests/CustomQueryTest.cpp | 6 +++--- tests/MockDb.h | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/CustomQueryTest.cpp b/tests/CustomQueryTest.cpp index 9ac36614..b7a3d483 100644 --- a/tests/CustomQueryTest.cpp +++ b/tests/CustomQueryTest.cpp @@ -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("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; } diff --git a/tests/MockDb.h b/tests/MockDb.h index 33a1d7e2..85bf5630 100644 --- a/tests/MockDb.h +++ b/tests/MockDb.h @@ -114,7 +114,8 @@ struct MockDbT: public sqlpp::connection void execute(const std::string& command); - template + template::value, void>::type> void execute(const Statement& x) { _serializer_context_t context; @@ -179,6 +180,11 @@ struct MockDbT: public sqlpp::connection return nullptr; } + template + void run_prepared_execute(const PreparedExecute& x) + { + } + template size_t run_prepared_insert(const PreparedInsert& x) {