From 0ec6860fdaa5839366675558511ff4248f007d5c Mon Sep 17 00:00:00 2001 From: rbock Date: Tue, 23 Aug 2016 18:18:16 +0200 Subject: [PATCH] Added test for hidden custom query result type --- test_serializer/CustomQuery.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test_serializer/CustomQuery.cpp b/test_serializer/CustomQuery.cpp index 8f84205d..4f3f106a 100644 --- a/test_serializer/CustomQuery.cpp +++ b/test_serializer/CustomQuery.cpp @@ -23,12 +23,14 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "compare.h" #include "Sample.h" +#include "compare.h" #include #include +SQLPP_ALIAS_PROVIDER(pragma); + int CustomQuery(int, char* []) { const auto foo = test::TabFoo{}; @@ -59,5 +61,10 @@ int CustomQuery(int, char* []) "SELECT DISTINCT tab_foo.omega FROM tab_foo INNER JOIN tab_bar ON (tab_foo.omega=tab_bar.alpha) WHERE " "(tab_bar.alpha>17) GROUP BY tab_foo.omega HAVING (AVG(tab_bar.alpha)>19) ORDER BY tab_foo.omega ASC "); + // A pragma query for sqlite + compare(__LINE__, + custom_query(sqlpp::verbatim("PRAGMA user_version")).with_result_type_of(select(sqlpp::value(1).as(pragma))), + " PRAGMA user_version"); + return 0; }