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;