From 6c1d59ffc495ec91d3946b028b6dafb3d4b93896 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sun, 14 Jul 2024 13:07:41 +0200 Subject: [PATCH] Remove data type wrappers (with compile failuers) --- include/sqlpp11/aggregate_functions/count.h | 2 +- include/sqlpp11/assignment.h | 71 ---- include/sqlpp11/basic_expression_operators.h | 327 ------------------ include/sqlpp11/case.h | 5 +- include/sqlpp11/column.h | 16 - include/sqlpp11/custom_query.h | 4 +- include/sqlpp11/data_types.h | 38 -- include/sqlpp11/data_types/blob.h | 38 -- .../data_types/blob/column_operators.h | 55 --- include/sqlpp11/data_types/blob/data_type.h | 50 --- .../data_types/blob/expression_operators.h | 68 ---- include/sqlpp11/data_types/blob/operand.h | 80 ----- .../sqlpp11/data_types/blob/parameter_value.h | 50 --- .../sqlpp11/data_types/blob/wrap_operand.h | 49 --- include/sqlpp11/data_types/boolean.h | 34 -- .../data_types/boolean/column_operators.h | 39 --- .../sqlpp11/data_types/boolean/data_type.h | 44 --- .../data_types/boolean/expression_operators.h | 63 ---- include/sqlpp11/data_types/boolean/operand.h | 69 ---- .../data_types/boolean/parameter_value.h | 48 --- .../sqlpp11/data_types/boolean/wrap_operand.h | 40 --- include/sqlpp11/data_types/column_operators.h | 38 -- include/sqlpp11/data_types/day_point.h | 34 -- .../data_types/day_point/column_operators.h | 42 --- .../sqlpp11/data_types/day_point/data_type.h | 47 --- .../day_point/expression_operators.h | 40 --- .../sqlpp11/data_types/day_point/operand.h | 68 ---- .../data_types/day_point/parameter_value.h | 50 --- .../data_types/day_point/wrap_operand.h | 43 --- include/sqlpp11/data_types/floating_point.h | 34 -- .../floating_point/column_operators.h | 78 ----- .../data_types/floating_point/data_type.h | 42 --- .../floating_point/expression_operators.h | 84 ----- .../data_types/floating_point/operand.h | 65 ---- .../floating_point/parameter_value.h | 50 --- .../data_types/floating_point/wrap_operand.h | 41 --- include/sqlpp11/data_types/integral.h | 34 -- .../data_types/integral/column_operators.h | 79 ----- .../sqlpp11/data_types/integral/data_type.h | 47 --- .../integral/expression_operators.h | 148 -------- include/sqlpp11/data_types/integral/operand.h | 107 ------ .../data_types/integral/parameter_value.h | 48 --- .../data_types/integral/wrap_operand.h | 52 --- include/sqlpp11/data_types/no_value.h | 34 -- .../data_types/no_value/column_operators.h | 39 --- .../sqlpp11/data_types/no_value/data_type.h | 41 --- .../no_value/expression_operators.h | 39 --- include/sqlpp11/data_types/no_value/operand.h | 27 -- .../data_types/no_value/parameter_value.h | 27 -- .../data_types/no_value/wrap_operand.h | 27 -- include/sqlpp11/data_types/parameter_value.h | 38 -- .../sqlpp11/data_types/parameter_value_base.h | 91 ----- include/sqlpp11/data_types/text.h | 38 -- .../data_types/text/column_operators.h | 55 --- include/sqlpp11/data_types/text/concat.h | 94 ----- include/sqlpp11/data_types/text/data_type.h | 51 --- .../data_types/text/expression_operators.h | 63 ---- include/sqlpp11/data_types/text/like.h | 89 ----- include/sqlpp11/data_types/text/operand.h | 76 ---- .../sqlpp11/data_types/text/parameter_value.h | 66 ---- .../data_types/text/return_type_like.h | 41 --- .../sqlpp11/data_types/text/wrap_operand.h | 46 --- include/sqlpp11/data_types/time_of_day.h | 34 -- .../data_types/time_of_day/column_operators.h | 42 --- .../data_types/time_of_day/data_type.h | 43 --- .../time_of_day/expression_operators.h | 41 --- .../sqlpp11/data_types/time_of_day/operand.h | 69 ---- .../data_types/time_of_day/parameter_value.h | 50 --- .../data_types/time_of_day/wrap_operand.h | 39 --- include/sqlpp11/data_types/time_point.h | 34 -- .../data_types/time_point/column_operators.h | 42 --- .../sqlpp11/data_types/time_point/data_type.h | 43 --- .../time_point/expression_operators.h | 41 --- .../sqlpp11/data_types/time_point/operand.h | 72 ---- .../data_types/time_point/parameter_value.h | 50 --- .../data_types/time_point/wrap_operand.h | 39 --- .../sqlpp11/data_types/unsigned_integral.h | 34 -- .../unsigned_integral/column_operators.h | 79 ----- .../data_types/unsigned_integral/data_type.h | 47 --- .../unsigned_integral/expression_operators.h | 129 ------- .../data_types/unsigned_integral/operand.h | 67 ---- .../unsigned_integral/parameter_value.h | 48 --- .../unsigned_integral/wrap_operand.h | 43 --- include/sqlpp11/default_value.h | 2 +- include/sqlpp11/functions.h | 1 - include/sqlpp11/insert_value.h | 6 - include/sqlpp11/insert_value_list.h | 2 +- include/sqlpp11/into.h | 1 - include/sqlpp11/noop.h | 1 - include/sqlpp11/null.h | 47 --- include/sqlpp11/operand_check.h | 72 ---- .../sqlpp11/operator/arithmetic_expression.h | 1 + include/sqlpp11/over.h | 4 +- include/sqlpp11/parameter.h | 4 +- include/sqlpp11/parameterized_verbatim.h | 13 +- include/sqlpp11/postgresql/bind_result.h | 1 - .../postgresql/returning_column_list.h | 1 - include/sqlpp11/postgresql/serializer.h | 1 - include/sqlpp11/prepared_execute.h | 2 +- include/sqlpp11/prepared_insert.h | 2 +- include/sqlpp11/prepared_remove.h | 2 +- include/sqlpp11/prepared_select.h | 2 +- include/sqlpp11/prepared_update.h | 2 +- include/sqlpp11/result_row.h | 2 - include/sqlpp11/select_column_list.h | 1 - include/sqlpp11/select_pseudo_table.h | 2 +- include/sqlpp11/single_table.h | 1 - include/sqlpp11/sqlpp11.h | 1 - include/sqlpp11/statement.h | 4 + include/sqlpp11/table.h | 1 - include/sqlpp11/type_traits.h | 35 ++ include/sqlpp11/value_type.h | 3 +- include/sqlpp11/verbatim.h | 8 +- include/sqlpp11/verbatim_table.h | 6 +- include/sqlpp11/with.h | 2 +- include/sqlpp11/wrap_operand.h | 39 --- scripts/ddl2cpp | 8 +- tests/core/usage/MockDb.h | 1 - tests/core/usage/Sample.h | 14 +- 119 files changed, 82 insertions(+), 4742 deletions(-) delete mode 100644 include/sqlpp11/assignment.h delete mode 100644 include/sqlpp11/basic_expression_operators.h delete mode 100644 include/sqlpp11/data_types.h delete mode 100644 include/sqlpp11/data_types/blob.h delete mode 100644 include/sqlpp11/data_types/blob/column_operators.h delete mode 100644 include/sqlpp11/data_types/blob/data_type.h delete mode 100644 include/sqlpp11/data_types/blob/expression_operators.h delete mode 100644 include/sqlpp11/data_types/blob/operand.h delete mode 100644 include/sqlpp11/data_types/blob/parameter_value.h delete mode 100644 include/sqlpp11/data_types/blob/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/boolean.h delete mode 100644 include/sqlpp11/data_types/boolean/column_operators.h delete mode 100644 include/sqlpp11/data_types/boolean/data_type.h delete mode 100644 include/sqlpp11/data_types/boolean/expression_operators.h delete mode 100644 include/sqlpp11/data_types/boolean/operand.h delete mode 100644 include/sqlpp11/data_types/boolean/parameter_value.h delete mode 100644 include/sqlpp11/data_types/boolean/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/column_operators.h delete mode 100644 include/sqlpp11/data_types/day_point.h delete mode 100644 include/sqlpp11/data_types/day_point/column_operators.h delete mode 100644 include/sqlpp11/data_types/day_point/data_type.h delete mode 100644 include/sqlpp11/data_types/day_point/expression_operators.h delete mode 100644 include/sqlpp11/data_types/day_point/operand.h delete mode 100644 include/sqlpp11/data_types/day_point/parameter_value.h delete mode 100644 include/sqlpp11/data_types/day_point/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/floating_point.h delete mode 100644 include/sqlpp11/data_types/floating_point/column_operators.h delete mode 100644 include/sqlpp11/data_types/floating_point/data_type.h delete mode 100644 include/sqlpp11/data_types/floating_point/expression_operators.h delete mode 100644 include/sqlpp11/data_types/floating_point/operand.h delete mode 100644 include/sqlpp11/data_types/floating_point/parameter_value.h delete mode 100644 include/sqlpp11/data_types/floating_point/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/integral.h delete mode 100644 include/sqlpp11/data_types/integral/column_operators.h delete mode 100644 include/sqlpp11/data_types/integral/data_type.h delete mode 100644 include/sqlpp11/data_types/integral/expression_operators.h delete mode 100644 include/sqlpp11/data_types/integral/operand.h delete mode 100644 include/sqlpp11/data_types/integral/parameter_value.h delete mode 100644 include/sqlpp11/data_types/integral/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/no_value.h delete mode 100644 include/sqlpp11/data_types/no_value/column_operators.h delete mode 100644 include/sqlpp11/data_types/no_value/data_type.h delete mode 100644 include/sqlpp11/data_types/no_value/expression_operators.h delete mode 100644 include/sqlpp11/data_types/no_value/operand.h delete mode 100644 include/sqlpp11/data_types/no_value/parameter_value.h delete mode 100644 include/sqlpp11/data_types/no_value/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/parameter_value.h delete mode 100644 include/sqlpp11/data_types/parameter_value_base.h delete mode 100644 include/sqlpp11/data_types/text.h delete mode 100644 include/sqlpp11/data_types/text/column_operators.h delete mode 100644 include/sqlpp11/data_types/text/concat.h delete mode 100644 include/sqlpp11/data_types/text/data_type.h delete mode 100644 include/sqlpp11/data_types/text/expression_operators.h delete mode 100644 include/sqlpp11/data_types/text/like.h delete mode 100644 include/sqlpp11/data_types/text/operand.h delete mode 100644 include/sqlpp11/data_types/text/parameter_value.h delete mode 100644 include/sqlpp11/data_types/text/return_type_like.h delete mode 100644 include/sqlpp11/data_types/text/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/time_of_day.h delete mode 100644 include/sqlpp11/data_types/time_of_day/column_operators.h delete mode 100644 include/sqlpp11/data_types/time_of_day/data_type.h delete mode 100644 include/sqlpp11/data_types/time_of_day/expression_operators.h delete mode 100644 include/sqlpp11/data_types/time_of_day/operand.h delete mode 100644 include/sqlpp11/data_types/time_of_day/parameter_value.h delete mode 100644 include/sqlpp11/data_types/time_of_day/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/time_point.h delete mode 100644 include/sqlpp11/data_types/time_point/column_operators.h delete mode 100644 include/sqlpp11/data_types/time_point/data_type.h delete mode 100644 include/sqlpp11/data_types/time_point/expression_operators.h delete mode 100644 include/sqlpp11/data_types/time_point/operand.h delete mode 100644 include/sqlpp11/data_types/time_point/parameter_value.h delete mode 100644 include/sqlpp11/data_types/time_point/wrap_operand.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral/column_operators.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral/data_type.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral/expression_operators.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral/operand.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral/parameter_value.h delete mode 100644 include/sqlpp11/data_types/unsigned_integral/wrap_operand.h delete mode 100644 include/sqlpp11/null.h delete mode 100644 include/sqlpp11/operand_check.h delete mode 100644 include/sqlpp11/wrap_operand.h diff --git a/include/sqlpp11/aggregate_functions/count.h b/include/sqlpp11/aggregate_functions/count.h index 421e8b9f..8f93c514 100644 --- a/include/sqlpp11/aggregate_functions/count.h +++ b/include/sqlpp11/aggregate_functions/count.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include namespace sqlpp { diff --git a/include/sqlpp11/assignment.h b/include/sqlpp11/assignment.h deleted file mode 100644 index 929523e1..00000000 --- a/include/sqlpp11/assignment.h +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once - -/* - * Copyright (c) 2013-2015, Roland Bock - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include - -namespace sqlpp -{ - template - struct assignment_t - { - using _traits = make_traits; - using _lhs_t = Lhs; - using _rhs_t = Rhs; - using _nodes = detail::type_vector<_lhs_t, _rhs_t>; - -#warning: We check this in the factory function - static_assert(can_be_null<_lhs_t>::value ? true - : not std::is_same<_rhs_t, null_t>::value, - "column must not be null"); - - assignment_t(_lhs_t lhs, _rhs_t rhs) : _lhs(lhs), _rhs(rhs) - { - } - - assignment_t(const assignment_t&) = default; - assignment_t(assignment_t&&) = default; - assignment_t& operator=(const assignment_t&) = default; - assignment_t& operator=(assignment_t&&) = default; - ~assignment_t() = default; - - _lhs_t _lhs; - _rhs_t _rhs; - }; - - template - Context& serialize(const assignment_t& t, Context& context) - { - serialize(simple_column(t._lhs), context); - context << "="; - serialize_operand(t._rhs, context); - return context; - } -} // namespace sqlpp diff --git a/include/sqlpp11/basic_expression_operators.h b/include/sqlpp11/basic_expression_operators.h deleted file mode 100644 index c4522c84..00000000 --- a/include/sqlpp11/basic_expression_operators.h +++ /dev/null @@ -1,327 +0,0 @@ -#pragma once - -/* - * Copyright (c) 2013-2016, Roland Bock - * Copyright (c) 2016, Aaron Bishop - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace sqlpp -{ - SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_rhs_is_expression_t, "rhs operand in comparison is not an expression"); - SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_rhs_is_valid_operand_t, "invalid rhs operand in comparison"); - SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_lhs_rhs_differ_t, "identical lhs and rhs operands in comparison"); - - template - using check_comparison_impl = static_combined_check_t< - static_check_t::value, is_multi_expression_t::value>::value, - assert_comparison_rhs_is_expression_t>, - static_check_t::template _is_valid_operand::value, - assert_comparison_rhs_is_valid_operand_t>, - static_check_t::value, assert_comparison_lhs_rhs_differ_t>>; - - template - using check_comparison_t = check_comparison_impl>; - - template - using check_in_impl = static_combined_check_t< - static_check_t::value...>::value, assert_comparison_rhs_is_expression_t>, - static_check_t::template _is_valid_operand::value...>::value, - assert_comparison_rhs_is_valid_operand_t>, - static_check_t::value...>::value, - assert_comparison_lhs_rhs_differ_t>>; - - template - using check_in_t = check_in_impl::type...>; - - namespace detail - { - template class Expr, typename Lhs, typename Rhs> - struct comparison_expression_impl - { - using type = bad_expression; - }; - - template