From da9ca737883905b81236e2d2d22fd8cf362fa0c6 Mon Sep 17 00:00:00 2001 From: rbock Date: Tue, 27 Jan 2015 18:28:36 +0100 Subject: [PATCH] First test constructing a cte --- include/sqlpp11/cte.h | 9 ++++++++- tests/WithTest.cpp | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/sqlpp11/cte.h b/include/sqlpp11/cte.h index 7920a35b..34b33506 100644 --- a/include/sqlpp11/cte.h +++ b/include/sqlpp11/cte.h @@ -73,6 +73,13 @@ namespace sqlpp { using _alias_t = typename AliasProvider::_alias_t; + cte_t(Statement statement): _statement(statement){} + cte_t(const cte_t&) = default; + cte_t(cte_t&&) = default; + cte_t& operator=(const cte_t&) = default; + cte_t& operator=(cte_t&&) = default; + ~cte_t() = default; + Statement _statement; }; @@ -92,7 +99,7 @@ namespace sqlpp }; -// The cte is displayed as AliasProviderName except within the with: +// The cte_t is displayed as AliasProviderName except within the with: // - the with needs the // AliasProviderName AS (ColumnNames) (select/union) // The result row of the select should not have dynamic parts diff --git a/tests/WithTest.cpp b/tests/WithTest.cpp index 6932966e..6992458a 100644 --- a/tests/WithTest.cpp +++ b/tests/WithTest.cpp @@ -34,6 +34,9 @@ MockDb::_serializer_context_t printer; int main() { + const auto t = test::TabBar{}; + + auto x = cte(sqlpp::x).as(select(all_of(t)).from(t)); // to be done return 0;