mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Added prepared_execute to MockDb
This commit is contained in:
parent
be3292b6ce
commit
55ed36ff33
@ -37,7 +37,7 @@ int main()
|
|||||||
test::TabFoo f;
|
test::TabFoo f;
|
||||||
test::TabBar t;
|
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;
|
std::cerr << serialize(c, printer).str() << std::endl;
|
||||||
db(c);
|
db(c);
|
||||||
|
|
||||||
@ -45,11 +45,11 @@ int main()
|
|||||||
p.params.alpha = 8;
|
p.params.alpha = 8;
|
||||||
|
|
||||||
printer.reset();
|
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;
|
std::cerr << serialize(x, printer).str() << std::endl;
|
||||||
db(x);
|
db(x);
|
||||||
|
|
||||||
db.prepare(x);
|
db.run_prepared_execute(db.prepare(x));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,8 @@ struct MockDbT: public sqlpp::connection
|
|||||||
|
|
||||||
void execute(const std::string& command);
|
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)
|
void execute(const Statement& x)
|
||||||
{
|
{
|
||||||
_serializer_context_t context;
|
_serializer_context_t context;
|
||||||
@ -179,6 +180,11 @@ struct MockDbT: public sqlpp::connection
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename PreparedExecute>
|
||||||
|
void run_prepared_execute(const PreparedExecute& x)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
template<typename PreparedInsert>
|
template<typename PreparedInsert>
|
||||||
size_t run_prepared_insert(const PreparedInsert& x)
|
size_t run_prepared_insert(const PreparedInsert& x)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user