From 6e7d05d6db10b42371bfc6d88300760ed3b4d6d8 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Wed, 28 Aug 2024 10:44:14 +0200 Subject: [PATCH] Add type_vector::transform plus minor refactoring --- include/sqlpp11/core/basic/join.h | 4 ++++ .../sqlpp11/core/clause/select_column_list.h | 2 +- include/sqlpp11/core/detail/type_vector.h | 21 ++++++++----------- include/sqlpp11/core/query/custom_query.h | 2 +- include/sqlpp11/core/query/statement.h | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/sqlpp11/core/basic/join.h b/include/sqlpp11/core/basic/join.h index a4ae1657..3b132b52 100644 --- a/include/sqlpp11/core/basic/join.h +++ b/include/sqlpp11/core/basic/join.h @@ -63,6 +63,10 @@ namespace sqlpp using type = detail::make_joined_set_t, detail::type_set>>; }; +#warning: We need to quarantee that no tables are required by join and dynamic provision vs requirements need to be checked upon calling `on`. +#warning: We should mix dynamic and optional into the provided_tables_of (instead of having separate traits for each). +#warning: it might be great to search for missing tables and return something like `missing_table_for>`. + template struct provided_optional_tables_of> { diff --git a/include/sqlpp11/core/clause/select_column_list.h b/include/sqlpp11/core/clause/select_column_list.h index 07df6a5b..6a5daf32 100644 --- a/include/sqlpp11/core/clause/select_column_list.h +++ b/include/sqlpp11/core/clause/select_column_list.h @@ -232,7 +232,7 @@ namespace sqlpp struct has_correct_aggregates> : public std::integral_constant< bool, - (detail::type_vector_size::value == 0 and + (KnownAggregateColumns::empty() and logic::none>>::value...>::value) or logic::all>>::value...>::value> diff --git a/include/sqlpp11/core/detail/type_vector.h b/include/sqlpp11/core/detail/type_vector.h index bc0ae103..9bf4d633 100644 --- a/include/sqlpp11/core/detail/type_vector.h +++ b/include/sqlpp11/core/detail/type_vector.h @@ -38,6 +38,15 @@ namespace sqlpp { template using contains = std::integral_constant::value...>::value>; + + template