From cf02a444d727d1d2cad52fb3657d0c90873abd2e Mon Sep 17 00:00:00 2001 From: rbock Date: Wed, 23 Jan 2019 15:34:47 +0100 Subject: [PATCH] Add custom query insert example --- tests/CustomQuery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/CustomQuery.cpp b/tests/CustomQuery.cpp index 6a15b90d..35d2bc7f 100644 --- a/tests/CustomQuery.cpp +++ b/tests/CustomQuery.cpp @@ -101,6 +101,10 @@ int CustomQuery(int, char*[]) auto i = db(c); static_assert(std::is_integral::value, "insert yields an integral value"); + auto d = custom_query(sqlpp::verbatim("INSERT INTO tab_sample VALUES()")).with_result_type_of(sqlpp::insert()); + auto j = db(d); + static_assert(std::is_integral::value, "insert yields an integral value"); + for (const auto& row : db(custom_query(sqlpp::verbatim("PRAGMA user_version")).with_result_type_of(select(all_of(t))))) {