From f3bd2f01aba0235b4ce3d6cd74b4308aed4fc762 Mon Sep 17 00:00:00 2001 From: rbock Date: Wed, 16 Mar 2016 18:26:51 +0100 Subject: [PATCH] Removed the add_ntc functions (use without_table_check) --- include/sqlpp11/group_by.h | 10 ++-------- include/sqlpp11/having.h | 8 +------- include/sqlpp11/insert_value_list.h | 8 +------- include/sqlpp11/order_by.h | 10 ++-------- include/sqlpp11/select_column_list.h | 10 ++-------- include/sqlpp11/select_flag_list.h | 10 ++-------- include/sqlpp11/update_list.h | 10 ++-------- include/sqlpp11/where.h | 8 +------- 8 files changed, 13 insertions(+), 61 deletions(-) diff --git a/include/sqlpp11/group_by.h b/include/sqlpp11/group_by.h index e707144a..fa969b56 100644 --- a/include/sqlpp11/group_by.h +++ b/include/sqlpp11/group_by.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2016, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -85,17 +85,11 @@ namespace sqlpp } template - void add_ntc(Expression expression) - { - add(expression); - } - - template void add(Expression expression) { static_assert(_is_dynamic::value, "add() must not be called for static group_by"); static_assert(is_expression_t::value, "invalid expression argument in group_by::add()"); - static_assert(TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "expression uses tables unknown to this statement in group_by::add()"); using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); diff --git a/include/sqlpp11/having.h b/include/sqlpp11/having.h index 534cf291..8939acd1 100644 --- a/include/sqlpp11/having.h +++ b/include/sqlpp11/having.h @@ -82,17 +82,11 @@ namespace sqlpp } template - void add_ntc(Expr expression) - { - add(expression); - } - - template void add(Expr expression) { static_assert(_is_dynamic::value, "having::add() can only be called for dynamic_having"); static_assert(is_expression_t::value, "invalid expression argument in having::add()"); - static_assert(not TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "expression uses tables unknown to this statement in having::add()"); using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); diff --git a/include/sqlpp11/insert_value_list.h b/include/sqlpp11/insert_value_list.h index 2e68e33c..0dab1c9a 100644 --- a/include/sqlpp11/insert_value_list.h +++ b/include/sqlpp11/insert_value_list.h @@ -252,12 +252,6 @@ namespace sqlpp } template - void add_ntc(Assignment assignment) - { - add(assignment); - } - - template void add(Assignment assignment) { static_assert(_is_dynamic::value, "add must not be called for static from()"); @@ -266,7 +260,7 @@ namespace sqlpp static_assert(not detail::is_element_of, _assigned_columns>::value, "Must not assign value to column twice"); static_assert(not must_not_insert_t>::value, "add() argument must not be used in insert"); - static_assert(not TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "add() contains a column from a foreign table"); using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); diff --git a/include/sqlpp11/order_by.h b/include/sqlpp11/order_by.h index 0445d90f..53d9c87f 100644 --- a/include/sqlpp11/order_by.h +++ b/include/sqlpp11/order_by.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2016, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -82,17 +82,11 @@ namespace sqlpp } template - void add_ntc(Expression expression) - { - add(expression); - } - - template void add(Expression expression) { static_assert(_is_dynamic::value, "add() must not be called for static order_by"); static_assert(is_sort_order_t::value, "invalid expression argument in order_by::add()"); - static_assert(TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "expression uses tables unknown to this statement in order_by::add()"); using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index c82f0f90..cf0da031 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2016, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -123,19 +123,13 @@ namespace sqlpp } template - void add_ntc(NamedExpression namedExpression) - { - add(namedExpression); - } - - template void add(NamedExpression namedExpression) { using named_expression = auto_alias_t; static_assert(_is_dynamic::value, "selected_columns::add() can only be called for dynamic_column"); static_assert(is_selectable_t::value, "invalid named expression argument in selected_columns::add()"); - static_assert(TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "named expression uses tables unknown to this statement in selected_columns::add()"); using column_names = detail::make_type_set_t; static_assert(not detail::is_element_of::value, diff --git a/include/sqlpp11/select_flag_list.h b/include/sqlpp11/select_flag_list.h index 91704ca0..e8d0bd02 100644 --- a/include/sqlpp11/select_flag_list.h +++ b/include/sqlpp11/select_flag_list.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2016, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -78,17 +78,11 @@ namespace sqlpp } template - void add_ntc(Flag flag) - { - add(flag); - } - - template void add(Flag flag) { static_assert(_is_dynamic::value, "select_flags::add() must not be called for static select flags"); static_assert(is_select_flag_t::value, "invalid select flag argument in select_flags::add()"); - static_assert(TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "flag uses tables unknown to this statement in select_flags::add()"); using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); diff --git a/include/sqlpp11/update_list.h b/include/sqlpp11/update_list.h index e48a742b..ab4af1b0 100644 --- a/include/sqlpp11/update_list.h +++ b/include/sqlpp11/update_list.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2016, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -78,12 +78,6 @@ namespace sqlpp } template - void add_ntc(Assignment assignment) - { - add(assignment); - } - - template void add(Assignment assignment) { static_assert(_is_dynamic::value, "add must not be called for static from()"); @@ -92,7 +86,7 @@ namespace sqlpp static_assert(not detail::is_element_of, _assigned_columns>::value, "Must not assign value to column twice"); static_assert(logic::not_t>::value, "add() argument must not be updated"); - static_assert(TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "assignment uses tables unknown to this statement in add()"); using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); diff --git a/include/sqlpp11/where.h b/include/sqlpp11/where.h index 3a8f1d39..b7f1626d 100644 --- a/include/sqlpp11/where.h +++ b/include/sqlpp11/where.h @@ -84,18 +84,12 @@ namespace sqlpp } template - void add_ntc(Expr expression) - { - add(expression); - } - - template void add(Expr expression) { static_assert(_is_dynamic::value, "where::add() can only be called for dynamic_where"); static_assert(is_expression_t::value, "invalid expression argument in where::add()"); static_assert(is_boolean_t::value, "invalid expression argument in where::add()"); - static_assert(not TableCheckRequired::value or Policies::template _no_unknown_tables::value, + static_assert(Policies::template _no_unknown_tables::value, "expression uses tables unknown to this statement in where::add()"); static_assert(not contains_aggregate_function_t::value, "where expression must not contain aggregate functions");