From eef8fab8c6acf02930646baaf5596164ef61b0a5 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sun, 27 Oct 2024 12:54:11 +0100 Subject: [PATCH] Rename has_name to has_name_tag --- include/sqlpp11/core/basic/parameter.h | 2 +- include/sqlpp11/core/name/name_tag.h | 3 +-- include/sqlpp11/core/operator/expression_as.h | 2 +- include/sqlpp11/core/tuple_to_sql_string.h | 2 +- tests/core/types/aggregate_function/avg.cpp | 4 ++-- tests/core/types/aggregate_function/count.cpp | 4 ++-- tests/core/types/aggregate_function/max.cpp | 4 ++-- tests/core/types/aggregate_function/min.cpp | 4 ++-- tests/core/types/aggregate_function/over.cpp | 10 ++++----- tests/core/types/aggregate_function/sum.cpp | 4 ++-- tests/core/types/clause/select_columns.cpp | 4 ++-- tests/core/types/dynamic.cpp | 8 +++---- .../core/types/operator/assign_expression.cpp | 6 ++--- tests/core/types/operator/expression_as.cpp | 8 +++---- .../types/operator/sort_order_expression.cpp | 8 +++---- tests/core/types/result_row.cpp | 2 +- tests/core/types/select_as.cpp | 22 +++++++++---------- 17 files changed, 48 insertions(+), 49 deletions(-) diff --git a/include/sqlpp11/core/basic/parameter.h b/include/sqlpp11/core/basic/parameter.h index e8753391..00b45605 100644 --- a/include/sqlpp11/core/basic/parameter.h +++ b/include/sqlpp11/core/basic/parameter.h @@ -81,7 +81,7 @@ namespace sqlpp -> parameter_t, NameTagProvider> { static_assert(has_value_type::value, "first argument is not a value type"); - static_assert(has_name::value, "second argument does not have a name"); + static_assert(has_name_tag::value, "second argument does not have a name"); return {}; } } // namespace sqlpp diff --git a/include/sqlpp11/core/name/name_tag.h b/include/sqlpp11/core/name/name_tag.h index 770220a6..293ae1a6 100644 --- a/include/sqlpp11/core/name/name_tag.h +++ b/include/sqlpp11/core/name/name_tag.h @@ -54,9 +54,8 @@ namespace sqlpp template using name_tag_of_t = typename name_tag_of::type; -#warning: rename to has_name_tag // Override this for other classes like columns or tables. template - struct has_name : public std::integral_constant, no_name_t>::value> {}; + struct has_name_tag : public std::integral_constant, no_name_t>::value> {}; } // namespace sqlpp diff --git a/include/sqlpp11/core/operator/expression_as.h b/include/sqlpp11/core/operator/expression_as.h index 000eb957..ad7701d6 100644 --- a/include/sqlpp11/core/operator/expression_as.h +++ b/include/sqlpp11/core/operator/expression_as.h @@ -84,7 +84,7 @@ namespace sqlpp template using check_as_args = ::sqlpp::enable_if_t< - has_value_type::value and not is_alias_t::value and has_name::value + has_value_type::value and not is_alias_t::value and has_name_tag::value >; template > diff --git a/include/sqlpp11/core/tuple_to_sql_string.h b/include/sqlpp11/core/tuple_to_sql_string.h index 2d7e2033..7ef7bbf1 100644 --- a/include/sqlpp11/core/tuple_to_sql_string.h +++ b/include/sqlpp11/core/tuple_to_sql_string.h @@ -100,7 +100,7 @@ namespace sqlpp { return operator()(context, t._expr, index); } - static_assert(has_name::value, "select columns have to have a name"); + static_assert(has_name_tag::value, "select columns have to have a name"); return operator()(context, as(sqlpp::nullopt, t._expr), index); } diff --git a/tests/core/types/aggregate_function/avg.cpp b/tests/core/types/aggregate_function/avg.cpp index 2fb69887..165283dc 100644 --- a/tests/core/types/aggregate_function/avg.cpp +++ b/tests/core/types/aggregate_function/avg.cpp @@ -56,8 +56,8 @@ void test_avg(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // avg has a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_avg_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_avg_t::_sqlpp_name_tag>::value, ""); diff --git a/tests/core/types/aggregate_function/count.cpp b/tests/core/types/aggregate_function/count.cpp index 8aff7c02..a42403c5 100644 --- a/tests/core/types/aggregate_function/count.cpp +++ b/tests/core/types/aggregate_function/count.cpp @@ -54,8 +54,8 @@ void test_count(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // count has a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_count_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_count_t::_sqlpp_name_tag>::value, ""); diff --git a/tests/core/types/aggregate_function/max.cpp b/tests/core/types/aggregate_function/max.cpp index fd02b67a..ebe30fd8 100644 --- a/tests/core/types/aggregate_function/max.cpp +++ b/tests/core/types/aggregate_function/max.cpp @@ -56,8 +56,8 @@ void test_max(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // max has a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_max_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_max_t::_sqlpp_name_tag>::value, ""); diff --git a/tests/core/types/aggregate_function/min.cpp b/tests/core/types/aggregate_function/min.cpp index e6e26d5f..fe66d5af 100644 --- a/tests/core/types/aggregate_function/min.cpp +++ b/tests/core/types/aggregate_function/min.cpp @@ -56,8 +56,8 @@ void test_min(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // min has a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_min_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_min_t::_sqlpp_name_tag>::value, ""); diff --git a/tests/core/types/aggregate_function/over.cpp b/tests/core/types/aggregate_function/over.cpp index 617fde60..707cc60a 100644 --- a/tests/core/types/aggregate_function/over.cpp +++ b/tests/core/types/aggregate_function/over.cpp @@ -59,9 +59,9 @@ void test_aggregate_functions(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // Aggregate functions have a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_count_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_min_t::_sqlpp_name_tag>::value, ""); @@ -107,8 +107,8 @@ void test_numeric_aggregate_functions(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // Aggregate functions have a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_sum_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_avg_t::_sqlpp_name_tag>::value, ""); diff --git a/tests/core/types/aggregate_function/sum.cpp b/tests/core/types/aggregate_function/sum.cpp index ad0bb0b9..77b5f647 100644 --- a/tests/core/types/aggregate_function/sum.cpp +++ b/tests/core/types/aggregate_function/sum.cpp @@ -57,8 +57,8 @@ void test_sum(Value v) static_assert(sqlpp::has_enabled_as::value, ""); // sum has a name - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(std::is_same, sqlpp::alias::_sum_t::_sqlpp_name_tag>::value, ""); static_assert(std::is_same, sqlpp::alias::_sum_t::_sqlpp_name_tag>::value, ""); diff --git a/tests/core/types/clause/select_columns.cpp b/tests/core/types/clause/select_columns.cpp index c397bc91..8a320e36 100644 --- a/tests/core/types/clause/select_columns.cpp +++ b/tests/core/types/clause/select_columns.cpp @@ -126,7 +126,7 @@ void test_select_columns() // The columns in group_by determine if aggregates are correct or not. { using T = clause_of_t; - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); static_assert(not sqlpp::has_value_type::value, ""); static_assert(sqlpp::is_result_clause::value, ""); static_assert(sqlpp::has_correct_aggregates::value, ""); @@ -138,7 +138,7 @@ void test_select_columns() // The columns in group_by determine if aggregates are correct or not. { using T = clause_of_t; - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); static_assert(not sqlpp::has_value_type::value, ""); static_assert(sqlpp::is_result_clause::value, ""); static_assert(not sqlpp::has_correct_aggregates::value, ""); diff --git a/tests/core/types/dynamic.cpp b/tests/core/types/dynamic.cpp index 62b9397e..c6fd9001 100644 --- a/tests/core/types/dynamic.cpp +++ b/tests/core/types/dynamic.cpp @@ -54,10 +54,10 @@ void test_dynamic(Value v) static_assert(not sqlpp::has_value_type::value, ""); static_assert(not sqlpp::has_value_type::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); static_assert(is_select_column_value_type::value, ""); static_assert(is_select_column_value_type::value, ""); diff --git a/tests/core/types/operator/assign_expression.cpp b/tests/core/types/operator/assign_expression.cpp index 8288d73d..4a267f11 100644 --- a/tests/core/types/operator/assign_expression.cpp +++ b/tests/core/types/operator/assign_expression.cpp @@ -53,9 +53,9 @@ void test_assign_expression(const Column& col, const Value& v) static_assert(not sqlpp::has_value_type::value, ""); // Assignments have no name - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); // Assignment nodes static_assert(std::is_same, diff --git a/tests/core/types/operator/expression_as.cpp b/tests/core/types/operator/expression_as.cpp index 87b039b6..a9ea2f10 100644 --- a/tests/core/types/operator/expression_as.cpp +++ b/tests/core/types/operator/expression_as.cpp @@ -46,10 +46,10 @@ void test_as_expression(Value v) static_assert(not sqlpp::has_value_type::value, ""); static_assert(not sqlpp::has_value_type::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); static_assert(is_select_column_value_type::value, ""); static_assert(is_select_column_value_type::value, ""); diff --git a/tests/core/types/operator/sort_order_expression.cpp b/tests/core/types/operator/sort_order_expression.cpp index 4786b56a..60e6e258 100644 --- a/tests/core/types/operator/sort_order_expression.cpp +++ b/tests/core/types/operator/sort_order_expression.cpp @@ -52,10 +52,10 @@ void test_as_expression(Value v) static_assert(not sqlpp::has_value_type::value, ""); // Sort order expressions have no name. - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); // Sort order expression do not enable the `as` member function. static_assert(not sqlpp::has_enabled_as::value, ""); diff --git a/tests/core/types/result_row.cpp b/tests/core/types/result_row.cpp index 455687a4..02d56d60 100644 --- a/tests/core/types/result_row.cpp +++ b/tests/core/types/result_row.cpp @@ -124,7 +124,7 @@ int main() static_assert(std::is_same, sqlpp::no_value_t>::value, ""); // as expressions retain the value type of the real thing - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); sqlpp::as(bar.intN, bar.textN); #if 0 diff --git a/tests/core/types/select_as.cpp b/tests/core/types/select_as.cpp index ab91a731..11f742da 100644 --- a/tests/core/types/select_as.cpp +++ b/tests/core/types/select_as.cpp @@ -58,8 +58,8 @@ void test_select_as(Value v) static_assert(is_same_type(), ""); // A select of a single value can be named and used as a named value. - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(is_same_type(), ""); static_assert(is_same_type(), ""); @@ -69,15 +69,15 @@ void test_select_as(Value v) static_assert(sqlpp::is_table::value, ""); // The column of a single-value pseudo table can be used as named value - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(is_same_type(), ""); static_assert(is_same_type(), ""); // The column of a single-value pseudo table can be renamed and used as named value - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); static_assert(sqlpp::select_column_has_name::value, ""); static_assert(sqlpp::select_column_has_name::value, ""); @@ -91,22 +91,22 @@ void test_select_as(Value v) static_assert(not sqlpp::has_value_type::value, ""); // A select of multiple values can be named and used as a named value. - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(not sqlpp::has_value_type::value, ""); // A select of multiple values can be named and used as a pseudo table static_assert(sqlpp::is_table::value, ""); // The column of a multi-value pseudo table can be used as named value - static_assert(sqlpp::has_name::value, ""); - static_assert(sqlpp::has_name::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); + static_assert(sqlpp::has_name_tag::value, ""); static_assert(is_same_type(), ""); static_assert(is_same_type(), ""); // The column of a multi-value pseudo table can be renamed and used as named value - static_assert(not sqlpp::has_name::value, ""); - static_assert(not sqlpp::has_name::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); + static_assert(not sqlpp::has_name_tag::value, ""); static_assert(sqlpp::select_column_has_name::value, ""); static_assert(sqlpp::select_column_has_name::value, "");