From bcc085f819d6222665307545553e73a4df3ece92 Mon Sep 17 00:00:00 2001 From: rbock Date: Tue, 5 May 2015 08:18:39 +0200 Subject: [PATCH 001/122] Cleaned up concat_t and added concat method --- include/sqlpp11/concat.h | 43 ++++++++++++++++++++++--------------- include/sqlpp11/functions.h | 1 + include/sqlpp11/text.h | 5 ++++- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/include/sqlpp11/concat.h b/include/sqlpp11/concat.h index bc0ac76b..d93cdf52 100644 --- a/include/sqlpp11/concat.h +++ b/include/sqlpp11/concat.h @@ -35,17 +35,16 @@ namespace sqlpp { - // FIXME: Remove First, inherit from text_t - template - struct concat_t: - public expression_operators, value_type_of>, - public alias_operators> - { - using _traits = make_traits, tag::is_expression, tag::is_selectable>; - using _nodes = detail::type_vector; + struct text; + + template + struct concat_t: + public expression_operators, text>, + public alias_operators> + { + using _traits = make_traits; + using _nodes = detail::type_vector; - static_assert(sizeof...(Args) > 0, "concat requires two arguments at least"); - static_assert(logic::all_t::value, is_text_t::value...>::value, "at least one non-text argument detected in concat()"); struct _alias_t { static constexpr const char _literal[] = "concat_"; @@ -57,8 +56,8 @@ namespace sqlpp }; }; - concat_t(First first, Args... args): - _args(first, args...) + concat_t(Args... args): + _args(args...) {} concat_t(const concat_t&) = default; @@ -67,14 +66,14 @@ namespace sqlpp concat_t& operator=(concat_t&&) = default; ~concat_t() = default; - std::tuple _args; + std::tuple _args; }; - template - struct serializer_t> + template + struct serializer_t> { - using _serialize_check = serialize_check_of; - using T = concat_t; + using _serialize_check = serialize_check_of; + using T = concat_t; static Context& _(const T& t, Context& context) { @@ -84,6 +83,16 @@ namespace sqlpp return context; } }; + + template + auto concat(Args... args) + -> concat_t + { + static_assert(sizeof...(Args) >= 2, "concat requires two arguments at least"); + static_assert(logic::all_t>::value...>::value, "at least one non-text argument detected in concat()"); + + return {args...}; + } } #endif diff --git a/include/sqlpp11/functions.h b/include/sqlpp11/functions.h index 46776612..bc935e51 100644 --- a/include/sqlpp11/functions.h +++ b/include/sqlpp11/functions.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/include/sqlpp11/text.h b/include/sqlpp11/text.h index 6bc388b1..adb5f6ca 100644 --- a/include/sqlpp11/text.h +++ b/include/sqlpp11/text.h @@ -27,15 +27,18 @@ #ifndef SQLPP_TEXT_H #define SQLPP_TEXT_H +#include #include #include #include -#include #include #include namespace sqlpp { + template + struct concat_t; + // text value type struct text { From 7b750bbe974ece578441ab3fe1474bee04108532 Mon Sep 17 00:00:00 2001 From: rbock Date: Wed, 13 May 2015 07:58:43 +0200 Subject: [PATCH 002/122] Added usage examples for count and exists --- tests/FunctionTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/FunctionTest.cpp b/tests/FunctionTest.cpp index 891e16d8..8d694c83 100644 --- a/tests/FunctionTest.cpp +++ b/tests/FunctionTest.cpp @@ -195,6 +195,8 @@ int main() static_assert(sqlpp::is_boolean_t::value, "type requirement"); static_assert(not sqlpp::is_numeric_t::value, "type requirement"); static_assert(not sqlpp::is_text_t::value, "type requirement"); + + if (db(select(exists(select(t.alpha).from(t).where(true)))).front().exists) { /* do something */ } } @@ -281,6 +283,8 @@ int main() static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); + + if (db(select(count(t.alpha)).from(t).where(true)).front().count) { /* do something */ } } // Test max From 0e86a5a6667ede6a1eec4f8deaf22ee40e549bf4 Mon Sep 17 00:00:00 2001 From: niXman Date: Tue, 19 May 2015 10:38:34 +0300 Subject: [PATCH 003/122] suppress the warns about the unused vars --- include/sqlpp11/column.h | 2 +- include/sqlpp11/detail/pick_arg.h | 4 ++-- include/sqlpp11/insert.h | 2 +- include/sqlpp11/insert_value_list.h | 2 +- include/sqlpp11/interpretable_list.h | 2 +- include/sqlpp11/no_data.h | 2 +- include/sqlpp11/select.h | 2 +- include/sqlpp11/select_column_list.h | 2 +- include/sqlpp11/simple_column.h | 2 +- include/sqlpp11/table.h | 2 +- include/sqlpp11/update.h | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sqlpp11/column.h b/include/sqlpp11/column.h index bb0dd740..fdf23431 100644 --- a/include/sqlpp11/column.h +++ b/include/sqlpp11/column.h @@ -112,7 +112,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = column_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << name_of::char_ptr() << '.' << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/detail/pick_arg.h b/include/sqlpp11/detail/pick_arg.h index 12a7a9c6..ac74b2eb 100644 --- a/include/sqlpp11/detail/pick_arg.h +++ b/include/sqlpp11/detail/pick_arg.h @@ -34,13 +34,13 @@ namespace sqlpp namespace detail { template - typename Target::_data_t pick_arg_impl(Statement statement, Term term, const std::true_type&) + typename Target::_data_t pick_arg_impl(Statement /* statement */, Term term, const std::true_type&) { return term; } template - typename Target::_data_t pick_arg_impl(Statement statement, Term term, const std::false_type&) + typename Target::_data_t pick_arg_impl(Statement statement, Term /* term */, const std::false_type&) { return Target::_get_member(statement)._data; } diff --git a/include/sqlpp11/insert.h b/include/sqlpp11/insert.h index e639be61..84d13ed5 100644 --- a/include/sqlpp11/insert.h +++ b/include/sqlpp11/insert.h @@ -93,7 +93,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = insert_name_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << "INSERT "; diff --git a/include/sqlpp11/insert_value_list.h b/include/sqlpp11/insert_value_list.h index de3b560c..cbbedc05 100644 --- a/include/sqlpp11/insert_value_list.h +++ b/include/sqlpp11/insert_value_list.h @@ -445,7 +445,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = insert_default_values_data_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << " DEFAULT VALUES"; return context; diff --git a/include/sqlpp11/interpretable_list.h b/include/sqlpp11/interpretable_list.h index 8a5d1ea2..5b42fe8d 100644 --- a/include/sqlpp11/interpretable_list.h +++ b/include/sqlpp11/interpretable_list.h @@ -98,7 +98,7 @@ namespace sqlpp using T = interpretable_list_t; template - static Context& _(const T& t, const Separator& separator, Context& context) + static Context& _(const T& /* t */, const Separator& /* separator */, Context& context) { return context; } diff --git a/include/sqlpp11/no_data.h b/include/sqlpp11/no_data.h index f90f4377..1fa836c6 100644 --- a/include/sqlpp11/no_data.h +++ b/include/sqlpp11/no_data.h @@ -40,7 +40,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = no_data_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { return context; } diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index 6fe57fd1..129accf1 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -60,7 +60,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = select_name_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << "SELECT "; diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index 0a5b5e74..b89be478 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -119,7 +119,7 @@ namespace sqlpp { using T = dynamic_select_column_list; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { return context; } diff --git a/include/sqlpp11/simple_column.h b/include/sqlpp11/simple_column.h index c5442a61..b2bc8fc9 100644 --- a/include/sqlpp11/simple_column.h +++ b/include/sqlpp11/simple_column.h @@ -48,7 +48,7 @@ namespace sqlpp using _serialize_check = serialize_check_of; using T = simple_column_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/table.h b/include/sqlpp11/table.h index 9c19da4b..bf8ed275 100644 --- a/include/sqlpp11/table.h +++ b/include/sqlpp11/table.h @@ -105,7 +105,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = X; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/update.h b/include/sqlpp11/update.h index 1f3019f9..7bb998c0 100644 --- a/include/sqlpp11/update.h +++ b/include/sqlpp11/update.h @@ -94,7 +94,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = update_name_t; - static Context& _(const T& t, Context& context) + static Context& _(const T& /* t */, Context& context) { context << "UPDATE "; From 07b5ae33c4761ebf136b978e122a35e12b67dd51 Mon Sep 17 00:00:00 2001 From: niXman Date: Tue, 19 May 2015 16:44:23 +0300 Subject: [PATCH 004/122] fixes & changes to ppgen --- examples/ppgen.cpp | 12 ++++---- include/sqlpp11/ppgen.h | 29 ++++++++++--------- include/sqlpp11/ppgen/colops/auto_increment.h | 2 +- include/sqlpp11/ppgen/colops/blob.h | 8 ++--- include/sqlpp11/ppgen/colops/bool.h | 2 +- include/sqlpp11/ppgen/colops/comment.h | 2 +- include/sqlpp11/ppgen/colops/default.h | 2 +- include/sqlpp11/ppgen/colops/floating_point.h | 4 +-- .../ppgen/colops/{unique.h => foreign_key.h} | 14 ++++----- include/sqlpp11/ppgen/colops/index.h | 4 +-- include/sqlpp11/ppgen/colops/integer.h | 8 ++--- include/sqlpp11/ppgen/colops/not_null.h | 2 +- include/sqlpp11/ppgen/colops/null.h | 2 +- include/sqlpp11/ppgen/colops/primary_key.h | 2 +- include/sqlpp11/ppgen/colops/text.h | 2 +- .../ppgen/colops/{key.h => unique_index.h} | 14 ++++----- include/sqlpp11/ppgen/colops/varchar.h | 2 +- include/sqlpp11/ppgen/tblops/character_set.h | 2 +- include/sqlpp11/ppgen/tblops/comment.h | 2 +- include/sqlpp11/ppgen/tblops/default.h | 2 +- include/sqlpp11/ppgen/tblops/engine.h | 2 +- 21 files changed, 60 insertions(+), 59 deletions(-) rename include/sqlpp11/ppgen/colops/{unique.h => foreign_key.h} (79%) rename include/sqlpp11/ppgen/colops/{key.h => unique_index.h} (79%) diff --git a/examples/ppgen.cpp b/examples/ppgen.cpp index 58b43222..d865f4e8 100644 --- a/examples/ppgen.cpp +++ b/examples/ppgen.cpp @@ -48,17 +48,17 @@ SQLPP_DECLARE_TABLE( SQLPP_DECLARE_TABLE( (tab_person) , - (id , int , SQLPP_AUTO_INCREMENT) - (name , varchar(255), SQLPP_NOT_NULL ) - (feature, int , SQLPP_NOT_NULL ) + (id , int , SQLPP_PRIMARY_KEY) + (name , varchar(255), SQLPP_NOT_NULL ) + (feature, int , SQLPP_NOT_NULL ) ) SQLPP_DECLARE_TABLE( (tab_feature) , - (id , int , SQLPP_AUTO_INCREMENT) - (name , varchar(255), SQLPP_NULL ) - (fatal, bool , SQLPP_NOT_NULL ) + (id , int , SQLPP_PRIMARY_KEY) + (name , varchar(255), SQLPP_NULL ) + (fatal, bool , SQLPP_NOT_NULL ) ) int main() diff --git a/include/sqlpp11/ppgen.h b/include/sqlpp11/ppgen.h index 50141bc1..0e950bc6 100644 --- a/include/sqlpp11/ppgen.h +++ b/include/sqlpp11/ppgen.h @@ -35,6 +35,19 @@ # define BOOST_PP_VARIADICS 1 #endif // defined(__clang__) +// boost.preprocessor +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + // tools #include #include @@ -51,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -58,22 +72,9 @@ #include #include #include -#include +#include #include -// boost.preprocessor -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - /***************************************************************************/ // tools diff --git a/include/sqlpp11/ppgen/colops/auto_increment.h b/include/sqlpp11/ppgen/colops/auto_increment.h index 7f88a5ec..1e7ae2bc 100644 --- a/include/sqlpp11/ppgen/colops/auto_increment.h +++ b/include/sqlpp11/ppgen/colops/auto_increment.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_AUTO_INCREMENT \ PROC_SQLPP_AUTO_INCREMENT #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_AUTO_INCREMENT(...) \ - sqlpp::tag::must_not_update + ::sqlpp::tag::must_not_update #endif // _sqlpp__ppgen__colops__auto_increment_h diff --git a/include/sqlpp11/ppgen/colops/blob.h b/include/sqlpp11/ppgen/colops/blob.h index 26c124e6..f387cbbe 100644 --- a/include/sqlpp11/ppgen/colops/blob.h +++ b/include/sqlpp11/ppgen/colops/blob.h @@ -30,21 +30,21 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob \ PROC_tinyblob #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyblob(...) \ - sqlpp::blob + ::sqlpp::blob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_blob \ PROC_blob #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_blob(...) \ - sqlpp::blob + ::sqlpp::blob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_mediumblob \ PROC_mediumblob #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_mediumblob(...) \ - sqlpp::blob + ::sqlpp::blob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_longblob \ PROC_longblob #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_longblob(...) \ - sqlpp::blob + ::sqlpp::blob #endif // _sqlpp__ppgen__colops__blob_h diff --git a/include/sqlpp11/ppgen/colops/bool.h b/include/sqlpp11/ppgen/colops/bool.h index 08521bd3..a3db1f92 100644 --- a/include/sqlpp11/ppgen/colops/bool.h +++ b/include/sqlpp11/ppgen/colops/bool.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool \ PROC_bool #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) \ - sqlpp::boolean + ::sqlpp::boolean #endif // _sqlpp__ppgen__colops__bool_h diff --git a/include/sqlpp11/ppgen/colops/comment.h b/include/sqlpp11/ppgen/colops/comment.h index f019b732..d0757d73 100644 --- a/include/sqlpp11/ppgen/colops/comment.h +++ b/include/sqlpp11/ppgen/colops/comment.h @@ -27,7 +27,7 @@ #ifndef _sqlpp__ppgen__colops__comment_h #define _sqlpp__ppgen__colops__comment_h -#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT(str) \ +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT \ PROC_SQLPP_COMMENT #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ [COMMENT is not implemented] diff --git a/include/sqlpp11/ppgen/colops/default.h b/include/sqlpp11/ppgen/colops/default.h index b7fbdeeb..b353651f 100644 --- a/include/sqlpp11/ppgen/colops/default.h +++ b/include/sqlpp11/ppgen/colops/default.h @@ -27,7 +27,7 @@ #ifndef _sqlpp__ppgen__colops__default_h #define _sqlpp__ppgen__colops__default_h -#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT(value) \ +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT \ PROC_SQLPP_DEFAULT #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ [DEFAULT is not implemented] diff --git a/include/sqlpp11/ppgen/colops/floating_point.h b/include/sqlpp11/ppgen/colops/floating_point.h index ea25560c..6b1dd018 100644 --- a/include/sqlpp11/ppgen/colops/floating_point.h +++ b/include/sqlpp11/ppgen/colops/floating_point.h @@ -30,11 +30,11 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float \ PROC_float #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_float(...) \ - sqlpp::floating_point + ::sqlpp::floating_point #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_double \ PROC_double #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_double(...) \ - sqlpp::floating_point + ::sqlpp::floating_point #endif // _sqlpp__ppgen__colops__floating_point_h diff --git a/include/sqlpp11/ppgen/colops/unique.h b/include/sqlpp11/ppgen/colops/foreign_key.h similarity index 79% rename from include/sqlpp11/ppgen/colops/unique.h rename to include/sqlpp11/ppgen/colops/foreign_key.h index 34b43792..33147fe8 100644 --- a/include/sqlpp11/ppgen/colops/unique.h +++ b/include/sqlpp11/ppgen/colops/foreign_key.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__colops__unique_h -#define _sqlpp__ppgen__colops__unique_h +#ifndef _sqlpp__ppgen__colops__foreign_key_h +#define _sqlpp__ppgen__colops__foreign_key_h -#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_UNIQUE \ - PROC_SQLPP_UNIQUE -#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_UNIQUE(...) \ - [UNIQUE is not implemented] +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_FOREIGN_KEY \ + PROC_SQLPP_FOREIGN_KEY +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_FOREIGN_KEY(keyname, tblname, colname) \ + [FOREIGN KEY is not implemented] -#endif // _sqlpp__ppgen__colops__unique_h +#endif // _sqlpp__ppgen__colops__foreign_key_h diff --git a/include/sqlpp11/ppgen/colops/index.h b/include/sqlpp11/ppgen/colops/index.h index 37a1fee1..a5344f43 100644 --- a/include/sqlpp11/ppgen/colops/index.h +++ b/include/sqlpp11/ppgen/colops/index.h @@ -27,9 +27,9 @@ #ifndef _sqlpp__ppgen__colops__index_h #define _sqlpp__ppgen__colops__index_h -#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX(name) \ +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX \ PROC_SQLPP_INDEX -#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(name) \ +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(indexname, tblname, /* cols */ ...) \ [INDEX is not implemented] #endif // _sqlpp__ppgen__colops__index_h diff --git a/include/sqlpp11/ppgen/colops/integer.h b/include/sqlpp11/ppgen/colops/integer.h index d913e441..e79a9860 100644 --- a/include/sqlpp11/ppgen/colops/integer.h +++ b/include/sqlpp11/ppgen/colops/integer.h @@ -30,21 +30,21 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyint \ PROC_tinyint #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyint(...) \ - sqlpp::tinyint + ::sqlpp::tinyint #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_smallint \ PROC_smallint #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_smallint(...) \ - sqlpp::smallint + ::sqlpp::smallint #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_int \ PROC_int #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_int(...) \ - sqlpp::integer + ::sqlpp::integer #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bigint \ PROC_bigint #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bigint(...) \ - sqlpp::bigint + ::sqlpp::bigint #endif // _sqlpp__ppgen__colops__integer_h diff --git a/include/sqlpp11/ppgen/colops/not_null.h b/include/sqlpp11/ppgen/colops/not_null.h index 0a2b029e..7a3059b0 100644 --- a/include/sqlpp11/ppgen/colops/not_null.h +++ b/include/sqlpp11/ppgen/colops/not_null.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL \ PROC_SQLPP_NOT_NULL #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) \ - sqlpp::tag::require_insert + ::sqlpp::tag::require_insert #endif // _sqlpp__ppgen__colops__not_null_h diff --git a/include/sqlpp11/ppgen/colops/null.h b/include/sqlpp11/ppgen/colops/null.h index bd7d33d6..dcb8aef2 100644 --- a/include/sqlpp11/ppgen/colops/null.h +++ b/include/sqlpp11/ppgen/colops/null.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL \ PROC_SQLPP_NULL #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) \ - sqlpp::tag::can_be_null + ::sqlpp::tag::can_be_null #endif // _sqlpp__ppgen__colops__null_h diff --git a/include/sqlpp11/ppgen/colops/primary_key.h b/include/sqlpp11/ppgen/colops/primary_key.h index 916f752b..ec356a7c 100644 --- a/include/sqlpp11/ppgen/colops/primary_key.h +++ b/include/sqlpp11/ppgen/colops/primary_key.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_PRIMARY_KEY \ PROC_SQLPP_PRIMARY_KEY #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_PRIMARY_KEY(...) \ - [PRIMARY_KEY is not implemented] + ::sqlpp::tag::must_not_insert, ::sqlpp::tag::must_not_update #endif // _sqlpp__ppgen__colops__primary_key_h diff --git a/include/sqlpp11/ppgen/colops/text.h b/include/sqlpp11/ppgen/colops/text.h index 7329a986..5278ea01 100644 --- a/include/sqlpp11/ppgen/colops/text.h +++ b/include/sqlpp11/ppgen/colops/text.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text \ PROC_text #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) \ - sqlpp::text + ::sqlpp::text #endif // _sqlpp__ppgen__colops__text_h diff --git a/include/sqlpp11/ppgen/colops/key.h b/include/sqlpp11/ppgen/colops/unique_index.h similarity index 79% rename from include/sqlpp11/ppgen/colops/key.h rename to include/sqlpp11/ppgen/colops/unique_index.h index 1791c30c..3a64e521 100644 --- a/include/sqlpp11/ppgen/colops/key.h +++ b/include/sqlpp11/ppgen/colops/unique_index.h @@ -24,12 +24,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _sqlpp__ppgen__colops__key_h -#define _sqlpp__ppgen__colops__key_h +#ifndef _sqlpp__ppgen__colops__unique_index_h +#define _sqlpp__ppgen__colops__unique_index_h -#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_KEY(name) \ - PROC_SQLPP_KEY -#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_KEY(name) \ - [KEY is not implemented] +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_UNIQUE_INDEX \ + PROC_SQLPP_UNIQUE_INDEX +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_UNIQUE_INDEX(indexname, tblname, /* cols */ ...) \ + [UNIQUE INDEX is not implemented] -#endif // _sqlpp__ppgen__colops__key_h +#endif // _sqlpp__ppgen__colops__unique_index_h diff --git a/include/sqlpp11/ppgen/colops/varchar.h b/include/sqlpp11/ppgen/colops/varchar.h index c4de3235..d5944a70 100644 --- a/include/sqlpp11/ppgen/colops/varchar.h +++ b/include/sqlpp11/ppgen/colops/varchar.h @@ -30,6 +30,6 @@ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_varchar(str) \ PROC_varchar #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(str) \ - sqlpp::varchar + ::sqlpp::varchar #endif // _sqlpp__ppgen__colops__varchar_h diff --git a/include/sqlpp11/ppgen/tblops/character_set.h b/include/sqlpp11/ppgen/tblops/character_set.h index 8b5026b2..b9f35ae4 100644 --- a/include/sqlpp11/ppgen/tblops/character_set.h +++ b/include/sqlpp11/ppgen/tblops/character_set.h @@ -27,7 +27,7 @@ #ifndef _sqlpp__ppgen__tblops__character_set_h #define _sqlpp__ppgen__tblops__character_set_h -#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET(str) \ +#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET \ PROC_SQLPP_CHARACTER_SET #define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) \ [CHARACTER_SET is not implemented] diff --git a/include/sqlpp11/ppgen/tblops/comment.h b/include/sqlpp11/ppgen/tblops/comment.h index 6df2784b..b55c3f64 100644 --- a/include/sqlpp11/ppgen/tblops/comment.h +++ b/include/sqlpp11/ppgen/tblops/comment.h @@ -27,7 +27,7 @@ #ifndef _sqlpp__ppgen__tblops__comment_h #define _sqlpp__ppgen__tblops__comment_h -#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_COMMENT(str) \ +#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_COMMENT \ PROC_SQLPP_COMMENT #define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ [COMMENT is not implemented] diff --git a/include/sqlpp11/ppgen/tblops/default.h b/include/sqlpp11/ppgen/tblops/default.h index 7e70bf8f..d9f4d56b 100644 --- a/include/sqlpp11/ppgen/tblops/default.h +++ b/include/sqlpp11/ppgen/tblops/default.h @@ -27,7 +27,7 @@ #ifndef _sqlpp__ppgen__tblops__default_h #define _sqlpp__ppgen__tblops__default_h -#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_DEFAULT(value) \ +#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_DEFAULT \ PROC_SQLPP_DEFAULT #define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ [DEFAULT is not implemented] diff --git a/include/sqlpp11/ppgen/tblops/engine.h b/include/sqlpp11/ppgen/tblops/engine.h index 24b2e8aa..38892dea 100644 --- a/include/sqlpp11/ppgen/tblops/engine.h +++ b/include/sqlpp11/ppgen/tblops/engine.h @@ -27,7 +27,7 @@ #ifndef _sqlpp__ppgen__tblops__engine_h #define _sqlpp__ppgen__tblops__engine_h -#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE(str) \ +#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE \ PROC_SQLPP_ENGINE #define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) \ [ENGINE is not implemented] From 7efce45f7d5b8e9d7989dff637219fe8435aa09c Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 17:52:34 +0200 Subject: [PATCH 005/122] update .travis.yml --- .travis.yml | 51 +++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24420177..e19ad40a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,39 +2,42 @@ language: cpp os: - linux + - osx compiler: - # - clang # disabled clang due to missing libc++ + - clang - gcc +env: + - CONFIG=Release + - CONFIG=Debug + notifications: email: on_success: change on_failure: always -before_install: - # install boost 1.50 (headers only), travis currently offers 1.46 and 1.48 - - wget http://sourceforge.net/projects/boost/files/boost/1.50.0/boost_1_50_0.tar.bz2/download -O /tmp/boost.tar.bz2 - - mkdir -p temp - - cd temp - - tar jxf /tmp/boost.tar.bz2 boost_1_50_0/boost # extract headers only - - sudo mkdir -p /usr/local/include/ - - sudo ln -s $PWD/boost_1_50_0/boost /usr/local/include - - cd .. - #install g++-4.8 - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - - sudo apt-get update - - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8; fi - - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - install: - - "mkdir -p $TRAVIS_BUILD_DIR/build/scripts" - - "cd $TRAVIS_BUILD_DIR/build/scripts" - - "cmake $TRAVIS_BUILD_DIR" + - CMAKE_VERSION_MM=3.2 + - CMAKE_VERSION_FULL=$CMAKE_VERSION_MM.2 + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + && sudo add-apt-repository -y ppa:apokluda/boost1.53 + && sudo apt-get update -qq + && sudo apt-get install -qq g++-4.8 libboost1.53-dev --no-install-recommends + && sudo update-alternatives --quiet --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.6 + && sudo update-alternatives --quiet --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.8 + && sudo update-alternatives --quiet --set gcc /usr/bin/gcc-4.8 + && wget http://www.cmake.org/files/v${CMAKE_VERSION_MM}/cmake-${CMAKE_VERSION_FULL}-Linux-x86_64.sh + && sudo sh cmake-${CMAKE_VERSION_FULL}-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; + fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install boost cmake; fi + +before_script: + - mkdir build + - cd build + - cmake .. -DCMAKE_BUILD_TYPE=$CONFIG script: - - "cd $TRAVIS_BUILD_DIR/build/scripts" - - "make -j3" - # test compile-time constraints - - "make test_sqlpp_constraints" - + - cmake --build . --config $CONFIG + - ctest --output-on-failure From 30a3a6b2ff1bb2cad4b3556855add5b0a0875831 Mon Sep 17 00:00:00 2001 From: rbock Date: Fri, 29 May 2015 20:06:21 +0200 Subject: [PATCH 006/122] Replaced char[] with char[] to please MSVC 2015 --- include/sqlpp11/alias_provider.h | 2 +- scripts/ddl2cpp | 4 ++-- tests/Sample.h | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sqlpp11/alias_provider.h b/include/sqlpp11/alias_provider.h index 86dba643..fafc875e 100644 --- a/include/sqlpp11/alias_provider.h +++ b/include/sqlpp11/alias_provider.h @@ -35,7 +35,7 @@ {\ struct _alias_t\ {\ - static constexpr const char _literal[] = #name;\ + static constexpr const char _literal[sizeof(#name)] = #name;\ using _name_t = sqlpp::make_char_sequence;\ template\ struct _member_t\ diff --git a/scripts/ddl2cpp b/scripts/ddl2cpp index 80e0063b..e71047a4 100755 --- a/scripts/ddl2cpp +++ b/scripts/ddl2cpp @@ -146,7 +146,7 @@ for tableCreation in tableCreations: print(' {', file=header) print(' struct _alias_t', file=header) print(' {', file=header) - print(' static constexpr const char _literal[] = "' + sqlColumnName + '";', file=header) + print(' static constexpr const char _literal[' + str(len(sqlColumnName) + 1) + '] = "' + sqlColumnName + '";', file=header) print(' using _name_t = sqlpp::make_char_sequence;', file=header) print(' template', file=header) print(' struct _member_t', file=header) @@ -178,7 +178,7 @@ for tableCreation in tableCreations: print(' {', file=header) print(' struct _alias_t', file=header) print(' {', file=header) - print(' static constexpr const char _literal[] = "' + sqlTableName + '";', file=header) + print(' static constexpr const char _literal[' + str(len(sqlTableName) + 1) + '] = "' + sqlTableName + '";', file=header) print(' using _name_t = sqlpp::make_char_sequence;', file=header) print(' template', file=header) print(' struct _member_t', file=header) diff --git a/tests/Sample.h b/tests/Sample.h index 2fa909e5..fe87589c 100644 --- a/tests/Sample.h +++ b/tests/Sample.h @@ -13,7 +13,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "delta"; + static constexpr const char _literal[6] = "delta"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -29,7 +29,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "epsilon"; + static constexpr const char _literal[8] = "epsilon"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -45,7 +45,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "omega"; + static constexpr const char _literal[6] = "omega"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -66,7 +66,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "tab_foo"; + static constexpr const char _literal[8] = "tab_foo"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -83,7 +83,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "alpha"; + static constexpr const char _literal[6] = "alpha"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -99,7 +99,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "beta"; + static constexpr const char _literal[5] = "beta"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -115,7 +115,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "gamma"; + static constexpr const char _literal[6] = "gamma"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -131,7 +131,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "delta"; + static constexpr const char _literal[6] = "delta"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -153,7 +153,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "tab_bar"; + static constexpr const char _literal[8] = "tab_bar"; using _name_t = sqlpp::make_char_sequence; template struct _member_t From 5692a71c38a330b0a87280962da1de8e37fb8e13 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 20:27:38 +0200 Subject: [PATCH 007/122] don't tell clang which standard library to use --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f5266c2..f9384b48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ enable_testing() message(STATUS "Using ${CMAKE_CXX_COMPILER} (compiler id: ${CMAKE_CXX_COMPILER_ID})") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-std=c++11 -Wall ${CMAKE_CXX_FLAGS}") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_CXX_FLAGS "-std=c++11 -Wall ${CMAKE_CXX_FLAGS}") endif () From 036d63e6cfb1138d78df471e8926a428842bdb93 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 20:40:38 +0200 Subject: [PATCH 008/122] drop suffix 'Test' from tests --- ...pressionTest.cpp => BooleanExpression.cpp} | 0 tests/CMakeLists.txt | 26 +++++++++---------- .../{CustomQueryTest.cpp => CustomQuery.cpp} | 0 tests/{FunctionTest.cpp => Function.cpp} | 0 tests/{InsertTest.cpp => Insert.cpp} | 0 tests/{InterpretTest.cpp => Interpret.cpp} | 0 tests/{PreparedTest.cpp => Prepared.cpp} | 0 tests/{RemoveTest.cpp => Remove.cpp} | 0 tests/{ResultTest.cpp => Result.cpp} | 0 tests/{SelectTest.cpp => Select.cpp} | 0 tests/{SelectTypeTest.cpp => SelectType.cpp} | 0 tests/{UnionTest.cpp => Union.cpp} | 0 tests/{UpdateTest.cpp => Update.cpp} | 0 tests/{WithTest.cpp => With.cpp} | 0 14 files changed, 13 insertions(+), 13 deletions(-) rename tests/{BooleanExpressionTest.cpp => BooleanExpression.cpp} (100%) rename tests/{CustomQueryTest.cpp => CustomQuery.cpp} (100%) rename tests/{FunctionTest.cpp => Function.cpp} (100%) rename tests/{InsertTest.cpp => Insert.cpp} (100%) rename tests/{InterpretTest.cpp => Interpret.cpp} (100%) rename tests/{PreparedTest.cpp => Prepared.cpp} (100%) rename tests/{RemoveTest.cpp => Remove.cpp} (100%) rename tests/{ResultTest.cpp => Result.cpp} (100%) rename tests/{SelectTest.cpp => Select.cpp} (100%) rename tests/{SelectTypeTest.cpp => SelectType.cpp} (100%) rename tests/{UnionTest.cpp => Union.cpp} (100%) rename tests/{UpdateTest.cpp => Update.cpp} (100%) rename tests/{WithTest.cpp => With.cpp} (100%) diff --git a/tests/BooleanExpressionTest.cpp b/tests/BooleanExpression.cpp similarity index 100% rename from tests/BooleanExpressionTest.cpp rename to tests/BooleanExpression.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4461ce0d..eab34265 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,20 +6,20 @@ macro (build_and_run arg) add_test("${arg}" "${CMAKE_BINARY_DIR}/tests/${arg}") endmacro () -build_and_run(BooleanExpressionTest) -build_and_run(CustomQueryTest) -build_and_run(InterpretTest) -build_and_run(InsertTest) -build_and_run(RemoveTest) -build_and_run(UpdateTest) -build_and_run(SelectTest) -build_and_run(SelectTypeTest) -build_and_run(FunctionTest) -build_and_run(PreparedTest) +build_and_run(BooleanExpression) +build_and_run(CustomQuery) +build_and_run(Interpret) +build_and_run(Insert) +build_and_run(Remove) +build_and_run(Update) +build_and_run(Select) +build_and_run(SelectType) +build_and_run(Function) +build_and_run(Prepared) build_and_run(Minimalistic) -build_and_run(ResultTest) -build_and_run(UnionTest) -build_and_run(WithTest) +build_and_run(Result) +build_and_run(Union) +build_and_run(With) # if you want to use the generator, you can do something like this: #find_package(PythonInterp REQUIRED) diff --git a/tests/CustomQueryTest.cpp b/tests/CustomQuery.cpp similarity index 100% rename from tests/CustomQueryTest.cpp rename to tests/CustomQuery.cpp diff --git a/tests/FunctionTest.cpp b/tests/Function.cpp similarity index 100% rename from tests/FunctionTest.cpp rename to tests/Function.cpp diff --git a/tests/InsertTest.cpp b/tests/Insert.cpp similarity index 100% rename from tests/InsertTest.cpp rename to tests/Insert.cpp diff --git a/tests/InterpretTest.cpp b/tests/Interpret.cpp similarity index 100% rename from tests/InterpretTest.cpp rename to tests/Interpret.cpp diff --git a/tests/PreparedTest.cpp b/tests/Prepared.cpp similarity index 100% rename from tests/PreparedTest.cpp rename to tests/Prepared.cpp diff --git a/tests/RemoveTest.cpp b/tests/Remove.cpp similarity index 100% rename from tests/RemoveTest.cpp rename to tests/Remove.cpp diff --git a/tests/ResultTest.cpp b/tests/Result.cpp similarity index 100% rename from tests/ResultTest.cpp rename to tests/Result.cpp diff --git a/tests/SelectTest.cpp b/tests/Select.cpp similarity index 100% rename from tests/SelectTest.cpp rename to tests/Select.cpp diff --git a/tests/SelectTypeTest.cpp b/tests/SelectType.cpp similarity index 100% rename from tests/SelectTypeTest.cpp rename to tests/SelectType.cpp diff --git a/tests/UnionTest.cpp b/tests/Union.cpp similarity index 100% rename from tests/UnionTest.cpp rename to tests/Union.cpp diff --git a/tests/UpdateTest.cpp b/tests/Update.cpp similarity index 100% rename from tests/UpdateTest.cpp rename to tests/Update.cpp diff --git a/tests/WithTest.cpp b/tests/With.cpp similarity index 100% rename from tests/WithTest.cpp rename to tests/With.cpp From b99e2f653b3268908f357653f80ec7128c699dc8 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 21:15:26 +0200 Subject: [PATCH 009/122] build a combined executable for all tests --- tests/BooleanExpression.cpp | 2 +- tests/CMakeLists.txt | 67 ++++++++++++++++++++++++++----------- tests/CustomQuery.cpp | 2 +- tests/Function.cpp | 2 +- tests/Insert.cpp | 2 +- tests/Interpret.cpp | 2 +- tests/Minimalistic.cpp | 3 +- tests/Prepared.cpp | 2 +- tests/Remove.cpp | 2 +- tests/Result.cpp | 2 +- tests/Select.cpp | 2 +- tests/SelectType.cpp | 2 +- tests/Union.cpp | 2 +- tests/Update.cpp | 2 +- tests/With.cpp | 2 +- 15 files changed, 62 insertions(+), 34 deletions(-) diff --git a/tests/BooleanExpression.cpp b/tests/BooleanExpression.cpp index c8b5c20e..5f55d2e3 100644 --- a/tests/BooleanExpression.cpp +++ b/tests/BooleanExpression.cpp @@ -29,7 +29,7 @@ #include -int main() +int BooleanExpression(int, char**) { MockDb db = {}; test::TabBar t; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index eab34265..d6a594a4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,25 +1,52 @@ +# 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. -macro (build_and_run arg) - # Add headers to sources to enable file browsing in IDEs - include_directories("${CMAKE_BINARY_DIR}/tests") - add_executable("${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_LIST_DIR}/Sample.h") - add_test("${arg}" "${CMAKE_BINARY_DIR}/tests/${arg}") -endmacro () +set(test_names + BooleanExpression + CustomQuery + Interpret + Insert + Remove + Update + Select + SelectType + Function + Prepared + Minimalistic + Result + Union + With + ) -build_and_run(BooleanExpression) -build_and_run(CustomQuery) -build_and_run(Interpret) -build_and_run(Insert) -build_and_run(Remove) -build_and_run(Update) -build_and_run(Select) -build_and_run(SelectType) -build_and_run(Function) -build_and_run(Prepared) -build_and_run(Minimalistic) -build_and_run(Result) -build_and_run(Union) -build_and_run(With) +create_test_sourcelist(test_sources test_main.cpp ${test_names}) +add_executable(sqlpp11_tests ${test_sources}) + +foreach(test IN LISTS test_names) + add_test(NAME sqlpp11.tests.${test} + COMMAND sqlpp11_tests ${test} + ) +endforeach() # if you want to use the generator, you can do something like this: #find_package(PythonInterp REQUIRED) diff --git a/tests/CustomQuery.cpp b/tests/CustomQuery.cpp index 73ef6b77..f8781145 100644 --- a/tests/CustomQuery.cpp +++ b/tests/CustomQuery.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int CustomQuery(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/Function.cpp b/tests/Function.cpp index 891e16d8..4d1b2679 100644 --- a/tests/Function.cpp +++ b/tests/Function.cpp @@ -34,7 +34,7 @@ SQLPP_ALIAS_PROVIDER(kaesekuchen) -int main() +int Function(int, char**) { MockDb db = {}; test::TabFoo f; diff --git a/tests/Insert.cpp b/tests/Insert.cpp index 5f7e849a..76dafa4b 100644 --- a/tests/Insert.cpp +++ b/tests/Insert.cpp @@ -31,7 +31,7 @@ #include -int main() +int Insert(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/Interpret.cpp b/tests/Interpret.cpp index 715e2822..d2a597f6 100644 --- a/tests/Interpret.cpp +++ b/tests/Interpret.cpp @@ -29,7 +29,7 @@ #include -int main() +int Interpret(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/Minimalistic.cpp b/tests/Minimalistic.cpp index c30384c0..78b086a5 100644 --- a/tests/Minimalistic.cpp +++ b/tests/Minimalistic.cpp @@ -1,5 +1,6 @@ #include -int main() +int Minimalistic(int, char**) { + return 0; } diff --git a/tests/Prepared.cpp b/tests/Prepared.cpp index 4e391a53..af5eadfd 100644 --- a/tests/Prepared.cpp +++ b/tests/Prepared.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int Prepared(int, char**) { MockDb db = {}; //test::TabFoo f; diff --git a/tests/Remove.cpp b/tests/Remove.cpp index 4fe220d9..e8092462 100644 --- a/tests/Remove.cpp +++ b/tests/Remove.cpp @@ -30,7 +30,7 @@ #include "is_regular.h" -int main() +int Remove(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/Result.cpp b/tests/Result.cpp index daa918df..3bee2429 100644 --- a/tests/Result.cpp +++ b/tests/Result.cpp @@ -32,7 +32,7 @@ static_assert(not sqlpp::enforce_null_result_treatment_t::value, "MockDb interprets NULL as trivial"); static_assert(sqlpp::enforce_null_result_treatment_t::value, "MockDb does not interpret NULL as trivial"); -int main() +int Result(int, char**) { MockDb db = {}; EnforceDb edb {}; diff --git a/tests/Select.cpp b/tests/Select.cpp index 8d82c1b2..460a85b3 100644 --- a/tests/Select.cpp +++ b/tests/Select.cpp @@ -43,7 +43,7 @@ int64_t getColumn(Db&& db, const Column& column) return 0; } -int main() +int Select(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/SelectType.cpp b/tests/SelectType.cpp index 67b3f689..4afc20b7 100644 --- a/tests/SelectType.cpp +++ b/tests/SelectType.cpp @@ -41,7 +41,7 @@ namespace alias SQLPP_ALIAS_PROVIDER(right) } -int main() +int SelectType(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/Union.cpp b/tests/Union.cpp index 4a3d54ad..caa7f9ff 100644 --- a/tests/Union.cpp +++ b/tests/Union.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int Union(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/Update.cpp b/tests/Update.cpp index 4cc7f455..da93415a 100644 --- a/tests/Update.cpp +++ b/tests/Update.cpp @@ -29,7 +29,7 @@ #include "MockDb.h" #include "is_regular.h" -int main() +int Update(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/With.cpp b/tests/With.cpp index cde6b262..5c251293 100644 --- a/tests/With.cpp +++ b/tests/With.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int With(int, char**) { MockDb db; MockDb::_serializer_context_t printer; From ec20a8a627a9e56fce6091f75bbde94c2a5b7697 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 21:31:32 +0200 Subject: [PATCH 010/122] build examples to a single, combined executable --- examples/CMakeLists.txt | 54 +++++++++++++++++++++++++++++++---------- examples/insert.cpp | 3 ++- examples/ppgen.cpp | 3 ++- examples/remove.cpp | 3 ++- examples/select.cpp | 3 ++- examples/update.cpp | 3 ++- 6 files changed, 51 insertions(+), 18 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 33b8e65f..589a0b52 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,23 +1,51 @@ +# 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. -macro (build arg) - # Add headers to sources to enable file browsing in IDEs - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../tests") - add_executable("Sqlpp11Example${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_SOURCE_DIR}/../tests/MockDb.h" "${CMAKE_CURRENT_LIST_DIR}/Sample.h") - add_test("${arg}" "Sqlpp11Example${arg}") -endmacro () +include_directories(../tests) + +set(example_names + #sample + insert + update + remove + select + ) -#build(sample) -build(insert) -build(update) -build(remove) -build(select) find_package(Boost 1.50) if(Boost_FOUND) - MESSAGE(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) - build(ppgen) + list(APPEND example_names ppgen) endif() +create_test_sourcelist(example_sources example_main.cpp ${example_names}) +add_executable(sqlpp11_examples ${example_sources}) + +foreach(example IN LISTS example_names) + add_test(NAME sqlpp11.examples.${example} + COMMAND sqlpp11_examples ${example} + ) +endforeach() #find_package(PythonInterp REQUIRED) diff --git a/examples/insert.cpp b/examples/insert.cpp index 2cf32f68..6aa85f9c 100644 --- a/examples/insert.cpp +++ b/examples/insert.cpp @@ -27,7 +27,7 @@ #include "MockDb.h" #include -int main() +int insert(int, char**) { MockDb db; @@ -64,4 +64,5 @@ int main() pi.params.feature = true; db(pi); + return 0; } diff --git a/examples/ppgen.cpp b/examples/ppgen.cpp index d865f4e8..48ca5610 100644 --- a/examples/ppgen.cpp +++ b/examples/ppgen.cpp @@ -61,7 +61,7 @@ SQLPP_DECLARE_TABLE( (fatal, bool , SQLPP_NOT_NULL ) ) -int main() +int ppgen(int, char**) { MockDb db; tab_person::tab_person p; @@ -97,4 +97,5 @@ int main() pi.params.feature = true; db(pi); + return 0; } diff --git a/examples/remove.cpp b/examples/remove.cpp index 8bec39c3..3788e7e8 100644 --- a/examples/remove.cpp +++ b/examples/remove.cpp @@ -27,7 +27,7 @@ #include "MockDb.h" #include -int main() +int remove(int, char**) { MockDb db; @@ -37,4 +37,5 @@ int main() db(remove_from(p) .using_(p, q) .where(p.feature == q.id and q.fatal == true)); + return 0; } diff --git a/examples/select.cpp b/examples/select.cpp index 10d756bb..8607f7a1 100644 --- a/examples/select.cpp +++ b/examples/select.cpp @@ -36,7 +36,7 @@ SQLPP_ALIAS_PROVIDER(cheesecake) -int main() +int select(int, char**) { static constexpr bool some_condition = true; static constexpr bool some_other_condition = false; @@ -153,4 +153,5 @@ int main() + return 0; } diff --git a/examples/update.cpp b/examples/update.cpp index e9bad556..ed3de0a2 100644 --- a/examples/update.cpp +++ b/examples/update.cpp @@ -27,7 +27,7 @@ #include "MockDb.h" #include -int main() +int update(int, char**) { MockDb db; @@ -35,4 +35,5 @@ int main() //test::TabFeature q; db(update(p).set(p.feature = 7).where(p.id == 23)); + return 0; } From b8a93a8aa3eb3a10de6a06b2138fcf5d4814ac45 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 21:39:03 +0200 Subject: [PATCH 011/122] add constraint tests as test cases --- test_constraints/CMakeLists.txt | 58 +++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/test_constraints/CMakeLists.txt b/test_constraints/CMakeLists.txt index 20e699d9..9f388e28 100644 --- a/test_constraints/CMakeLists.txt +++ b/test_constraints/CMakeLists.txt @@ -1,31 +1,41 @@ -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../tests") +# 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. -add_custom_target(test_sqlpp_constraints COMMAND true) +include_directories(../tests) function(test_constraint name pattern) + set(test sqlpp11.test_constraints.${name}) + set(target sqlpp11_${name}) + add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp) + add_test(NAME ${test} + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target} + ) + set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern}) +endfunction() - add_executable( - "${name}" - EXCLUDE_FROM_ALL - "${name}.cpp" - ) - - add_custom_command(OUTPUT "${name}.out" - COMMAND "${CMAKE_MAKE_PROGRAM}" "${name}" > "${CMAKE_CURRENT_BINARY_DIR}/${name}.out" 2>&1 || true - COMMAND grep "${pattern}" "${CMAKE_CURRENT_BINARY_DIR}/${name}.out" > /dev/null - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp" - COMMENT "${name}" - VERBATIM) - - add_custom_target("test_${name}" DEPENDS "${name}.out" COMMAND true) - - - add_dependencies(test_sqlpp_constraints "test_${name}") - -endfunction(test_constraint) - -test_constraint(count_of_count "count() cannot be used on an aggregate function") -test_constraint(max_of_max "max() cannot be used on an aggregate function") +test_constraint(count_of_count "count\\(\\) cannot be used on an aggregate function") +test_constraint(max_of_max "max\\(\\) cannot be used on an aggregate function") test_constraint(no_conversion_operator_if_null_not_trivial "int i = row.alpha") test_constraint(require_insert "required column is missing") test_constraint(must_not_insert "one assignment is prohibited") From b0453ffb1c228e7050cc5111da37fbcd8719bf0c Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 22:10:04 +0200 Subject: [PATCH 012/122] make use of usage requirements --- CMakeLists.txt | 26 +++++++++++--------------- examples/CMakeLists.txt | 3 +-- test_constraints/CMakeLists.txt | 3 +-- tests/CMakeLists.txt | 5 +++++ 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9384b48..5ceae772 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,25 +22,21 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +project(sqlpp11 VERSION 0.1 LANGUAGES CXX) -# Cygwin does not define WIN32 and warn if not use with this flag -set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required - -project (sqlpp11) enable_testing() -message(STATUS "Using ${CMAKE_CXX_COMPILER} (compiler id: ${CMAKE_CXX_COMPILER_ID})") -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "-std=c++11 -Wall ${CMAKE_CXX_FLAGS}") -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "-std=c++11 -Wall ${CMAKE_CXX_FLAGS}") -endif () -set(CMAKE_CXX_FLAGS "-Wconversion -Wpedantic -Wshadow ${CMAKE_CXX_FLAGS}") +add_library(sqlpp11 INTERFACE) + +target_include_directories(sqlpp11 INTERFACE + $ + ) + +target_compile_features(sqlpp11 INTERFACE + cxx_variadic_templates + ) -set(include_dir "${PROJECT_SOURCE_DIR}/include") -file(GLOB_RECURSE sqlpp_headers "${include_dir}/*.h") -include_directories("${include_dir}") add_subdirectory(tests) add_subdirectory(test_constraints) add_subdirectory(examples) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 589a0b52..3f6e46b5 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -22,8 +22,6 @@ # (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_directories(../tests) - set(example_names #sample insert @@ -40,6 +38,7 @@ endif() create_test_sourcelist(example_sources example_main.cpp ${example_names}) add_executable(sqlpp11_examples ${example_sources}) +target_link_libraries(sqlpp11_examples PRIVATE sqlpp11 sqlpp11_testing) foreach(example IN LISTS example_names) add_test(NAME sqlpp11.examples.${example} diff --git a/test_constraints/CMakeLists.txt b/test_constraints/CMakeLists.txt index 9f388e28..87e7d197 100644 --- a/test_constraints/CMakeLists.txt +++ b/test_constraints/CMakeLists.txt @@ -22,12 +22,11 @@ # (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_directories(../tests) - function(test_constraint name pattern) set(test sqlpp11.test_constraints.${name}) set(target sqlpp11_${name}) add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp) + target_link_libraries(${target} PRIVATE sqlpp11 sqlpp11_testing) add_test(NAME ${test} COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target} ) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d6a594a4..669b2b9f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,6 +22,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +add_library(sqlpp11_testing INTERFACE) +target_include_directories(sqlpp11_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic) + set(test_names BooleanExpression CustomQuery @@ -41,6 +45,7 @@ set(test_names create_test_sourcelist(test_sources test_main.cpp ${test_names}) add_executable(sqlpp11_tests ${test_sources}) +target_link_libraries(sqlpp11_tests PRIVATE sqlpp11 sqlpp11_testing) foreach(test IN LISTS test_names) add_test(NAME sqlpp11.tests.${test} From dcff4c2036a4d5bf2a8357b8a04ef6f8f7cf39aa Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 23:16:50 +0200 Subject: [PATCH 013/122] add coveralls coverage reporting --- .travis.yml | 4 ++++ coveralls | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 coveralls diff --git a/.travis.yml b/.travis.yml index e19ad40a..4b221096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,8 +36,12 @@ install: before_script: - mkdir build - cd build + - if [[ "$CXX" = "g++" && "$CONFIG" = "Debug" ]]; then export CXXFLAGS="--coverage"; fi - cmake .. -DCMAKE_BUILD_TYPE=$CONFIG script: - cmake --build . --config $CONFIG - ctest --output-on-failure + +after_script: + - ../coveralls diff --git a/coveralls b/coveralls new file mode 100755 index 00000000..301d67f7 --- /dev/null +++ b/coveralls @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ 0 -eq $(find -iname *.gcda | wc -l) ] +then + exit 0 +fi + +gcov --source-prefix ${TRAVIS_BUILD_DIR} --preserve-paths --relative-only $(find -iname *.gcda) 1>/dev/null || exit 0 + +cat >coverage.json <>coverage.json <coverage.json <(head -n -1 coverage.json.tmp) <(echo -e " }\n ]\n}") +curl -F json_file=@coverage.json https://coveralls.io/api/v1/jobs From ee76176f7617eb5f6e823e067f838b0f1abedd11 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 23:39:19 +0200 Subject: [PATCH 014/122] add status badges to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7e3020ed..57411d8f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ sqlpp11 ======= +[![Build Status](https://travis-ci.org/purpleKarrot/sqlpp11.svg?branch=develop)](https://travis-ci.org/purpleKarrot/sqlpp11) +[![Coverage Status](https://coveralls.io/repos/purpleKarrot/sqlpp11/badge.svg?branch=develop)](https://coveralls.io/r/purpleKarrot/sqlpp11?branch=develop) + A type safe embedded domain specific language for SQL queries and results in C++ Extensive documentation is found in the wiki, https://github.com/rbock/sqlpp11/wiki From 13d48c7204844b548dc411e4f488104bb4fb5564 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 29 May 2015 23:40:02 +0200 Subject: [PATCH 015/122] shamelessly adding myself to CREDITS --- CREDITS | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CREDITS b/CREDITS index 3675cef0..fdfc9b58 100644 --- a/CREDITS +++ b/CREDITS @@ -3,14 +3,15 @@ Credits: This library evolved through several stages and would probably not exist without input from other people: * Michael Gmelin: Interface and requirements discussions - * Paul Körbitz: Feedback and extensions - * Peter Knoblach: Initial ideas - * Ulrich Küttler: Feedback and extensions + * Paul Körbitz: Feedback and extensions + * Peter Knoblach: Initial ideas + * Ulrich Küttler: Feedback and extensions + * Daniel Pfeifer: Buildsystem, Travis, Coveralls - * Metafeed GmbH: Production code using a forerunner version - * PPRO Financial Ltd: Production code using sqlpp11 and a forerunner version - * The boost community: Invaluable suggestions and critiques + * Metafeed GmbH: Production code using a forerunner version + * PPRO Financial Ltd: Production code using sqlpp11 and a forerunner version + * The boost community: Invaluable suggestions and critiques * Meeting C++ Munich: Hosted the first talk about sqlpp11 From 8d356f55ce00ce4dd1842ee63de037cae7b3734c Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 30 May 2015 16:19:23 +0200 Subject: [PATCH 016/122] Fixed warnings about unused parameters --- include/sqlpp11/all_of.h | 4 ++-- include/sqlpp11/column.h | 2 +- include/sqlpp11/cte.h | 4 ++-- include/sqlpp11/default_value.h | 2 +- include/sqlpp11/extra_tables.h | 2 +- include/sqlpp11/hidden.h | 2 +- include/sqlpp11/insert.h | 2 +- include/sqlpp11/insert_value_list.h | 2 +- include/sqlpp11/interpretable_list.h | 2 +- include/sqlpp11/interpreter.h | 2 +- include/sqlpp11/multi_column.h | 2 +- include/sqlpp11/no_data.h | 2 +- include/sqlpp11/noop.h | 2 +- include/sqlpp11/null.h | 2 +- include/sqlpp11/parameter.h | 2 +- include/sqlpp11/remove.h | 2 +- include/sqlpp11/select.h | 2 +- include/sqlpp11/select_column_list.h | 2 +- include/sqlpp11/serializer.h | 2 +- include/sqlpp11/simple_column.h | 2 +- include/sqlpp11/table.h | 2 +- include/sqlpp11/tvin.h | 2 +- include/sqlpp11/update.h | 2 +- tests/MockDb.h | 10 +++++----- 24 files changed, 30 insertions(+), 30 deletions(-) diff --git a/include/sqlpp11/all_of.h b/include/sqlpp11/all_of.h index 55e2c206..999344d3 100644 --- a/include/sqlpp11/all_of.h +++ b/include/sqlpp11/all_of.h @@ -46,7 +46,7 @@ namespace sqlpp }; template - auto all_of(Table t) -> all_of_t + auto all_of(Table) -> all_of_t
{ return {}; } @@ -68,7 +68,7 @@ namespace sqlpp using _serialize_check = assert_no_stand_alone_all_of_t; using T = all_of_t
; - static Context& _(const T& t, const Context&) + static Context& _(const T&, const Context&) { _serialize_check::_(); } diff --git a/include/sqlpp11/column.h b/include/sqlpp11/column.h index fdf23431..de7b23b3 100644 --- a/include/sqlpp11/column.h +++ b/include/sqlpp11/column.h @@ -112,7 +112,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = column_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << name_of::char_ptr() << '.' << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/cte.h b/include/sqlpp11/cte.h index 85105317..51adff9a 100644 --- a/include/sqlpp11/cte.h +++ b/include/sqlpp11/cte.h @@ -87,7 +87,7 @@ namespace sqlpp struct cte_ref_t; template - auto from_table(cte_t t) -> cte_ref_t + auto from_table(cte_t) -> cte_ref_t { return cte_ref_t{}; } @@ -242,7 +242,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = cte_ref_t; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context& context) { context << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/default_value.h b/include/sqlpp11/default_value.h index 1a71442a..27494531 100644 --- a/include/sqlpp11/default_value.h +++ b/include/sqlpp11/default_value.h @@ -45,7 +45,7 @@ namespace sqlpp using _serialize_check = consistent_t; using Operand = default_value_t; - static Context& _(const Operand& t, Context& context) + static Context& _(const Operand&, Context& context) { context << "DEFAULT"; return context; diff --git a/include/sqlpp11/extra_tables.h b/include/sqlpp11/extra_tables.h index 3a60e5f6..785964b1 100644 --- a/include/sqlpp11/extra_tables.h +++ b/include/sqlpp11/extra_tables.h @@ -164,7 +164,7 @@ namespace sqlpp using _serialize_check = serialize_check_of; using T = extra_tables_data_t; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context& context) { return context; } diff --git a/include/sqlpp11/hidden.h b/include/sqlpp11/hidden.h index 313ae6b8..94cc66ae 100644 --- a/include/sqlpp11/hidden.h +++ b/include/sqlpp11/hidden.h @@ -50,7 +50,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = hidden_t; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context& context) { return context; } diff --git a/include/sqlpp11/insert.h b/include/sqlpp11/insert.h index 84d13ed5..7b578c7f 100644 --- a/include/sqlpp11/insert.h +++ b/include/sqlpp11/insert.h @@ -93,7 +93,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = insert_name_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << "INSERT "; diff --git a/include/sqlpp11/insert_value_list.h b/include/sqlpp11/insert_value_list.h index cbbedc05..bf060902 100644 --- a/include/sqlpp11/insert_value_list.h +++ b/include/sqlpp11/insert_value_list.h @@ -445,7 +445,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = insert_default_values_data_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << " DEFAULT VALUES"; return context; diff --git a/include/sqlpp11/interpretable_list.h b/include/sqlpp11/interpretable_list.h index 5b42fe8d..face27b9 100644 --- a/include/sqlpp11/interpretable_list.h +++ b/include/sqlpp11/interpretable_list.h @@ -98,7 +98,7 @@ namespace sqlpp using T = interpretable_list_t; template - static Context& _(const T& /* t */, const Separator& /* separator */, Context& context) + static Context& _(const T&, const Separator& /* separator */, Context& context) { return context; } diff --git a/include/sqlpp11/interpreter.h b/include/sqlpp11/interpreter.h index 2560bd17..ace659c5 100644 --- a/include/sqlpp11/interpreter.h +++ b/include/sqlpp11/interpreter.h @@ -34,7 +34,7 @@ namespace sqlpp template struct interpreter_t { - static void _(const T& t, Context& context) + static void _(const T&, Context&) { static_assert(wrong_t::value, "missing interpreter specialization"); } diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index 8147d3c2..7e55cc97 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -106,7 +106,7 @@ namespace sqlpp using _serialize_check = serialize_check_of; using T = multi_column_t; - static void _(const T& t, Context& context) + static void _(const T&, Context&) { static_assert(wrong_t::value, "multi_column must be used with an alias"); } diff --git a/include/sqlpp11/no_data.h b/include/sqlpp11/no_data.h index 1fa836c6..629e7705 100644 --- a/include/sqlpp11/no_data.h +++ b/include/sqlpp11/no_data.h @@ -40,7 +40,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = no_data_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { return context; } diff --git a/include/sqlpp11/noop.h b/include/sqlpp11/noop.h index 0c4c0f57..83e91cc1 100644 --- a/include/sqlpp11/noop.h +++ b/include/sqlpp11/noop.h @@ -87,7 +87,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = noop; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context& context) { return context; } diff --git a/include/sqlpp11/null.h b/include/sqlpp11/null.h index 9b01b69e..3331897f 100644 --- a/include/sqlpp11/null.h +++ b/include/sqlpp11/null.h @@ -43,7 +43,7 @@ namespace sqlpp using _serialize_check = consistent_t; using Operand = null_t; - static Context& _(const Operand& t, Context& context) + static Context& _(const Operand&, Context& context) { context << "NULL"; return context; diff --git a/include/sqlpp11/parameter.h b/include/sqlpp11/parameter.h index 13447233..87e4ae9b 100644 --- a/include/sqlpp11/parameter.h +++ b/include/sqlpp11/parameter.h @@ -61,7 +61,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = parameter_t; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context& context) { context << "?"; return context; diff --git a/include/sqlpp11/remove.h b/include/sqlpp11/remove.h index bb43da68..67e472ee 100644 --- a/include/sqlpp11/remove.h +++ b/include/sqlpp11/remove.h @@ -94,7 +94,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = remove_name_t; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context& context) { context << "DELETE"; diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index 129accf1..de351fd5 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -60,7 +60,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = select_name_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << "SELECT "; diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index b89be478..3437f078 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -119,7 +119,7 @@ namespace sqlpp { using T = dynamic_select_column_list; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { return context; } diff --git a/include/sqlpp11/serializer.h b/include/sqlpp11/serializer.h index 61974558..2fc59570 100644 --- a/include/sqlpp11/serializer.h +++ b/include/sqlpp11/serializer.h @@ -47,7 +47,7 @@ namespace sqlpp { using _serialize_check = assert_serializer_specialization_t; - static void _(const T& t, Context& context) + static void _(const T&, Context&) { _serialize_check::_(); } diff --git a/include/sqlpp11/simple_column.h b/include/sqlpp11/simple_column.h index b2bc8fc9..c1beef53 100644 --- a/include/sqlpp11/simple_column.h +++ b/include/sqlpp11/simple_column.h @@ -48,7 +48,7 @@ namespace sqlpp using _serialize_check = serialize_check_of; using T = simple_column_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/table.h b/include/sqlpp11/table.h index bf8ed275..26b14e0c 100644 --- a/include/sqlpp11/table.h +++ b/include/sqlpp11/table.h @@ -105,7 +105,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = X; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << name_of::char_ptr(); return context; diff --git a/include/sqlpp11/tvin.h b/include/sqlpp11/tvin.h index 9c4b3c1a..da1bf993 100644 --- a/include/sqlpp11/tvin.h +++ b/include/sqlpp11/tvin.h @@ -73,7 +73,7 @@ namespace sqlpp using _serialize_check = assert_tvin_with_correct_operator_t; using T = tvin_arg_t; - static Context& _(const T& t, Context& context) + static Context& _(const T&, Context&) { _serialize_check::_(); } diff --git a/include/sqlpp11/update.h b/include/sqlpp11/update.h index 7bb998c0..c5f858c7 100644 --- a/include/sqlpp11/update.h +++ b/include/sqlpp11/update.h @@ -94,7 +94,7 @@ namespace sqlpp using _serialize_check = consistent_t; using T = update_name_t; - static Context& _(const T& /* t */, Context& context) + static Context& _(const T&, Context& context) { context << "UPDATE "; diff --git a/tests/MockDb.h b/tests/MockDb.h index 1fddd94f..4dc2de2a 100644 --- a/tests/MockDb.h +++ b/tests/MockDb.h @@ -95,7 +95,7 @@ struct MockDbT: public sqlpp::connection class result_t { public: - constexpr bool operator==(const result_t& rhs) const + constexpr bool operator==(const result_t&) const { return true; } @@ -127,7 +127,7 @@ struct MockDbT: public sqlpp::connection return _run(t, _ok{}); } - size_t execute(const std::string& command) + size_t execute(const std::string&) { return 0; } @@ -220,13 +220,13 @@ struct MockDbT: public sqlpp::connection } template - size_t run_prepared_execute(const PreparedExecute& x) + size_t run_prepared_execute(const PreparedExecute&) { return 0; } template - size_t run_prepared_insert(const PreparedInsert& x) + size_t run_prepared_insert(const PreparedInsert&) { return 0; } @@ -241,7 +241,7 @@ struct MockDbT: public sqlpp::connection } template - result_t run_prepared_select(PreparedSelect& x) + result_t run_prepared_select(PreparedSelect&) { return {}; } From 947bf9ddd32092e8e375e0b7addeb95f733bdb0f Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 30 May 2015 16:44:10 +0200 Subject: [PATCH 017/122] Fixed tests (prevent two tests from being executed with MockDb) --- tests/Function.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Function.cpp b/tests/Function.cpp index a899a40d..ac62a789 100644 --- a/tests/Function.cpp +++ b/tests/Function.cpp @@ -196,7 +196,7 @@ int Function(int, char**) static_assert(not sqlpp::is_numeric_t::value, "type requirement"); static_assert(not sqlpp::is_text_t::value, "type requirement"); - if (db(select(exists(select(t.alpha).from(t).where(true)))).front().exists) { /* do something */ } + if (nullptr and db(select(exists(select(t.alpha).from(t).where(true)))).front().exists) { /* do something */ } } @@ -284,7 +284,7 @@ int Function(int, char**) static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); - if (db(select(count(t.alpha)).from(t).where(true)).front().count) { /* do something */ } + if (nullptr and db(select(count(t.alpha)).from(t).where(true)).front().count) { /* do something */ } } // Test max From 0807e579587dbbccbc9111a2dbe1d3edb2d792f2 Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 30 May 2015 16:45:06 +0200 Subject: [PATCH 018/122] Fixed warnings about missing initializers --- include/sqlpp11/join.h | 12 ++++++------ include/sqlpp11/table.h | 10 +++++----- tests/Select.cpp | 6 ++++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/include/sqlpp11/join.h b/include/sqlpp11/join.h index 8e2578d6..105e4873 100644 --- a/include/sqlpp11/join.h +++ b/include/sqlpp11/join.h @@ -90,7 +90,7 @@ namespace sqlpp return { _lhs, _rhs, - {std::tuple{expr...}} + {std::tuple{expr...}, {}} }; } @@ -98,35 +98,35 @@ namespace sqlpp join_t join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t inner_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t outer_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t left_outer_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t right_outer_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } Lhs _lhs; diff --git a/include/sqlpp11/table.h b/include/sqlpp11/table.h index 26b14e0c..cb053ade 100644 --- a/include/sqlpp11/table.h +++ b/include/sqlpp11/table.h @@ -60,31 +60,31 @@ namespace sqlpp template join_t join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t inner_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t outer_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t left_outer_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t right_outer_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template diff --git a/tests/Select.cpp b/tests/Select.cpp index 460a85b3..1762a47e 100644 --- a/tests/Select.cpp +++ b/tests/Select.cpp @@ -50,6 +50,7 @@ int Select(int, char**) test::TabFoo f; test::TabBar t; + const auto tab_a = f.as(sqlpp::alias::a); getColumn(db, t.alpha); @@ -80,6 +81,11 @@ int Select(int, char**) std::cout << row.alpha << std::endl; } + for (const auto& row : db(select(all_of(t), all_of(f)).from(t.join(f).on(t.alpha > f.omega).join(tab_a).on(t.alpha == tab_a.omega)).where(true))) + { + std::cout << row.alpha << std::endl; + } + for (const auto& row : db(select(count(t.alpha), avg(t.alpha)).from(t).where(true))) { std::cout << row.count << std::endl; From 890d75d377f3e9793cde0f4b020ef2e22c964224 Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 30 May 2015 17:10:16 +0200 Subject: [PATCH 019/122] Added a few more compiler requirements --- CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ceae772..0a4b7c92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,24 @@ target_include_directories(sqlpp11 INTERFACE ) target_compile_features(sqlpp11 INTERFACE + cxx_alias_templates + cxx_auto_type + cxx_constexpr + cxx_decltype + cxx_defaulted_functions + cxx_defaulted_move_initializers + cxx_deleted_functions + cxx_explicit_conversions + cxx_lambdas + cxx_noexcept + cxx_nullptr + cxx_range_for + cxx_right_angle_brackets + cxx_rvalue_references + cxx_static_assert + cxx_trailing_return_types + cxx_uniform_initialization + cxx_template_template_parameters cxx_variadic_templates ) From 8cd98120fb31f06377e90926baf46e358c269198 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sat, 30 May 2015 17:21:15 +0200 Subject: [PATCH 020/122] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57411d8f..5dda0d36 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ sqlpp11 ======= -[![Build Status](https://travis-ci.org/purpleKarrot/sqlpp11.svg?branch=develop)](https://travis-ci.org/purpleKarrot/sqlpp11) -[![Coverage Status](https://coveralls.io/repos/purpleKarrot/sqlpp11/badge.svg?branch=develop)](https://coveralls.io/r/purpleKarrot/sqlpp11?branch=develop) +[![Build Status](https://travis-ci.org/rbock/sqlpp11.svg?branch=develop)](https://travis-ci.org/rbock/sqlpp11?branch=develop) +[![Coverage Status](https://coveralls.io/repos/rbock/sqlpp11/badge.svg?branch=develop)](https://coveralls.io/r/rbock/sqlpp11?branch=develop) A type safe embedded domain specific language for SQL queries and results in C++ From 03100bbbbe3559bae687b8f33c48741a00c52ff4 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sat, 30 May 2015 18:49:23 +0200 Subject: [PATCH 021/122] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5dda0d36..6b6505b5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ A type safe embedded domain specific language for SQL queries and results in C++ Extensive documentation is found in the wiki, https://github.com/rbock/sqlpp11/wiki -Upcoming talks/workshops) at +Past talks/workshops at + * CppCast: http://cppcast.com + * 2015-05-07: http://cppcast.com/2015/05/roland-bock/ * CppCon (Bellevue, Washington, USA): http://cppcon.org * 2014-09-08: http://sched.co/1qhngYK (Workshop Part 1) * 2014-09-11: http://sched.co/1r4lue3 (Talk) From f3bed37a2172120b2de4a6855e163e2f5a5fdac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Mon, 1 Jun 2015 19:00:13 +0200 Subject: [PATCH 022/122] Do not set gcc/clang options when using msvc --- tests/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 669b2b9f..66ba4a0f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,7 +24,10 @@ add_library(sqlpp11_testing INTERFACE) target_include_directories(sqlpp11_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +if (NOT MSVC) target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic) +endif () set(test_names BooleanExpression From 377fbc8958b26cb2c0151b3068bce07dff3811ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Mon, 1 Jun 2015 19:01:38 +0200 Subject: [PATCH 023/122] Do not use compile features with msvc It has no options controlling the language feature to use anyway. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a4b7c92..83beffcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ target_include_directories(sqlpp11 INTERFACE $ ) +if (NOT MSVC) target_compile_features(sqlpp11 INTERFACE cxx_alias_templates cxx_auto_type @@ -54,6 +55,7 @@ target_compile_features(sqlpp11 INTERFACE cxx_template_template_parameters cxx_variadic_templates ) +endif () add_subdirectory(tests) add_subdirectory(test_constraints) From b062f2ade7c12a8bdd2a1817a665709a649d2965 Mon Sep 17 00:00:00 2001 From: rbock Date: Mon, 1 Jun 2015 22:12:32 +0200 Subject: [PATCH 024/122] Revert "Replaced char[] with char[] to please MSVC 2015" This reverts commit 30a3a6b2ff1bb2cad4b3556855add5b0a0875831. --- include/sqlpp11/alias_provider.h | 2 +- scripts/ddl2cpp | 4 ++-- tests/Sample.h | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sqlpp11/alias_provider.h b/include/sqlpp11/alias_provider.h index fafc875e..86dba643 100644 --- a/include/sqlpp11/alias_provider.h +++ b/include/sqlpp11/alias_provider.h @@ -35,7 +35,7 @@ {\ struct _alias_t\ {\ - static constexpr const char _literal[sizeof(#name)] = #name;\ + static constexpr const char _literal[] = #name;\ using _name_t = sqlpp::make_char_sequence;\ template\ struct _member_t\ diff --git a/scripts/ddl2cpp b/scripts/ddl2cpp index e71047a4..80e0063b 100755 --- a/scripts/ddl2cpp +++ b/scripts/ddl2cpp @@ -146,7 +146,7 @@ for tableCreation in tableCreations: print(' {', file=header) print(' struct _alias_t', file=header) print(' {', file=header) - print(' static constexpr const char _literal[' + str(len(sqlColumnName) + 1) + '] = "' + sqlColumnName + '";', file=header) + print(' static constexpr const char _literal[] = "' + sqlColumnName + '";', file=header) print(' using _name_t = sqlpp::make_char_sequence;', file=header) print(' template', file=header) print(' struct _member_t', file=header) @@ -178,7 +178,7 @@ for tableCreation in tableCreations: print(' {', file=header) print(' struct _alias_t', file=header) print(' {', file=header) - print(' static constexpr const char _literal[' + str(len(sqlTableName) + 1) + '] = "' + sqlTableName + '";', file=header) + print(' static constexpr const char _literal[] = "' + sqlTableName + '";', file=header) print(' using _name_t = sqlpp::make_char_sequence;', file=header) print(' template', file=header) print(' struct _member_t', file=header) diff --git a/tests/Sample.h b/tests/Sample.h index fe87589c..2fa909e5 100644 --- a/tests/Sample.h +++ b/tests/Sample.h @@ -13,7 +13,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[6] = "delta"; + static constexpr const char _literal[] = "delta"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -29,7 +29,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[8] = "epsilon"; + static constexpr const char _literal[] = "epsilon"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -45,7 +45,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[6] = "omega"; + static constexpr const char _literal[] = "omega"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -66,7 +66,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[8] = "tab_foo"; + static constexpr const char _literal[] = "tab_foo"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -83,7 +83,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[6] = "alpha"; + static constexpr const char _literal[] = "alpha"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -99,7 +99,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[5] = "beta"; + static constexpr const char _literal[] = "beta"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -115,7 +115,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[6] = "gamma"; + static constexpr const char _literal[] = "gamma"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -131,7 +131,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[6] = "delta"; + static constexpr const char _literal[] = "delta"; using _name_t = sqlpp::make_char_sequence; template struct _member_t @@ -153,7 +153,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[8] = "tab_bar"; + static constexpr const char _literal[] = "tab_bar"; using _name_t = sqlpp::make_char_sequence; template struct _member_t From 303ee750adb43a96207d30f6e4834f6648672bcf Mon Sep 17 00:00:00 2001 From: rbock Date: Fri, 26 Jun 2015 16:16:07 +0200 Subject: [PATCH 025/122] Added test for selecting a constant value --- tests/Select.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Select.cpp b/tests/Select.cpp index 1762a47e..42fe4393 100644 --- a/tests/Select.cpp +++ b/tests/Select.cpp @@ -54,6 +54,11 @@ int Select(int, char**) getColumn(db, t.alpha); + for (const auto& row : db(select(sqlpp::value(false).as(sqlpp::alias::a)))) + { + std::cout << row.a << std::endl; + } + for (const auto& row : db(select(all_of(t)).from(t).where(true))) { int64_t a = row.alpha; From bbe933f943b3171613122ac768987dfa2ca5ffac Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 5 Jul 2015 11:08:13 +0200 Subject: [PATCH 026/122] count is the first auto-aliased function If used in an expression, count does not have an alias. If used as a field in a select, it does have an alias. --- include/sqlpp11/count.h | 27 +++++++++++++---------- include/sqlpp11/detail/copy_tuple_args.h | 28 +++++++++++++++++++----- include/sqlpp11/multi_column.h | 4 ++-- include/sqlpp11/select_column_list.h | 27 ++++++++++++----------- tests/CMakeLists.txt | 26 +++++++++++----------- tests/Select.cpp | 1 + 6 files changed, 68 insertions(+), 45 deletions(-) diff --git a/include/sqlpp11/count.h b/include/sqlpp11/count.h index 7abda19f..c564c03e 100644 --- a/include/sqlpp11/count.h +++ b/include/sqlpp11/count.h @@ -33,18 +33,8 @@ namespace sqlpp { - template - struct count_t: - public expression_operators, integral>, - public alias_operators> + struct count_alias_t { - using _traits = make_traits; - - using _nodes = detail::type_vector; - using _can_be_null = std::false_type; - - static_assert(is_noop::value or std::is_same::value, "count() used with flag other than 'distinct'"); - struct _alias_t { static constexpr const char _literal[] = "count_"; @@ -57,6 +47,21 @@ namespace sqlpp const T& operator()() const { return count; } }; }; + }; + + template + struct count_t: + public expression_operators, integral>, + public alias_operators> + { + using _traits = make_traits; + + using _nodes = detail::type_vector; + using _can_be_null = std::false_type; + + static_assert(is_noop::value or std::is_same::value, "count() used with flag other than 'distinct'"); + + using _auto_alias_t = count_alias_t; count_t(const Expr expr): _expr(expr) diff --git a/include/sqlpp11/detail/copy_tuple_args.h b/include/sqlpp11/detail/copy_tuple_args.h index 4f6d483a..fe0c9f4a 100644 --- a/include/sqlpp11/detail/copy_tuple_args.h +++ b/include/sqlpp11/detail/copy_tuple_args.h @@ -28,6 +28,7 @@ #define SQLPP_DETAIL_COPY_TUPLE_ARGS_H #include +#include namespace sqlpp { @@ -36,22 +37,37 @@ namespace sqlpp namespace detail { - template - struct as_tuple + template + struct auto_alias_impl { - static std::tuple _(T t) { return std::tuple{ t }; } + using type = T; }; template - struct as_tuple> + struct auto_alias_impl::value>::type> + { + using type = expression_alias_t; + }; + + template + using auto_alias_t = typename detail::auto_alias_impl::type; + + template + struct as_column_tuple + { + static std::tuple> _(T t) { return std::tuple>{ auto_alias_t{t} }; } + }; + + template + struct as_column_tuple> { static typename all_of_t::_column_tuple_t _(all_of_t) { return { }; } }; template - struct as_tuple> + struct as_column_tuple> { - static std::tuple _(std::tuple t) { return t; } + static std::tuple...> _(std::tuple t) { return t; } }; template class Target, typename First, typename T> diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index 7e55cc97..c1a8704e 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -130,14 +130,14 @@ namespace sqlpp template using make_multi_column_t = detail::copy_tuple_args_t::_(std::declval())...))>; + decltype(std::tuple_cat(detail::as_column_tuple::_(std::declval())...))>; } template auto multi_column(Columns... columns) -> detail::make_multi_column_t { - return detail::make_multi_column_t(std::tuple_cat(detail::as_tuple::_(columns)...)); + return detail::make_multi_column_t(std::tuple_cat(detail::as_column_tuple::_(columns)...)); } diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index 3437f078..8389859e 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -188,17 +188,18 @@ namespace sqlpp template void add(NamedExpression namedExpression) { + using named_expression = detail::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, "named expression uses tables unknown to this statement in selected_columns::add()"); + 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, "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, "a column of this name is present in the select already"); - using _serialize_check = sqlpp::serialize_check_t; + static_assert(not detail::is_element_of::value, "a column of this name is present in the select already"); + using _serialize_check = sqlpp::serialize_check_t; _serialize_check::_(); using ok = logic::all_t< _is_dynamic::value, - is_selectable_t::value, + is_selectable_t::value, _serialize_check::type::value >; @@ -209,7 +210,7 @@ namespace sqlpp template void _add_impl(NamedExpression namedExpression, const std::true_type&) { - return _data._dynamic_columns.emplace_back(namedExpression); + return _data._dynamic_columns.emplace_back(detail::auto_alias_t{namedExpression}); } template @@ -338,15 +339,15 @@ namespace sqlpp namespace detail { template - auto tuple_merge(Columns... columns) -> decltype(std::tuple_cat(as_tuple::_(columns)...)) + auto column_tuple_merge(Columns... columns) -> decltype(std::tuple_cat(as_column_tuple::_(columns)...)) { - return std::tuple_cat(as_tuple::_(columns)...); + return std::tuple_cat(as_column_tuple::_(columns)...); } template using make_select_column_list_t = copy_tuple_args_t()...))>; + decltype(column_tuple_merge(std::declval()...))>; } @@ -395,9 +396,9 @@ namespace sqlpp } template - static constexpr auto _check_args(T... args) -> decltype(_check_tuple(detail::tuple_merge(args...))) + static constexpr auto _check_args(T... args) -> decltype(_check_tuple(detail::column_tuple_merge(args...))) { - return _check_tuple(detail::tuple_merge(args...)); + return _check_tuple(detail::column_tuple_merge(args...)); } template @@ -412,7 +413,7 @@ namespace sqlpp static_assert(sizeof...(Args), "at least one selectable expression (e.g. a column) required in columns()"); static_assert(decltype(_check_args(args...))::value, "at least one argument is not a selectable expression in columns()"); - return _columns_impl(_check_args(args...), detail::tuple_merge(args...)); + return _columns_impl(_check_args(args...), detail::column_tuple_merge(args...)); } template @@ -422,7 +423,7 @@ namespace sqlpp static_assert(not std::is_same<_database_t, void>::value, "dynamic_columns must not be called in a static statement"); static_assert(decltype(_check_args(args...))::value, "at least one argument is not a selectable expression in columns()"); - return _columns_impl<_database_t>(_check_args(args...), detail::tuple_merge(args...)); + return _columns_impl<_database_t>(_check_args(args...), detail::column_tuple_merge(args...)); } private: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 66ba4a0f..c2022160 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -30,20 +30,20 @@ target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic) endif () set(test_names - BooleanExpression - CustomQuery - Interpret - Insert - Remove - Update + #BooleanExpression + #CustomQuery + #Interpret + #Insert + #Remove + #Update Select - SelectType - Function - Prepared - Minimalistic - Result - Union - With + #SelectType + #Function + #Prepared + #Minimalistic + #Result + #Union + #With ) create_test_sourcelist(test_sources test_main.cpp ${test_names}) diff --git a/tests/Select.cpp b/tests/Select.cpp index 42fe4393..7eddc76c 100644 --- a/tests/Select.cpp +++ b/tests/Select.cpp @@ -53,6 +53,7 @@ int Select(int, char**) const auto tab_a = f.as(sqlpp::alias::a); getColumn(db, t.alpha); + select(count(t.alpha)); for (const auto& row : db(select(sqlpp::value(false).as(sqlpp::alias::a)))) { From 864bd58effb3370259be7493c4023e7dde8d28f4 Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 5 Jul 2015 11:51:49 +0200 Subject: [PATCH 027/122] More functions are now auto-aliased --- include/sqlpp11/any.h | 13 ----- include/sqlpp11/auto_alias.h | 66 ++++++++++++++++++++++++ include/sqlpp11/avg.h | 25 +++++---- include/sqlpp11/concat.h | 19 ++++--- include/sqlpp11/detail/copy_tuple_args.h | 17 +----- include/sqlpp11/exists.h | 23 +++++---- include/sqlpp11/functions.h | 2 +- include/sqlpp11/in.h | 23 +++++---- include/sqlpp11/is_not_null.h | 19 ++++--- include/sqlpp11/is_null.h | 25 +++++---- include/sqlpp11/max.h | 19 ++++--- include/sqlpp11/min.h | 19 ++++--- include/sqlpp11/not_in.h | 25 +++++---- include/sqlpp11/select_column_list.h | 4 +- include/sqlpp11/some.h | 13 ----- include/sqlpp11/sum.h | 25 +++++---- tests/CMakeLists.txt | 26 +++++----- tests/Function.cpp | 21 ++++---- 18 files changed, 230 insertions(+), 154 deletions(-) create mode 100644 include/sqlpp11/auto_alias.h diff --git a/include/sqlpp11/any.h b/include/sqlpp11/any.h index 8585de1d..23ad6db0 100644 --- a/include/sqlpp11/any.h +++ b/include/sqlpp11/any.h @@ -39,19 +39,6 @@ namespace sqlpp using _traits = make_traits, tag::is_multi_expression>; using _nodes = detail::type_vector; - - static_assert(is_select_t; + + static_assert(is_select_t; - struct _alias_t - { - static constexpr const char _literal[] = "some_"; - using _name_t = sqlpp::make_char_sequence; - template - struct _member_t - { - T some; - T& operator()() { return some; } - const T& operator()() const { return some; } - }; - }; - some_t(Select select): _select(select) {} diff --git a/include/sqlpp11/sum.h b/include/sqlpp11/sum.h index b766d2e3..0211706b 100644 --- a/include/sqlpp11/sum.h +++ b/include/sqlpp11/sum.h @@ -32,17 +32,8 @@ namespace sqlpp { - template - struct sum_t: - public expression_operators, value_type_of>, - public alias_operators> + struct sum_alias_t { - using _traits = make_traits, tag::is_expression, tag::is_selectable>; - using _nodes = detail::type_vector; - - static_assert(is_noop::value or std::is_same::value, "sum() used with flag other than 'distinct'"); - static_assert(is_numeric_t::value, "sum() requires a numeric expression as argument"); - struct _alias_t { static constexpr const char _literal[] = "sum_"; @@ -55,6 +46,20 @@ namespace sqlpp const T& operator()() const { return sum; } }; }; + }; + + template + struct sum_t: + public expression_operators, value_type_of>, + public alias_operators> + { + using _traits = make_traits, tag::is_expression, tag::is_selectable>; + using _nodes = detail::type_vector; + + static_assert(is_noop::value or std::is_same::value, "sum() used with flag other than 'distinct'"); + static_assert(is_numeric_t::value, "sum() requires a numeric expression as argument"); + + using _auto_alias_t = sum_alias_t; sum_t(Expr expr): _expr(expr) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c2022160..66ba4a0f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -30,20 +30,20 @@ target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic) endif () set(test_names - #BooleanExpression - #CustomQuery - #Interpret - #Insert - #Remove - #Update + BooleanExpression + CustomQuery + Interpret + Insert + Remove + Update Select - #SelectType - #Function - #Prepared - #Minimalistic - #Result - #Union - #With + SelectType + Function + Prepared + Minimalistic + Result + Union + With ) create_test_sourcelist(test_sources test_main.cpp ${test_names}) diff --git a/tests/Function.cpp b/tests/Function.cpp index ac62a789..1956257a 100644 --- a/tests/Function.cpp +++ b/tests/Function.cpp @@ -25,6 +25,7 @@ #include "Sample.h" #include "MockDb.h" +#include #include #include #include @@ -256,11 +257,11 @@ int Function(int, char**) { using TI = decltype(avg(t.alpha)); using TF = decltype(avg(f.omega)); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(not sqlpp::is_integral_t::value, "type requirement"); static_assert(sqlpp::is_floating_point_t::value, "type requirement"); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(not sqlpp::is_integral_t::value, "type requirement"); static_assert(sqlpp::is_floating_point_t::value, "type requirement"); @@ -271,15 +272,15 @@ int Function(int, char**) using TI = decltype(count(t.alpha)); using TT = decltype(count(t.beta)); using TF = decltype(count(f.omega)); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); @@ -292,15 +293,15 @@ int Function(int, char**) using TI = decltype(max(t.alpha)); using TF = decltype(max(f.omega)); using TT = decltype(max(t.beta)); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(not sqlpp::is_integral_t::value, "type requirement"); static_assert(sqlpp::is_floating_point_t::value, "type requirement"); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(not sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_text_t::value, "type requirement"); } @@ -310,7 +311,7 @@ int Function(int, char**) using TI = decltype(min(t.alpha)); using TF = decltype(min(f.omega)); using TT = decltype(min(t.beta)); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); @@ -327,7 +328,7 @@ int Function(int, char**) { using TI = decltype(sum(t.alpha)); using TF = decltype(sum(f.omega)); - static_assert(sqlpp::is_selectable_t::value, "type requirement"); + static_assert(sqlpp::has_auto_alias_t::value, "type requirement"); static_assert(sqlpp::is_numeric_t::value, "type requirement"); static_assert(sqlpp::is_integral_t::value, "type requirement"); static_assert(not sqlpp::is_floating_point_t::value, "type requirement"); From 34376bdd28fb83db51d27eec4a05fd841a804470 Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 5 Jul 2015 13:40:06 +0200 Subject: [PATCH 028/122] Fixed compile error for clang-3.4 and gcc-4.8 --- include/sqlpp11/alias.h | 10 ++++++++++ include/sqlpp11/detail/copy_tuple_args.h | 8 +++++++- include/sqlpp11/multi_column.h | 4 ++-- include/sqlpp11/select_column_list.h | 7 ------- tests/Interpret.cpp | 1 + 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/sqlpp11/alias.h b/include/sqlpp11/alias.h index 013d2e6f..720bb52e 100644 --- a/include/sqlpp11/alias.h +++ b/include/sqlpp11/alias.h @@ -43,6 +43,16 @@ namespace sqlpp using _alias_t = typename AliasProvider::_alias_t; + expression_alias_t(Expression expression): + _expression(expression) + {} + + expression_alias_t(const expression_alias_t&) = default; + expression_alias_t(expression_alias_t&&) = default; + expression_alias_t& operator=(const expression_alias_t&) = default; + expression_alias_t& operator=(expression_alias_t&&) = default; + ~expression_alias_t() = default; + Expression _expression; }; diff --git a/include/sqlpp11/detail/copy_tuple_args.h b/include/sqlpp11/detail/copy_tuple_args.h index 6aeeff88..1a58dac0 100644 --- a/include/sqlpp11/detail/copy_tuple_args.h +++ b/include/sqlpp11/detail/copy_tuple_args.h @@ -40,7 +40,7 @@ namespace sqlpp template struct as_column_tuple { - static std::tuple> _(T t) { return std::tuple>{ auto_alias_t{t} }; } + static std::tuple> _(T t) { return std::tuple>(auto_alias_t{t}); } }; template @@ -70,6 +70,12 @@ namespace sqlpp template class Target, typename First, typename T> using copy_tuple_args_t = typename copy_tuple_args_impl::type; + template + auto column_tuple_merge(Columns... columns) -> decltype(std::tuple_cat(as_column_tuple::_(columns)...)) + { + return std::tuple_cat(as_column_tuple::_(columns)...); + } + } } diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index c1a8704e..0c17a263 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -129,8 +129,8 @@ namespace sqlpp { template using make_multi_column_t = - detail::copy_tuple_args_t::_(std::declval())...))>; + copy_tuple_args_t()...))>; } template diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index 9d73be09..d7ed448a 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -338,17 +338,10 @@ namespace sqlpp namespace detail { - template - auto column_tuple_merge(Columns... columns) -> decltype(std::tuple_cat(as_column_tuple::_(columns)...)) - { - return std::tuple_cat(as_column_tuple::_(columns)...); - } - template using make_select_column_list_t = copy_tuple_args_t()...))>; - } struct no_select_column_list_t diff --git a/tests/Interpret.cpp b/tests/Interpret.cpp index d2a597f6..834ee738 100644 --- a/tests/Interpret.cpp +++ b/tests/Interpret.cpp @@ -36,6 +36,7 @@ int Interpret(int, char**) test::TabFoo f; test::TabBar t; + select(t.alpha.as(t.beta)); serialize(insert_into(t).columns(t.beta, t.gamma), printer).str(); { From 2b8a36aa97c9f2a2146a5e6fb7b681e1e51dd5b0 Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 5 Jul 2015 13:53:38 +0200 Subject: [PATCH 029/122] Added support for empty in() and not_in() I wonder why SQL does not have that anyway. --- include/sqlpp11/in.h | 27 +++++++++++++++++++++++++++ include/sqlpp11/not_in.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/include/sqlpp11/in.h b/include/sqlpp11/in.h index 9628ee84..28d9901f 100644 --- a/include/sqlpp11/in.h +++ b/include/sqlpp11/in.h @@ -95,6 +95,33 @@ namespace sqlpp } }; + template + struct value_list_t; + + template + struct serializer_t>> + { + using _serialize_check = serialize_check_of>; + using T = in_t>; + + static Context& _(const T& t, Context& context) + { + const auto& value_list = std::get<0>(t._args); + if (value_list._container.empty()) + { + context << " 'operand in empty list' = 'false' "; + } + else + { + serialize(t._operand, context); + context << " IN("; + serialize(value_list, context); + context << ')'; + } + return context; + } + }; + } #endif diff --git a/include/sqlpp11/not_in.h b/include/sqlpp11/not_in.h index c42edc70..d230d815 100644 --- a/include/sqlpp11/not_in.h +++ b/include/sqlpp11/not_in.h @@ -95,6 +95,34 @@ namespace sqlpp } }; + template + struct value_list_t; + + template + struct serializer_t>> + { + using _serialize_check = serialize_check_of>; + using T = not_in_t>; + + static Context& _(const T& t, Context& context) + { + const auto& value_list = std::get<0>(t._args); + if (value_list._container.empty()) + { + context << " 'operand not in empty list' != 'false' "; + } + else + { + serialize(t._operand, context); + context << " NOT IN("; + serialize(value_list, context); + context << ')'; + } + return context; + } + }; + + } #endif From 5756b2355f8113d1c1ba11af4ce05215670edb8b Mon Sep 17 00:00:00 2001 From: Reto Schneider Date: Wed, 5 Aug 2015 14:43:21 +0200 Subject: [PATCH 030/122] Remove trailing spaces. --- CMakeLists.txt | 8 ++-- examples/CMakeLists.txt | 2 +- examples/insert.cpp | 36 +++++++-------- examples/remove.cpp | 32 ++++++------- examples/select.cpp | 46 +++++++++---------- examples/update.cpp | 32 ++++++------- include/sqlpp11/alias.h | 8 ++-- include/sqlpp11/alias_provider.h | 8 ++-- include/sqlpp11/all_of.h | 8 ++-- include/sqlpp11/any.h | 8 ++-- include/sqlpp11/assignment.h | 10 ++-- include/sqlpp11/auto_alias.h | 8 ++-- include/sqlpp11/avg.h | 8 ++-- include/sqlpp11/bad_statement.h | 8 ++-- include/sqlpp11/basic_expression_operators.h | 14 +++--- include/sqlpp11/boolean.h | 8 ++-- include/sqlpp11/boolean_expression.h | 8 ++-- include/sqlpp11/char_sequence.h | 8 ++-- include/sqlpp11/column.h | 12 ++--- include/sqlpp11/column_types.h | 8 ++-- include/sqlpp11/concat.h | 10 ++-- include/sqlpp11/connection.h | 8 ++-- include/sqlpp11/count.h | 10 ++-- include/sqlpp11/cte.h | 16 +++---- include/sqlpp11/custom_query.h | 10 ++-- include/sqlpp11/default_value.h | 8 ++-- include/sqlpp11/detail/copy_tuple_args.h | 8 ++-- include/sqlpp11/detail/field_index_sequence.h | 8 ++-- include/sqlpp11/detail/get_first.h | 8 ++-- include/sqlpp11/detail/get_last.h | 8 ++-- include/sqlpp11/detail/index_sequence.h | 8 ++-- include/sqlpp11/detail/pick_arg.h | 8 ++-- include/sqlpp11/detail/sum.h | 8 ++-- include/sqlpp11/detail/type_set.h | 10 ++-- include/sqlpp11/detail/type_vector.h | 8 ++-- include/sqlpp11/eval.h | 8 ++-- include/sqlpp11/exception.h | 8 ++-- include/sqlpp11/exists.h | 10 ++-- include/sqlpp11/expression.h | 14 +++--- include/sqlpp11/expression_fwd.h | 8 ++-- include/sqlpp11/extra_tables.h | 8 ++-- include/sqlpp11/field_spec.h | 14 +++--- include/sqlpp11/floating_point.h | 16 +++---- include/sqlpp11/from.h | 8 ++-- include/sqlpp11/functions.h | 10 ++-- include/sqlpp11/group_by.h | 8 ++-- include/sqlpp11/having.h | 8 ++-- include/sqlpp11/hidden.h | 8 ++-- include/sqlpp11/in.h | 8 ++-- include/sqlpp11/in_fwd.h | 8 ++-- include/sqlpp11/insert.h | 10 ++-- include/sqlpp11/insert_value.h | 8 ++-- include/sqlpp11/insert_value_list.h | 14 +++--- include/sqlpp11/integral.h | 16 +++---- include/sqlpp11/interpret.h | 8 ++-- include/sqlpp11/interpret_tuple.h | 10 ++-- include/sqlpp11/interpretable.h | 10 ++-- include/sqlpp11/interpretable_list.h | 8 ++-- include/sqlpp11/interpreter.h | 8 ++-- include/sqlpp11/into.h | 8 ++-- include/sqlpp11/is_not_null.h | 8 ++-- include/sqlpp11/is_null.h | 8 ++-- include/sqlpp11/is_null_fwd.h | 8 ++-- include/sqlpp11/join.h | 14 +++--- include/sqlpp11/like.h | 8 ++-- include/sqlpp11/limit.h | 8 ++-- include/sqlpp11/logic.h | 12 ++--- include/sqlpp11/max.h | 8 ++-- include/sqlpp11/min.h | 8 ++-- include/sqlpp11/multi_column.h | 12 ++--- include/sqlpp11/named_interpretable.h | 10 ++-- include/sqlpp11/no_data.h | 8 ++-- include/sqlpp11/no_value.h | 8 ++-- include/sqlpp11/noop.h | 10 ++-- include/sqlpp11/noop_fwd.h | 8 ++-- include/sqlpp11/not_in.h | 8 ++-- include/sqlpp11/null.h | 8 ++-- include/sqlpp11/offset.h | 8 ++-- include/sqlpp11/on.h | 8 ++-- include/sqlpp11/order_by.h | 8 ++-- include/sqlpp11/parameter.h | 8 ++-- include/sqlpp11/parameter_list.h | 8 ++-- include/sqlpp11/policy_update.h | 8 ++-- include/sqlpp11/prepared_execute.h | 8 ++-- include/sqlpp11/prepared_insert.h | 8 ++-- include/sqlpp11/prepared_remove.h | 8 ++-- include/sqlpp11/prepared_select.h | 8 ++-- include/sqlpp11/prepared_update.h | 8 ++-- include/sqlpp11/remove.h | 8 ++-- include/sqlpp11/result.h | 8 ++-- include/sqlpp11/result_field.h | 8 ++-- include/sqlpp11/result_field_methods.h | 14 +++--- include/sqlpp11/result_row.h | 16 +++---- include/sqlpp11/result_row_fwd.h | 8 ++-- include/sqlpp11/rhs_wrap.h | 10 ++-- include/sqlpp11/schema.h | 8 ++-- include/sqlpp11/schema_qualified_table.h | 8 ++-- include/sqlpp11/select.h | 20 ++++---- include/sqlpp11/select_column_list.h | 14 +++--- include/sqlpp11/select_flag_list.h | 8 ++-- include/sqlpp11/select_flags.h | 8 ++-- include/sqlpp11/select_pseudo_table.h | 12 ++--- include/sqlpp11/serialize.h | 8 ++-- include/sqlpp11/serializer.h | 8 ++-- include/sqlpp11/serializer_context.h | 32 ++++++------- include/sqlpp11/simple_column.h | 8 ++-- include/sqlpp11/single_table.h | 8 ++-- include/sqlpp11/some.h | 8 ++-- include/sqlpp11/sort_order.h | 8 ++-- include/sqlpp11/sqlpp11.h | 8 ++-- include/sqlpp11/statement.h | 34 +++++++------- include/sqlpp11/statement_fwd.h | 8 ++-- include/sqlpp11/sum.h | 8 ++-- include/sqlpp11/table.h | 12 ++--- include/sqlpp11/table_alias.h | 8 ++-- include/sqlpp11/table_ref.h | 8 ++-- include/sqlpp11/text.h | 16 +++---- include/sqlpp11/transaction.h | 8 ++-- include/sqlpp11/tvin.h | 12 ++--- include/sqlpp11/type_traits.h | 16 +++---- include/sqlpp11/union.h | 12 ++--- include/sqlpp11/union_data.h | 8 ++-- include/sqlpp11/union_flags.h | 8 ++-- include/sqlpp11/update.h | 8 ++-- include/sqlpp11/update_list.h | 10 ++-- include/sqlpp11/using.h | 8 ++-- include/sqlpp11/value_or_null.h | 8 ++-- include/sqlpp11/value_type.h | 8 ++-- include/sqlpp11/value_type_fwd.h | 10 ++-- include/sqlpp11/verbatim.h | 8 ++-- include/sqlpp11/verbatim_table.h | 8 ++-- include/sqlpp11/where.h | 8 ++-- include/sqlpp11/with.h | 8 ++-- include/sqlpp11/wrap_operand.h | 8 ++-- include/sqlpp11/wrap_operand_fwd.h | 8 ++-- include/sqlpp11/wrong.h | 8 ++-- test_constraints/count_of_count.cpp | 32 ++++++------- test_constraints/max_of_max.cpp | 32 ++++++------- test_constraints/must_not_insert.cpp | 32 ++++++------- test_constraints/must_not_update.cpp | 32 ++++++------- ...onversion_operator_if_null_not_trivial.cpp | 34 +++++++------- test_constraints/require_insert.cpp | 32 ++++++------- tests/BooleanExpression.cpp | 34 +++++++------- tests/CustomQuery.cpp | 36 +++++++-------- tests/Function.cpp | 40 ++++++++-------- tests/Insert.cpp | 36 +++++++-------- tests/Interpret.cpp | 32 ++++++------- tests/Prepared.cpp | 34 +++++++------- tests/Remove.cpp | 32 ++++++------- tests/Result.cpp | 36 +++++++-------- tests/Select.cpp | 34 +++++++------- tests/SelectType.cpp | 36 +++++++-------- tests/Union.cpp | 32 ++++++------- tests/Update.cpp | 32 ++++++------- tests/With.cpp | 32 ++++++------- 155 files changed, 1023 insertions(+), 1023 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83beffcb..416fcac6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,16 +1,16 @@ # 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 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3f6e46b5..9046f915 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -49,7 +49,7 @@ endforeach() #find_package(PythonInterp REQUIRED) #add_custom_command( -# OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Sample.h +# OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Sample.h # COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/ddl2cpp ${CMAKE_CURRENT_LIST_DIR}/sample.sql Sample test # DEPENDS ${CMAKE_CURRENT_LIST_DIR}/sample.sql # ) diff --git a/examples/insert.cpp b/examples/insert.cpp index 6aa85f9c..107e806c 100644 --- a/examples/insert.cpp +++ b/examples/insert.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2014-2015 Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -47,9 +47,9 @@ int insert(int, char**) //db(insert_into(f).set(f.name = "loves c++", p.feature = 7)); //db(insert_into(f).set(f.id = 42, f.name = "loves c++", f.fatal = false)); - + //db(insert_into(f).set(f.name = "loves c++")); - + db(insert_into(f).default_values()); diff --git a/examples/remove.cpp b/examples/remove.cpp index 3788e7e8..84cdb8b4 100644 --- a/examples/remove.cpp +++ b/examples/remove.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2014-2015 Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/examples/select.cpp b/examples/select.cpp index 8607f7a1..1b9849d4 100644 --- a/examples/select.cpp +++ b/examples/select.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2014-2015 Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -87,15 +87,15 @@ int select(int, char**) //int64_t feature = row.feature; } #endif - - - - - - + + + + + + #if 0 - auto s = select(p.id, p.name, f.id.as(cheesecake)) + auto s = select(p.id, p.name, f.id.as(cheesecake)) .from(p, f) .where(p.name == any(select(f.name) .from(f) diff --git a/examples/update.cpp b/examples/update.cpp index ed3de0a2..887535f5 100644 --- a/examples/update.cpp +++ b/examples/update.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2014-2015 Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/include/sqlpp11/alias.h b/include/sqlpp11/alias.h index 720bb52e..18ecc1da 100644 --- a/include/sqlpp11/alias.h +++ b/include/sqlpp11/alias.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/alias_provider.h b/include/sqlpp11/alias_provider.h index 86dba643..cd59b2b2 100644 --- a/include/sqlpp11/alias_provider.h +++ b/include/sqlpp11/alias_provider.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/all_of.h b/include/sqlpp11/all_of.h index 999344d3..b8f59bed 100644 --- a/include/sqlpp11/all_of.h +++ b/include/sqlpp11/all_of.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/any.h b/include/sqlpp11/any.h index 23ad6db0..daf92732 100644 --- a/include/sqlpp11/any.h +++ b/include/sqlpp11/any.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/assignment.h b/include/sqlpp11/assignment.h index 29e3dbd8..6e00160d 100644 --- a/include/sqlpp11/assignment.h +++ b/include/sqlpp11/assignment.h @@ -1,17 +1,17 @@ /* * 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 @@ -48,7 +48,7 @@ namespace sqlpp static_assert(can_be_null_t<_lhs_t>::value ? true : not (std::is_same<_rhs_t, null_t>::value or is_tvin_t<_rhs_t>::value), "column must not be null"); assignment_t(_lhs_t lhs, _rhs_t rhs): - _lhs(lhs), + _lhs(lhs), _rhs(rhs) {} diff --git a/include/sqlpp11/auto_alias.h b/include/sqlpp11/auto_alias.h index 1b47c559..7b2c9da9 100644 --- a/include/sqlpp11/auto_alias.h +++ b/include/sqlpp11/auto_alias.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/avg.h b/include/sqlpp11/avg.h index bc5b7f3d..5a23a851 100644 --- a/include/sqlpp11/avg.h +++ b/include/sqlpp11/avg.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/bad_statement.h b/include/sqlpp11/bad_statement.h index c4094591..1151f287 100644 --- a/include/sqlpp11/bad_statement.h +++ b/include/sqlpp11/bad_statement.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/basic_expression_operators.h b/include/sqlpp11/basic_expression_operators.h index 3bfeafe1..7d9ddda8 100644 --- a/include/sqlpp11/basic_expression_operators.h +++ b/include/sqlpp11/basic_expression_operators.h @@ -1,17 +1,17 @@ /* * 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 @@ -45,7 +45,7 @@ namespace sqlpp template struct _is_valid_comparison_operand { - static constexpr bool value = + static constexpr bool value = (is_expression_t::value // expressions are OK or is_multi_expression_t::value) // multi-expressions like ANY are OK for comparisons, too and ValueType::template _is_valid_operand::value // the correct value type is required, of course @@ -117,12 +117,12 @@ namespace sqlpp } sort_order_t asc() const - { + { return { *static_cast(this) }; } sort_order_t desc() const - { + { return { *static_cast(this) }; } diff --git a/include/sqlpp11/boolean.h b/include/sqlpp11/boolean.h index 899b0c55..d9a218b4 100644 --- a/include/sqlpp11/boolean.h +++ b/include/sqlpp11/boolean.h @@ -95,8 +95,8 @@ namespace sqlpp } bool is_null() const - { - return _is_null; + { + return _is_null; } _cpp_value_type value() const @@ -180,10 +180,10 @@ namespace sqlpp } bool is_null() const - { + { if (not _is_valid) throw exception("accessing is_null in non-existing row"); - return _is_null; + return _is_null; } bool _is_trivial() const diff --git a/include/sqlpp11/boolean_expression.h b/include/sqlpp11/boolean_expression.h index 73ee01ff..cc79e9a2 100644 --- a/include/sqlpp11/boolean_expression.h +++ b/include/sqlpp11/boolean_expression.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/char_sequence.h b/include/sqlpp11/char_sequence.h index c465ccae..5d7ee1c3 100644 --- a/include/sqlpp11/char_sequence.h +++ b/include/sqlpp11/char_sequence.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/column.h b/include/sqlpp11/column.h index de7b23b3..4985735e 100644 --- a/include/sqlpp11/column.h +++ b/include/sqlpp11/column.h @@ -1,17 +1,17 @@ /* * 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 @@ -42,10 +42,10 @@ namespace sqlpp { template - struct column_t: + struct column_t: public expression_operators, value_type_of>, public column_operators, value_type_of> - { + { struct _traits { using _value_type = value_type_of; diff --git a/include/sqlpp11/column_types.h b/include/sqlpp11/column_types.h index 66d0faac..d79d01f4 100644 --- a/include/sqlpp11/column_types.h +++ b/include/sqlpp11/column_types.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/concat.h b/include/sqlpp11/concat.h index 757b3d1e..5b2d3209 100644 --- a/include/sqlpp11/concat.h +++ b/include/sqlpp11/concat.h @@ -1,17 +1,17 @@ /* * 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 @@ -52,7 +52,7 @@ namespace sqlpp }; template - struct concat_t: + struct concat_t: public expression_operators, text>, public alias_operators> { diff --git a/include/sqlpp11/connection.h b/include/sqlpp11/connection.h index 49b178bd..fb405251 100644 --- a/include/sqlpp11/connection.h +++ b/include/sqlpp11/connection.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/count.h b/include/sqlpp11/count.h index c564c03e..3d2ef33d 100644 --- a/include/sqlpp11/count.h +++ b/include/sqlpp11/count.h @@ -1,17 +1,17 @@ /* * 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 @@ -50,7 +50,7 @@ namespace sqlpp }; template - struct count_t: + struct count_t: public expression_operators, integral>, public alias_operators> { diff --git a/include/sqlpp11/cte.h b/include/sqlpp11/cte.h index 51adff9a..bc971bed 100644 --- a/include/sqlpp11/cte.h +++ b/include/sqlpp11/cte.h @@ -1,17 +1,17 @@ /* * 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 @@ -104,8 +104,8 @@ namespace sqlpp { using _alias_t = typename FieldSpec::_alias_t; - using _traits = make_traits, - tag::must_not_insert, + using _traits = make_traits, + tag::must_not_insert, tag::must_not_update, tag_if::value> >; @@ -142,7 +142,7 @@ namespace sqlpp template using _check = logic::all_t::value...>; - using _result_row_t = result_row_t; + using _result_row_t = result_row_t; template auto union_distinct(Rhs rhs) const @@ -211,7 +211,7 @@ namespace sqlpp // The cte_t is displayed as AliasProviderName except within the with: -// - the with needs the +// - the with needs the // AliasProviderName AS (ColumnNames) (select/union) // The result row of the select should not have dynamic parts template diff --git a/include/sqlpp11/custom_query.h b/include/sqlpp11/custom_query.h index 1868073b..7548b255 100644 --- a/include/sqlpp11/custom_query.h +++ b/include/sqlpp11/custom_query.h @@ -1,17 +1,17 @@ /* * 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 @@ -58,7 +58,7 @@ namespace sqlpp using _parameter_check = typename std::conditional>::value == 0, consistent_t, assert_no_parameters_t>::type; - using _run_check = detail::get_first_if; using _prepare_check = consistent_t; diff --git a/include/sqlpp11/default_value.h b/include/sqlpp11/default_value.h index 27494531..da9b5dae 100644 --- a/include/sqlpp11/default_value.h +++ b/include/sqlpp11/default_value.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/copy_tuple_args.h b/include/sqlpp11/detail/copy_tuple_args.h index 1a58dac0..fdd70da6 100644 --- a/include/sqlpp11/detail/copy_tuple_args.h +++ b/include/sqlpp11/detail/copy_tuple_args.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/field_index_sequence.h b/include/sqlpp11/detail/field_index_sequence.h index e56c74bb..505ecc14 100644 --- a/include/sqlpp11/detail/field_index_sequence.h +++ b/include/sqlpp11/detail/field_index_sequence.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/get_first.h b/include/sqlpp11/detail/get_first.h index 7d7a4d7d..c6e10219 100644 --- a/include/sqlpp11/detail/get_first.h +++ b/include/sqlpp11/detail/get_first.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/get_last.h b/include/sqlpp11/detail/get_last.h index 0783c2d1..7dfc4c35 100644 --- a/include/sqlpp11/detail/get_last.h +++ b/include/sqlpp11/detail/get_last.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/index_sequence.h b/include/sqlpp11/detail/index_sequence.h index df9edcea..06876fde 100644 --- a/include/sqlpp11/detail/index_sequence.h +++ b/include/sqlpp11/detail/index_sequence.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/pick_arg.h b/include/sqlpp11/detail/pick_arg.h index ac74b2eb..d242f497 100644 --- a/include/sqlpp11/detail/pick_arg.h +++ b/include/sqlpp11/detail/pick_arg.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/sum.h b/include/sqlpp11/detail/sum.h index 6ebce4ed..e8e34bbe 100644 --- a/include/sqlpp11/detail/sum.h +++ b/include/sqlpp11/detail/sum.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/detail/type_set.h b/include/sqlpp11/detail/type_set.h index cad901b8..130742ee 100644 --- a/include/sqlpp11/detail/type_set.h +++ b/include/sqlpp11/detail/type_set.h @@ -1,17 +1,17 @@ /* * 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 @@ -189,7 +189,7 @@ namespace sqlpp struct make_joined_set, T...> { using _rest = typename make_joined_set::type; - + using type = joined_set_t, _rest>; }; diff --git a/include/sqlpp11/detail/type_vector.h b/include/sqlpp11/detail/type_vector.h index 7b23b8c8..7aa8e780 100644 --- a/include/sqlpp11/detail/type_vector.h +++ b/include/sqlpp11/detail/type_vector.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/eval.h b/include/sqlpp11/eval.h index e425376a..ce0d2fb7 100644 --- a/include/sqlpp11/eval.h +++ b/include/sqlpp11/eval.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/exception.h b/include/sqlpp11/exception.h index dc96e9b2..618508c6 100644 --- a/include/sqlpp11/exception.h +++ b/include/sqlpp11/exception.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/exists.h b/include/sqlpp11/exists.h index 1d14728e..3c5ffb76 100644 --- a/include/sqlpp11/exists.h +++ b/include/sqlpp11/exists.h @@ -1,17 +1,17 @@ /* * 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 @@ -49,7 +49,7 @@ namespace sqlpp }; template - struct exists_t: + struct exists_t: public expression_operators, boolean>, public alias_operators> { diff --git a/include/sqlpp11/expression.h b/include/sqlpp11/expression.h index 2bf4f26a..932ce174 100644 --- a/include/sqlpp11/expression.h +++ b/include/sqlpp11/expression.h @@ -1,17 +1,17 @@ /* * 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 @@ -49,7 +49,7 @@ namespace sqlpp using _nodes = detail::type_vector<_lhs_t, _rhs_t>; binary_expression_t(_lhs_t lhs, _rhs_t rhs): - _lhs(lhs), + _lhs(lhs), _rhs(rhs) {} @@ -98,7 +98,7 @@ namespace sqlpp using _nodes = detail::type_vector<_lhs_t, _rhs_t>; binary_expression_t(Lhs lhs, _rhs_t rhs): - _lhs(lhs), + _lhs(lhs), _rhs(rhs) {} @@ -191,7 +191,7 @@ namespace sqlpp using _nodes = detail::type_vector; binary_expression_t(Lhs lhs, Rhs rhs): - _lhs(lhs), + _lhs(lhs), _rhs(rhs) {} diff --git a/include/sqlpp11/expression_fwd.h b/include/sqlpp11/expression_fwd.h index 6562ee53..34322e15 100644 --- a/include/sqlpp11/expression_fwd.h +++ b/include/sqlpp11/expression_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/extra_tables.h b/include/sqlpp11/extra_tables.h index 785964b1..a7e9f31a 100644 --- a/include/sqlpp11/extra_tables.h +++ b/include/sqlpp11/extra_tables.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/field_spec.h b/include/sqlpp11/field_spec.h index d2ed9f25..1010d5ed 100644 --- a/include/sqlpp11/field_spec.h +++ b/include/sqlpp11/field_spec.h @@ -1,17 +1,17 @@ /* * 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 @@ -33,8 +33,8 @@ namespace sqlpp { template struct field_spec_t - { - using _traits = make_traits, tag_if >; @@ -56,7 +56,7 @@ namespace sqlpp static constexpr bool _can_be_null = can_be_null_t::value; static constexpr bool _depends_on_outer_table = detail::make_intersect_set_t, typename Select::_used_outer_tables>::size::value > 0; - using type = field_spec_t, logic::any_t<_can_be_null, _depends_on_outer_table>::value, null_is_trivial_value_t::value>; diff --git a/include/sqlpp11/floating_point.h b/include/sqlpp11/floating_point.h index dd85affc..52a2eaf1 100644 --- a/include/sqlpp11/floating_point.h +++ b/include/sqlpp11/floating_point.h @@ -1,17 +1,17 @@ /* * 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 @@ -93,8 +93,8 @@ namespace sqlpp } bool is_null() const - { - return _is_null; + { + return _is_null; } const _cpp_value_type& value() const @@ -237,10 +237,10 @@ namespace sqlpp } bool is_null() const - { + { if (not _is_valid) throw exception("accessing is_null in non-existing row"); - return _is_null; + return _is_null; } bool _is_trivial() const diff --git a/include/sqlpp11/from.h b/include/sqlpp11/from.h index 91274bc1..a3345a7b 100644 --- a/include/sqlpp11/from.h +++ b/include/sqlpp11/from.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/functions.h b/include/sqlpp11/functions.h index f2949276..48f6e2ed 100644 --- a/include/sqlpp11/functions.h +++ b/include/sqlpp11/functions.h @@ -1,17 +1,17 @@ /* * 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 @@ -135,7 +135,7 @@ namespace sqlpp } template - constexpr const char* get_sql_name(const T&) + constexpr const char* get_sql_name(const T&) { return name_of::char_ptr(); } diff --git a/include/sqlpp11/group_by.h b/include/sqlpp11/group_by.h index 52f9a338..b1d0c8c5 100644 --- a/include/sqlpp11/group_by.h +++ b/include/sqlpp11/group_by.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/having.h b/include/sqlpp11/having.h index b69b5f1a..22852ce5 100644 --- a/include/sqlpp11/having.h +++ b/include/sqlpp11/having.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/hidden.h b/include/sqlpp11/hidden.h index 94cc66ae..38c5c3b3 100644 --- a/include/sqlpp11/hidden.h +++ b/include/sqlpp11/hidden.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/in.h b/include/sqlpp11/in.h index 28d9901f..06b7ab5c 100644 --- a/include/sqlpp11/in.h +++ b/include/sqlpp11/in.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/in_fwd.h b/include/sqlpp11/in_fwd.h index becbfbbe..67acdaa5 100644 --- a/include/sqlpp11/in_fwd.h +++ b/include/sqlpp11/in_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/insert.h b/include/sqlpp11/insert.h index 7b578c7f..fed2428a 100644 --- a/include/sqlpp11/insert.h +++ b/include/sqlpp11/insert.h @@ -1,17 +1,17 @@ /* * 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 @@ -104,7 +104,7 @@ namespace sqlpp template using blank_insert_t = statement_t; inline auto insert() diff --git a/include/sqlpp11/insert_value.h b/include/sqlpp11/insert_value.h index c7436884..4fcd6329 100644 --- a/include/sqlpp11/insert_value.h +++ b/include/sqlpp11/insert_value.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/insert_value_list.h b/include/sqlpp11/insert_value_list.h index bf060902..ec724374 100644 --- a/include/sqlpp11/insert_value_list.h +++ b/include/sqlpp11/insert_value_list.h @@ -1,17 +1,17 @@ /* * 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 @@ -94,7 +94,7 @@ namespace sqlpp using _consistency_check = consistent_t; }; - }; + }; template struct insert_list_data_t @@ -168,7 +168,7 @@ namespace sqlpp _serialize_check::_(); using ok = logic::all_t< - _is_dynamic::value, + _is_dynamic::value, is_assignment_t::value, _serialize_check::type::value>; @@ -266,7 +266,7 @@ namespace sqlpp static_assert(_args_correct::value, "add_values() arguments do not match columns() arguments"); using ok = logic::all_t< - logic::all_t::value...>::value, + logic::all_t::value...>::value, _args_correct::value>; _add_impl(ok(), assignments...); // dispatch to prevent compile messages after the static_assert diff --git a/include/sqlpp11/integral.h b/include/sqlpp11/integral.h index 3cd5e97d..6a874d20 100644 --- a/include/sqlpp11/integral.h +++ b/include/sqlpp11/integral.h @@ -1,17 +1,17 @@ /* * 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 @@ -94,8 +94,8 @@ namespace sqlpp } bool is_null() const - { - return _is_null; + { + return _is_null; } const _cpp_value_type& value() const @@ -268,10 +268,10 @@ namespace sqlpp } bool is_null() const - { + { if (not _is_valid) throw exception("accessing is_null in non-existing row"); - return _is_null; + return _is_null; } bool _is_trivial() const diff --git a/include/sqlpp11/interpret.h b/include/sqlpp11/interpret.h index ed12051f..758669b7 100644 --- a/include/sqlpp11/interpret.h +++ b/include/sqlpp11/interpret.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/interpret_tuple.h b/include/sqlpp11/interpret_tuple.h index bc022f34..e1212f46 100644 --- a/include/sqlpp11/interpret_tuple.h +++ b/include/sqlpp11/interpret_tuple.h @@ -1,17 +1,17 @@ /* * 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 @@ -53,7 +53,7 @@ namespace sqlpp // See for example: "http://en.cppreference.com/w/cpp/utility/integer_sequence" // See also: "http://stackoverflow.com/questions/6245735/pretty-print-stdtuple/6245777#6245777" // Beware of gcc-bug: "http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51253", otherwise an empty swallow struct could be used - using swallow = int[]; + using swallow = int[]; (void) swallow{ 0, //workaround against -Wpedantic GCC warning "zero-size array 'int [0]'" (interpret_tuple_element(std::get(t), separator, context, useBraces, Is), 0)...}; diff --git a/include/sqlpp11/interpretable.h b/include/sqlpp11/interpretable.h index 393ca855..c4c7019e 100644 --- a/include/sqlpp11/interpretable.h +++ b/include/sqlpp11/interpretable.h @@ -1,17 +1,17 @@ /* * 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 @@ -61,7 +61,7 @@ namespace sqlpp // This method only exists if Db::_serializer_context_t and serializer_context_t are not the same template auto serialize(Context& context) const - -> typename std::enable_if::value + -> typename std::enable_if::value and not std::is_same::value, Context&>::type { return _impl->db_serialize(context); diff --git a/include/sqlpp11/interpretable_list.h b/include/sqlpp11/interpretable_list.h index face27b9..80d370ef 100644 --- a/include/sqlpp11/interpretable_list.h +++ b/include/sqlpp11/interpretable_list.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/interpreter.h b/include/sqlpp11/interpreter.h index ace659c5..1a4607ac 100644 --- a/include/sqlpp11/interpreter.h +++ b/include/sqlpp11/interpreter.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/into.h b/include/sqlpp11/into.h index 53cf22be..a7f48599 100644 --- a/include/sqlpp11/into.h +++ b/include/sqlpp11/into.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/is_not_null.h b/include/sqlpp11/is_not_null.h index e124b8e4..f49ed762 100644 --- a/include/sqlpp11/is_not_null.h +++ b/include/sqlpp11/is_not_null.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/is_null.h b/include/sqlpp11/is_null.h index 6bddbf6a..3fa189ee 100644 --- a/include/sqlpp11/is_null.h +++ b/include/sqlpp11/is_null.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/is_null_fwd.h b/include/sqlpp11/is_null_fwd.h index 155f3922..58ee53a8 100644 --- a/include/sqlpp11/is_null_fwd.h +++ b/include/sqlpp11/is_null_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/join.h b/include/sqlpp11/join.h index 105e4873..6484eaab 100644 --- a/include/sqlpp11/join.h +++ b/include/sqlpp11/join.h @@ -1,17 +1,17 @@ /* * 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 @@ -78,7 +78,7 @@ namespace sqlpp static_assert(required_tables_of::size::value == 0, "joined tables must not depend on other tables"); - template + template using set_on_t = join_t; template @@ -88,8 +88,8 @@ namespace sqlpp static_assert(is_noop::value, "cannot call on() twice for a single join()"); static_assert(logic::all_t::value...>::value, "at least one argument is not an expression in on()"); - return { _lhs, - _rhs, + return { _lhs, + _rhs, {std::tuple{expr...}, {}} }; } diff --git a/include/sqlpp11/like.h b/include/sqlpp11/like.h index 02adeba0..662faea6 100644 --- a/include/sqlpp11/like.h +++ b/include/sqlpp11/like.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/limit.h b/include/sqlpp11/limit.h index c740c8dc..32b56b41 100644 --- a/include/sqlpp11/limit.h +++ b/include/sqlpp11/limit.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/logic.h b/include/sqlpp11/logic.h index 1db03db4..7dd820ec 100644 --- a/include/sqlpp11/logic.h +++ b/include/sqlpp11/logic.h @@ -1,17 +1,17 @@ /* * 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 @@ -56,13 +56,13 @@ namespace sqlpp template struct not_impl; - template<> + template<> struct not_impl { using type = std::false_type; }; - template<> + template<> struct not_impl { using type = std::true_type; diff --git a/include/sqlpp11/max.h b/include/sqlpp11/max.h index 7516d927..76e59b37 100644 --- a/include/sqlpp11/max.h +++ b/include/sqlpp11/max.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/min.h b/include/sqlpp11/min.h index 3bead069..dca50b56 100644 --- a/include/sqlpp11/min.h +++ b/include/sqlpp11/min.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index 0c17a263..e1e9b9dd 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -1,17 +1,17 @@ /* * 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 @@ -128,8 +128,8 @@ namespace sqlpp namespace detail { template - using make_multi_column_t = - copy_tuple_args_t()...))>; } diff --git a/include/sqlpp11/named_interpretable.h b/include/sqlpp11/named_interpretable.h index 079b19bf..2c4a940f 100644 --- a/include/sqlpp11/named_interpretable.h +++ b/include/sqlpp11/named_interpretable.h @@ -1,17 +1,17 @@ /* * 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 @@ -60,7 +60,7 @@ namespace sqlpp // This method only exists if Db::_serializer_context_t and serializer_context_t are not the same template auto serialize(Context& context) const - -> typename std::enable_if::value + -> typename std::enable_if::value and not std::is_same::value, Context&>::type { return _impl->db_serialize(context); diff --git a/include/sqlpp11/no_data.h b/include/sqlpp11/no_data.h index 629e7705..e13f0bda 100644 --- a/include/sqlpp11/no_data.h +++ b/include/sqlpp11/no_data.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/no_value.h b/include/sqlpp11/no_value.h index bf31ad5a..3e2e04e6 100644 --- a/include/sqlpp11/no_value.h +++ b/include/sqlpp11/no_value.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/noop.h b/include/sqlpp11/noop.h index 83e91cc1..5c251dec 100644 --- a/include/sqlpp11/noop.h +++ b/include/sqlpp11/noop.h @@ -1,17 +1,17 @@ /* * 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 @@ -34,7 +34,7 @@ namespace sqlpp { - struct noop + struct noop { using _traits = make_traits; using _nodes = detail::type_vector<>; diff --git a/include/sqlpp11/noop_fwd.h b/include/sqlpp11/noop_fwd.h index a07caba2..e1b9e293 100644 --- a/include/sqlpp11/noop_fwd.h +++ b/include/sqlpp11/noop_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/not_in.h b/include/sqlpp11/not_in.h index d230d815..4a117037 100644 --- a/include/sqlpp11/not_in.h +++ b/include/sqlpp11/not_in.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/null.h b/include/sqlpp11/null.h index 3331897f..9debc06e 100644 --- a/include/sqlpp11/null.h +++ b/include/sqlpp11/null.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/offset.h b/include/sqlpp11/offset.h index bb9b1406..45d0f26f 100644 --- a/include/sqlpp11/offset.h +++ b/include/sqlpp11/offset.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/on.h b/include/sqlpp11/on.h index 81cff460..956652ab 100644 --- a/include/sqlpp11/on.h +++ b/include/sqlpp11/on.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/order_by.h b/include/sqlpp11/order_by.h index bc85d708..3c59b7e3 100644 --- a/include/sqlpp11/order_by.h +++ b/include/sqlpp11/order_by.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/parameter.h b/include/sqlpp11/parameter.h index 87e4ae9b..691f770b 100644 --- a/include/sqlpp11/parameter.h +++ b/include/sqlpp11/parameter.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/parameter_list.h b/include/sqlpp11/parameter_list.h index eaace254..c88ce350 100644 --- a/include/sqlpp11/parameter_list.h +++ b/include/sqlpp11/parameter_list.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/policy_update.h b/include/sqlpp11/policy_update.h index 3a8f3a56..46a88346 100644 --- a/include/sqlpp11/policy_update.h +++ b/include/sqlpp11/policy_update.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/prepared_execute.h b/include/sqlpp11/prepared_execute.h index b7d4939f..9a110472 100644 --- a/include/sqlpp11/prepared_execute.h +++ b/include/sqlpp11/prepared_execute.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/prepared_insert.h b/include/sqlpp11/prepared_insert.h index 416b46de..4176236e 100644 --- a/include/sqlpp11/prepared_insert.h +++ b/include/sqlpp11/prepared_insert.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/prepared_remove.h b/include/sqlpp11/prepared_remove.h index 3d75c9e0..869d4c80 100644 --- a/include/sqlpp11/prepared_remove.h +++ b/include/sqlpp11/prepared_remove.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/prepared_select.h b/include/sqlpp11/prepared_select.h index 5d5893f5..486eeb07 100644 --- a/include/sqlpp11/prepared_select.h +++ b/include/sqlpp11/prepared_select.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/prepared_update.h b/include/sqlpp11/prepared_update.h index cac4af4b..1bf94de2 100644 --- a/include/sqlpp11/prepared_update.h +++ b/include/sqlpp11/prepared_update.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/remove.h b/include/sqlpp11/remove.h index 67e472ee..008dd2ef 100644 --- a/include/sqlpp11/remove.h +++ b/include/sqlpp11/remove.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/result.h b/include/sqlpp11/result.h index 43cb582b..3428ebfd 100644 --- a/include/sqlpp11/result.h +++ b/include/sqlpp11/result.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/result_field.h b/include/sqlpp11/result_field.h index 7947543a..ee240f5c 100644 --- a/include/sqlpp11/result_field.h +++ b/include/sqlpp11/result_field.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/result_field_methods.h b/include/sqlpp11/result_field_methods.h index 850d1f43..308d6f4b 100644 --- a/include/sqlpp11/result_field_methods.h +++ b/include/sqlpp11/result_field_methods.h @@ -1,17 +1,17 @@ /* * 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 @@ -60,8 +60,8 @@ namespace sqlpp template class Field, typename ValueType, typename Db, typename FieldSpec> struct result_field_methods_base_t< - Field, - typename std::enable_if::value + Field, + typename std::enable_if::value and column_spec_can_be_null_t::value and not null_is_trivial_value_t::value>::type> { @@ -78,7 +78,7 @@ namespace sqlpp using _traits = make_traits, tag::is_result_field, - tag::is_expression, + tag::is_expression, tag_if>; using _nodes = detail::type_vector<>; diff --git a/include/sqlpp11/result_row.h b/include/sqlpp11/result_row.h index a33ebfe7..a14c01ef 100644 --- a/include/sqlpp11/result_row.h +++ b/include/sqlpp11/result_row.h @@ -1,17 +1,17 @@ /* * 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 @@ -66,7 +66,7 @@ namespace sqlpp }; template - struct result_field>>: + struct result_field>>: public member_t, FieldSpecs...>> { using _multi_field = member_t, FieldSpecs...>>; @@ -91,7 +91,7 @@ namespace sqlpp }; template - struct result_row_impl, FieldSpecs...>: + struct result_row_impl, FieldSpecs...>: public result_field... { result_row_impl() = default; @@ -195,13 +195,13 @@ namespace sqlpp std::vector _dynamic_field_names; std::map _dynamic_fields; - dynamic_result_row_t(): + dynamic_result_row_t(): _impl(), _is_valid(false) { } - dynamic_result_row_t(const std::vector& dynamic_field_names): + dynamic_result_row_t(const std::vector& dynamic_field_names): _impl(), _is_valid(false), _dynamic_field_names(dynamic_field_names) diff --git a/include/sqlpp11/result_row_fwd.h b/include/sqlpp11/result_row_fwd.h index 65d5819b..147722f6 100644 --- a/include/sqlpp11/result_row_fwd.h +++ b/include/sqlpp11/result_row_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/rhs_wrap.h b/include/sqlpp11/rhs_wrap.h index d48f6c22..4261e415 100644 --- a/include/sqlpp11/rhs_wrap.h +++ b/include/sqlpp11/rhs_wrap.h @@ -1,17 +1,17 @@ /* * 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 @@ -121,7 +121,7 @@ namespace sqlpp using _nodes = detail::type_vector; rhs_wrap_t(Expr expr): - _expr(expr) + _expr(expr) {} rhs_wrap_t(const rhs_wrap_t&) = default; diff --git a/include/sqlpp11/schema.h b/include/sqlpp11/schema.h index f898283e..8d54edc6 100644 --- a/include/sqlpp11/schema.h +++ b/include/sqlpp11/schema.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/schema_qualified_table.h b/include/sqlpp11/schema_qualified_table.h index 23347a0a..5dd10e7f 100644 --- a/include/sqlpp11/schema_qualified_table.h +++ b/include/sqlpp11/schema_qualified_table.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index de351fd5..727cc331 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -1,17 +1,17 @@ /* * 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 @@ -72,15 +72,15 @@ namespace sqlpp using blank_select_t = statement_t, - no_group_by_t, + no_where_t, + no_group_by_t, no_having_t, - no_order_by_t, - no_limit_t, + no_order_by_t, + no_limit_t, no_offset_t, no_union_t>; diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index d7ed448a..8626a78f 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -1,17 +1,17 @@ /* * 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 @@ -198,7 +198,7 @@ namespace sqlpp _serialize_check::_(); using ok = logic::all_t< - _is_dynamic::value, + _is_dynamic::value, is_selectable_t::value, _serialize_check::type::value >; @@ -339,8 +339,8 @@ namespace sqlpp namespace detail { template - using make_select_column_list_t = - copy_tuple_args_t()...))>; } diff --git a/include/sqlpp11/select_flag_list.h b/include/sqlpp11/select_flag_list.h index 6c0de43d..c380a1fa 100644 --- a/include/sqlpp11/select_flag_list.h +++ b/include/sqlpp11/select_flag_list.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/select_flags.h b/include/sqlpp11/select_flags.h index c9210486..0abe3fa1 100644 --- a/include/sqlpp11/select_flags.h +++ b/include/sqlpp11/select_flags.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/select_pseudo_table.h b/include/sqlpp11/select_pseudo_table.h index 2f027dd0..f9216593 100644 --- a/include/sqlpp11/select_pseudo_table.h +++ b/include/sqlpp11/select_pseudo_table.h @@ -1,17 +1,17 @@ /* * 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 @@ -42,8 +42,8 @@ namespace sqlpp static constexpr bool _can_be_null = can_be_null_t::value; static constexpr bool _depends_on_outer_table = detail::make_intersect_set_t, typename Select::_used_outer_tables>::size::value > 0; - using _traits = make_traits, - tag::must_not_insert, + using _traits = make_traits, + tag::must_not_insert, tag::must_not_update, tag_if >; diff --git a/include/sqlpp11/serialize.h b/include/sqlpp11/serialize.h index b32fbe77..d89d3a00 100644 --- a/include/sqlpp11/serialize.h +++ b/include/sqlpp11/serialize.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/serializer.h b/include/sqlpp11/serializer.h index 2fc59570..3cf0c8ae 100644 --- a/include/sqlpp11/serializer.h +++ b/include/sqlpp11/serializer.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/serializer_context.h b/include/sqlpp11/serializer_context.h index 3fc975d6..152d979f 100644 --- a/include/sqlpp11/serializer_context.h +++ b/include/sqlpp11/serializer_context.h @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/include/sqlpp11/simple_column.h b/include/sqlpp11/simple_column.h index c1beef53..350bf35a 100644 --- a/include/sqlpp11/simple_column.h +++ b/include/sqlpp11/simple_column.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/single_table.h b/include/sqlpp11/single_table.h index dc9b7798..1adb5f2f 100644 --- a/include/sqlpp11/single_table.h +++ b/include/sqlpp11/single_table.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/some.h b/include/sqlpp11/some.h index 272530b5..b06af6ec 100644 --- a/include/sqlpp11/some.h +++ b/include/sqlpp11/some.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/sort_order.h b/include/sqlpp11/sort_order.h index 1dea7449..b1cfe076 100644 --- a/include/sqlpp11/sort_order.h +++ b/include/sqlpp11/sort_order.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/sqlpp11.h b/include/sqlpp11/sqlpp11.h index e69bb0e3..d1294e41 100644 --- a/include/sqlpp11/sqlpp11.h +++ b/include/sqlpp11/sqlpp11.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/statement.h b/include/sqlpp11/statement.h index 863ef6ed..5fb31aab 100644 --- a/include/sqlpp11/statement.h +++ b/include/sqlpp11/statement.h @@ -1,17 +1,17 @@ /* * 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 @@ -148,9 +148,9 @@ namespace sqlpp using _nodes = detail::type_vector<>; using _can_be_null = logic::any_t< - can_be_null_t<_result_type_provider>::value, + can_be_null_t<_result_type_provider>::value, detail::make_intersect_set_t< - required_tables_of<_result_type_provider>, + required_tables_of<_result_type_provider>, _all_provided_outer_tables >::size::value != 0>; using _parameters = detail::type_vector_cat_t...>; @@ -173,19 +173,19 @@ namespace sqlpp { using _policies_t = typename detail::statement_policies_t; - using _consistency_check = detail::get_first_if::_consistency_check..., + using _consistency_check = detail::get_first_if::_consistency_check..., typename _policies_t::_table_check>; - using _run_check = detail::get_first_if::_consistency_check..., + using _run_check = detail::get_first_if::_consistency_check..., typename _policies_t::_table_check>; using _prepare_check = detail::get_first_if::_consistency_check..., + typename _policies_t::_cte_check, + typename Policies::template _base_t<_policies_t>::_consistency_check..., typename _policies_t::_table_check>; using _result_type_provider = typename _policies_t::_result_type_provider; @@ -193,9 +193,9 @@ namespace sqlpp using _result_methods_t = typename _result_type_provider::template _result_methods_t; using _traits = make_traits, - tag::is_statement, + tag::is_statement, tag_if::value...>::value>, - tag_if::value>, + tag_if::value>, tag_if::value>, tag_if::value>::value>, tag::requires_braces>; @@ -262,7 +262,7 @@ namespace sqlpp static Context& _(const T& t, Context& context) { - using swallow = int[]; + using swallow = int[]; (void) swallow{(serialize(static_cast&>(t)()._data, context), 0)...}; return context; diff --git a/include/sqlpp11/statement_fwd.h b/include/sqlpp11/statement_fwd.h index ca4d368b..d83b5812 100644 --- a/include/sqlpp11/statement_fwd.h +++ b/include/sqlpp11/statement_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/sum.h b/include/sqlpp11/sum.h index 0211706b..14a6b793 100644 --- a/include/sqlpp11/sum.h +++ b/include/sqlpp11/sum.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/table.h b/include/sqlpp11/table.h index cb053ade..251402cb 100644 --- a/include/sqlpp11/table.h +++ b/include/sqlpp11/table.h @@ -1,17 +1,17 @@ /* * 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 @@ -40,8 +40,8 @@ namespace sqlpp struct table_base_t {}; template - struct table_t: - public table_base_t, + struct table_t: + public table_base_t, public member_t>... { using _traits = make_traits; diff --git a/include/sqlpp11/table_alias.h b/include/sqlpp11/table_alias.h index 2452ec6c..65df9cb5 100644 --- a/include/sqlpp11/table_alias.h +++ b/include/sqlpp11/table_alias.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/table_ref.h b/include/sqlpp11/table_ref.h index fa3b0fe4..e5eeb3c3 100644 --- a/include/sqlpp11/table_ref.h +++ b/include/sqlpp11/table_ref.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/text.h b/include/sqlpp11/text.h index adb5f6ca..f7fcbc8f 100644 --- a/include/sqlpp11/text.h +++ b/include/sqlpp11/text.h @@ -1,17 +1,17 @@ /* * 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 @@ -97,8 +97,8 @@ namespace sqlpp } bool is_null() const - { - return _is_null; + { + return _is_null; } _cpp_value_type value() const @@ -192,10 +192,10 @@ namespace sqlpp bool operator!=(const _cpp_value_type& rhs) const { return not operator==(rhs); } bool is_null() const - { + { if (not _is_valid) throw exception("accessing is_null in non-existing row"); - return _value_ptr == nullptr; + return _value_ptr == nullptr; } bool _is_trivial() const diff --git a/include/sqlpp11/transaction.h b/include/sqlpp11/transaction.h index ee844373..8010f394 100644 --- a/include/sqlpp11/transaction.h +++ b/include/sqlpp11/transaction.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/tvin.h b/include/sqlpp11/tvin.h index da1bf993..9bcfc55c 100644 --- a/include/sqlpp11/tvin.h +++ b/include/sqlpp11/tvin.h @@ -1,17 +1,17 @@ /* * 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 @@ -44,7 +44,7 @@ namespace sqlpp using _operand_t = Operand; - tvin_arg_t(_operand_t operand): + tvin_arg_t(_operand_t operand): _value(operand) {} tvin_arg_t(const tvin_arg_t&) = default; @@ -106,7 +106,7 @@ namespace sqlpp using _operand_t = Operand; - tvin_t(tvin_arg_t arg): + tvin_t(tvin_arg_t arg): _value(arg._value) {} tvin_t(const tvin_t&) = default; diff --git a/include/sqlpp11/type_traits.h b/include/sqlpp11/type_traits.h index 128692af..307f304c 100644 --- a/include/sqlpp11/type_traits.h +++ b/include/sqlpp11/type_traits.h @@ -1,17 +1,17 @@ /* * 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 @@ -350,9 +350,9 @@ namespace sqlpp }; template - struct has_result_row_impl::template _result_row_t>::value, + not wrong_t::template _result_row_t>::value, void>::type> { using type = std::true_type; @@ -368,9 +368,9 @@ namespace sqlpp }; template - struct get_result_row_impl::template _result_row_t>::value, + not wrong_t::template _result_row_t>::value, void>::type> { using type = typename Statement::template _result_methods_t::template _result_row_t; diff --git a/include/sqlpp11/union.h b/include/sqlpp11/union.h index f8daf2f2..f141a81f 100644 --- a/include/sqlpp11/union.h +++ b/include/sqlpp11/union.h @@ -1,17 +1,17 @@ /* * 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 @@ -45,7 +45,7 @@ namespace sqlpp using blank_union_t = statement_t; // There is no order by or limit or offset in union, use it as a pseudo table to do that. - + template struct union_statement_impl { @@ -193,7 +193,7 @@ namespace sqlpp auto _union_impl(const std::true_type&, Rhs rhs) const -> _new_statement_t, Rhs>> { - return { blank_union_t{}, + return { blank_union_t{}, union_data_t<_database_t, Flag, derived_statement_t, Rhs>{static_cast&>(*this), rhs} }; } diff --git a/include/sqlpp11/union_data.h b/include/sqlpp11/union_data.h index f1c02f4a..949183e6 100644 --- a/include/sqlpp11/union_data.h +++ b/include/sqlpp11/union_data.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/union_flags.h b/include/sqlpp11/union_flags.h index 9d2ded02..84a9d233 100644 --- a/include/sqlpp11/union_flags.h +++ b/include/sqlpp11/union_flags.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/update.h b/include/sqlpp11/update.h index c5f858c7..8a38e2d2 100644 --- a/include/sqlpp11/update.h +++ b/include/sqlpp11/update.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/update_list.h b/include/sqlpp11/update_list.h index d2e3cd9e..0c0d68ad 100644 --- a/include/sqlpp11/update_list.h +++ b/include/sqlpp11/update_list.h @@ -1,17 +1,17 @@ /* * 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 @@ -97,7 +97,7 @@ namespace sqlpp _serialize_check::_(); using ok = logic::all_t< - _is_dynamic::value, + _is_dynamic::value, is_assignment_t::value, _serialize_check::type::value>; diff --git a/include/sqlpp11/using.h b/include/sqlpp11/using.h index 10018e14..daf98d0e 100644 --- a/include/sqlpp11/using.h +++ b/include/sqlpp11/using.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/value_or_null.h b/include/sqlpp11/value_or_null.h index ab8fb6a7..890d1366 100644 --- a/include/sqlpp11/value_or_null.h +++ b/include/sqlpp11/value_or_null.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/value_type.h b/include/sqlpp11/value_type.h index ab7f1e1f..196a290b 100644 --- a/include/sqlpp11/value_type.h +++ b/include/sqlpp11/value_type.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/value_type_fwd.h b/include/sqlpp11/value_type_fwd.h index 30d824d4..bcaec93a 100644 --- a/include/sqlpp11/value_type_fwd.h +++ b/include/sqlpp11/value_type_fwd.h @@ -1,17 +1,17 @@ /* * 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 @@ -53,7 +53,7 @@ namespace sqlpp template struct is_valid_operand { - static constexpr bool value = + static constexpr bool value = is_expression_t::value // expressions are OK and ValueType::template _is_valid_operand::value // the correct value type is required, of course ; diff --git a/include/sqlpp11/verbatim.h b/include/sqlpp11/verbatim.h index 4ea31b51..283aeb67 100644 --- a/include/sqlpp11/verbatim.h +++ b/include/sqlpp11/verbatim.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/verbatim_table.h b/include/sqlpp11/verbatim_table.h index 9247d3a6..68240631 100644 --- a/include/sqlpp11/verbatim_table.h +++ b/include/sqlpp11/verbatim_table.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/where.h b/include/sqlpp11/where.h index e3828696..87d47011 100644 --- a/include/sqlpp11/where.h +++ b/include/sqlpp11/where.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/with.h b/include/sqlpp11/with.h index c2e0a725..a57826df 100644 --- a/include/sqlpp11/with.h +++ b/include/sqlpp11/with.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/wrap_operand.h b/include/sqlpp11/wrap_operand.h index f8a4fc77..ab7604b4 100644 --- a/include/sqlpp11/wrap_operand.h +++ b/include/sqlpp11/wrap_operand.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/wrap_operand_fwd.h b/include/sqlpp11/wrap_operand_fwd.h index 633df0ac..e7366745 100644 --- a/include/sqlpp11/wrap_operand_fwd.h +++ b/include/sqlpp11/wrap_operand_fwd.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/include/sqlpp11/wrong.h b/include/sqlpp11/wrong.h index cfaf1d32..d3f77f16 100644 --- a/include/sqlpp11/wrong.h +++ b/include/sqlpp11/wrong.h @@ -1,17 +1,17 @@ /* * 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 diff --git a/test_constraints/count_of_count.cpp b/test_constraints/count_of_count.cpp index 11fdf455..59094378 100644 --- a/test_constraints/count_of_count.cpp +++ b/test_constraints/count_of_count.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/test_constraints/max_of_max.cpp b/test_constraints/max_of_max.cpp index 0cf08f56..441583e0 100644 --- a/test_constraints/max_of_max.cpp +++ b/test_constraints/max_of_max.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/test_constraints/must_not_insert.cpp b/test_constraints/must_not_insert.cpp index 262eb0ea..394bceab 100644 --- a/test_constraints/must_not_insert.cpp +++ b/test_constraints/must_not_insert.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/test_constraints/must_not_update.cpp b/test_constraints/must_not_update.cpp index 8e8a4ef2..637ce91d 100644 --- a/test_constraints/must_not_update.cpp +++ b/test_constraints/must_not_update.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/test_constraints/no_conversion_operator_if_null_not_trivial.cpp b/test_constraints/no_conversion_operator_if_null_not_trivial.cpp index 64952b80..933548ea 100644 --- a/test_constraints/no_conversion_operator_if_null_not_trivial.cpp +++ b/test_constraints/no_conversion_operator_if_null_not_trivial.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -31,7 +31,7 @@ EnforceDb edb {}; int main() { - test::TabBar t; + test::TabBar t; static_assert(sqlpp::can_be_null_t::value, "t.alpha can be null"); static_assert(not sqlpp::null_is_trivial_value_t::value, "t.alpha does not say null_is_trivial"); diff --git a/test_constraints/require_insert.cpp b/test_constraints/require_insert.cpp index 701cb699..2845bf16 100644 --- a/test_constraints/require_insert.cpp +++ b/test_constraints/require_insert.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/tests/BooleanExpression.cpp b/tests/BooleanExpression.cpp index 5f55d2e3..d5904fe9 100644 --- a/tests/BooleanExpression.cpp +++ b/tests/BooleanExpression.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -32,7 +32,7 @@ int BooleanExpression(int, char**) { MockDb db = {}; - test::TabBar t; + test::TabBar t; auto x = boolean_expression(db, t.alpha == 7); x = sqlpp::boolean_expression(t.beta.like("%cheesecake")); diff --git a/tests/CustomQuery.cpp b/tests/CustomQuery.cpp index f8781145..290b684f 100644 --- a/tests/CustomQuery.cpp +++ b/tests/CustomQuery.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -34,7 +34,7 @@ int CustomQuery(int, char**) MockDb db = {}; MockDb::_serializer_context_t printer; - test::TabFoo f; + test::TabFoo f; test::TabBar t; // A void custom query @@ -46,7 +46,7 @@ int CustomQuery(int, char**) // Syntactically, it is possible to use this void query as a prepared statement, too, not sure, whether this makes sense very often... db(db.prepare(x)); - // A prepared custom select + // A prepared custom select // The return type of the custom query is determined from the first argument which does have a return type, in this case the select auto p = db.prepare(custom_query(select(all_of(t)).from(t), where(t.alpha > sqlpp::parameter(t.alpha)))); p.params.alpha = 8; diff --git a/tests/Function.cpp b/tests/Function.cpp index 1956257a..7c32cb17 100644 --- a/tests/Function.cpp +++ b/tests/Function.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -38,14 +38,14 @@ SQLPP_ALIAS_PROVIDER(kaesekuchen) int Function(int, char**) { MockDb db = {}; - test::TabFoo f; + test::TabFoo f; test::TabBar t; //f.omega + 4 *= ""; // MEMBER FUNCTIONS // ---------------- - + // Test in { using TI = decltype(t.alpha.in(1, 2, 3)); @@ -183,7 +183,7 @@ int Function(int, char**) // SUB_SELECT_FUNCTIONS // -------------------- - + // Test exists { using TI = decltype(exists(select(t.alpha).from(t))); @@ -205,7 +205,7 @@ int Function(int, char**) { using S = decltype(select(t.alpha).from(t)); static_assert(sqlpp::is_numeric_t::value, "type requirement"); - + using TI = decltype(any(select(t.alpha).from(t))); using TT = decltype(any(select(t.beta).from(t))); using TF = decltype(any(select(f.omega).from(f))); diff --git a/tests/Insert.cpp b/tests/Insert.cpp index 76dafa4b..07d39d47 100644 --- a/tests/Insert.cpp +++ b/tests/Insert.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -62,8 +62,8 @@ int Insert(int, char**) serialize(insert_into(t).set(t.gamma = true, t.beta = "kirschauflauf"), printer).str(); serialize(insert_into(t).columns(t.gamma, t.beta), printer).str(); auto multi_insert = insert_into(t).columns(t.gamma, t.beta, t.delta); - multi_insert.values.add(t.gamma = true, t.beta = "cheesecake", t.delta = 1); - multi_insert.values.add(t.gamma = sqlpp::default_value, t.beta = sqlpp::default_value, t.delta = sqlpp::default_value); + multi_insert.values.add(t.gamma = true, t.beta = "cheesecake", t.delta = 1); + multi_insert.values.add(t.gamma = sqlpp::default_value, t.beta = sqlpp::default_value, t.delta = sqlpp::default_value); auto i = dynamic_insert_into(db, t).dynamic_set(); i.insert_list.add(t.beta = "kirschauflauf"); printer.reset(); diff --git a/tests/Interpret.cpp b/tests/Interpret.cpp index 834ee738..78c7d4cc 100644 --- a/tests/Interpret.cpp +++ b/tests/Interpret.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/tests/Prepared.cpp b/tests/Prepared.cpp index af5eadfd..50a34aa3 100644 --- a/tests/Prepared.cpp +++ b/tests/Prepared.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -32,7 +32,7 @@ int Prepared(int, char**) { MockDb db = {}; - //test::TabFoo f; + //test::TabFoo f; test::TabBar t; // empty parameter lists diff --git a/tests/Remove.cpp b/tests/Remove.cpp index e8092462..3d5a1516 100644 --- a/tests/Remove.cpp +++ b/tests/Remove.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/tests/Result.cpp b/tests/Result.cpp index 3bee2429..3be841d3 100644 --- a/tests/Result.cpp +++ b/tests/Result.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -37,7 +37,7 @@ int Result(int, char**) MockDb db = {}; EnforceDb edb {}; - test::TabBar t; + test::TabBar t; static_assert(sqlpp::can_be_null_t::value, "t.alpha can be null"); static_assert(not sqlpp::null_is_trivial_value_t::value, "t.alpha does not say null_is_trivial"); @@ -51,7 +51,7 @@ int Result(int, char**) using T = sqlpp::wrap_operand_t; static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); static_assert(sqlpp::is_result_field_t::value, "result_fields are not wrapped"); - + bool x = (t.alpha == row.alpha)._rhs._is_null(); bool y = (t.alpha == row.alpha)._rhs._is_default(); std::cerr << x << std::endl; diff --git a/tests/Select.cpp b/tests/Select.cpp index 7eddc76c..2d9c8feb 100644 --- a/tests/Select.cpp +++ b/tests/Select.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -48,7 +48,7 @@ int Select(int, char**) MockDb db = {}; MockDb::_serializer_context_t printer; - test::TabFoo f; + test::TabFoo f; test::TabBar t; const auto tab_a = f.as(sqlpp::alias::a); diff --git a/tests/SelectType.cpp b/tests/SelectType.cpp index 4afc20b7..0c8388b0 100644 --- a/tests/SelectType.cpp +++ b/tests/SelectType.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -46,7 +46,7 @@ int SelectType(int, char**) MockDb db = {}; MockDb::_serializer_context_t printer; - test::TabFoo f; + test::TabFoo f; test::TabBar t; // Test a table @@ -312,7 +312,7 @@ int SelectType(int, char**) using A = typename decltype(a)::_result_row_t; using B = typename decltype(b)::_result_row_t; static_assert(std::is_same< - sqlpp::value_type_of, + sqlpp::value_type_of, sqlpp::value_type_of>::value, "Two bigint columns must have identical base_value_type"); static_assert(std::is_same::value, "select with identical columns(name/value_type) need to have identical result_types"); } diff --git a/tests/Union.cpp b/tests/Union.cpp index caa7f9ff..08aedbc5 100644 --- a/tests/Union.cpp +++ b/tests/Union.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/tests/Update.cpp b/tests/Update.cpp index da93415a..49374938 100644 --- a/tests/Update.cpp +++ b/tests/Update.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ diff --git a/tests/With.cpp b/tests/With.cpp index 5c251293..2f227958 100644 --- a/tests/With.cpp +++ b/tests/With.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ From 09f23cea0a37b230545650b21911385f9529c26a Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 13 Sep 2015 21:33:19 +0200 Subject: [PATCH 031/122] Reformatted using clang-format Please use clang-format before submitting code, e.g via the pre-commit supplied in the repo (thanks AndiDog) --- .clang-format | 2 +- connector_api/bind_result.h | 112 +- connector_api/connection.h | 183 ++-- connector_api/interpreter.h | 41 +- connector_api/prepared_statement.h | 51 +- examples/Sample.h | 1 + examples/TabSample.h | 16 +- examples/insert.cpp | 44 +- examples/ppgen.cpp | 48 +- examples/remove.cpp | 12 +- examples/sample.cpp | 73 +- examples/select.cpp | 77 +- examples/update.cpp | 10 +- include/sqlpp11/alias.h | 63 +- include/sqlpp11/alias_provider.h | 123 +-- include/sqlpp11/all_of.h | 70 +- include/sqlpp11/any.h | 74 +- include/sqlpp11/assignment.h | 68 +- include/sqlpp11/auto_alias.h | 51 +- include/sqlpp11/avg.h | 151 +-- include/sqlpp11/bad_statement.h | 14 +- include/sqlpp11/basic_expression_operators.h | 193 ++-- include/sqlpp11/boolean.h | 324 +++--- include/sqlpp11/boolean_expression.h | 81 +- include/sqlpp11/char_sequence.h | 36 +- include/sqlpp11/column.h | 129 ++- include/sqlpp11/column_fwd.h | 5 +- include/sqlpp11/concat.h | 104 +- include/sqlpp11/connection.h | 5 +- include/sqlpp11/count.h | 151 +-- include/sqlpp11/cte.h | 360 +++---- include/sqlpp11/custom_query.h | 175 ++-- include/sqlpp11/default_value.h | 40 +- include/sqlpp11/detail/copy_tuple_args.h | 85 +- include/sqlpp11/detail/field_index_sequence.h | 76 +- include/sqlpp11/detail/get_first.h | 39 +- include/sqlpp11/detail/get_last.h | 39 +- include/sqlpp11/detail/index_sequence.h | 47 +- include/sqlpp11/detail/pick_arg.h | 39 +- include/sqlpp11/detail/sum.h | 46 +- include/sqlpp11/detail/type_set.h | 353 ++++--- include/sqlpp11/detail/type_vector.h | 89 +- include/sqlpp11/eval.h | 46 +- include/sqlpp11/exception.h | 17 +- include/sqlpp11/exists.h | 112 +- include/sqlpp11/expression.h | 375 ++++--- include/sqlpp11/expression_fwd.h | 289 +++--- include/sqlpp11/extra_tables.h | 236 +++-- include/sqlpp11/field_spec.h | 72 +- include/sqlpp11/floating_point.h | 418 ++++---- include/sqlpp11/from.h | 332 +++--- include/sqlpp11/functions.h | 156 +-- include/sqlpp11/group_by.h | 339 +++--- include/sqlpp11/having.h | 336 +++--- include/sqlpp11/hidden.h | 56 +- include/sqlpp11/in.h | 149 ++- include/sqlpp11/in_fwd.h | 9 +- include/sqlpp11/insert.h | 156 ++- include/sqlpp11/insert_value.h | 143 ++- include/sqlpp11/insert_value_list.h | 974 +++++++++--------- include/sqlpp11/integral.h | 472 +++++---- include/sqlpp11/interpret.h | 12 +- include/sqlpp11/interpret_tuple.h | 77 +- include/sqlpp11/interpretable.h | 168 +-- include/sqlpp11/interpretable_list.h | 135 ++- include/sqlpp11/interpreter.h | 17 +- include/sqlpp11/into.h | 260 ++--- include/sqlpp11/is_not_null.h | 86 +- include/sqlpp11/is_null.h | 86 +- include/sqlpp11/is_null_fwd.h | 8 +- include/sqlpp11/join.h | 198 ++-- include/sqlpp11/like.h | 94 +- include/sqlpp11/limit.h | 390 +++---- include/sqlpp11/logic.h | 69 +- include/sqlpp11/max.h | 112 +- include/sqlpp11/min.h | 112 +- include/sqlpp11/multi_column.h | 168 ++- include/sqlpp11/named_interpretable.h | 186 ++-- include/sqlpp11/no_data.h | 24 +- include/sqlpp11/no_value.h | 25 +- include/sqlpp11/noop.h | 105 +- include/sqlpp11/noop_fwd.h | 6 +- include/sqlpp11/not_in.h | 150 ++- include/sqlpp11/null.h | 35 +- include/sqlpp11/offset.h | 415 ++++---- include/sqlpp11/on.h | 93 +- include/sqlpp11/order_by.h | 339 +++--- include/sqlpp11/parameter.h | 85 +- include/sqlpp11/parameter_list.h | 57 +- include/sqlpp11/policy_update.h | 59 +- include/sqlpp11/ppgen.h | 188 ++-- include/sqlpp11/prepared_execute.h | 40 +- include/sqlpp11/prepared_insert.h | 40 +- include/sqlpp11/prepared_remove.h | 40 +- include/sqlpp11/prepared_select.h | 46 +- include/sqlpp11/prepared_update.h | 40 +- include/sqlpp11/remove.h | 160 ++- include/sqlpp11/result.h | 148 ++- include/sqlpp11/result_field.h | 48 +- include/sqlpp11/result_field_methods.h | 92 +- include/sqlpp11/result_row.h | 409 ++++---- include/sqlpp11/result_row_fwd.h | 8 +- include/sqlpp11/rhs_wrap.h | 239 +++-- include/sqlpp11/schema.h | 32 +- include/sqlpp11/schema_qualified_table.h | 88 +- include/sqlpp11/select.h | 108 +- include/sqlpp11/select_column_list.h | 864 ++++++++-------- include/sqlpp11/select_flag_list.h | 312 +++--- include/sqlpp11/select_flags.h | 99 +- include/sqlpp11/select_pseudo_table.h | 91 +- include/sqlpp11/serialize.h | 38 +- include/sqlpp11/serializer.h | 37 +- include/sqlpp11/serializer_context.h | 57 +- include/sqlpp11/simple_column.h | 48 +- include/sqlpp11/single_table.h | 235 +++-- include/sqlpp11/some.h | 73 +- include/sqlpp11/sort_order.h | 65 +- include/sqlpp11/sqlpp11.h | 2 - include/sqlpp11/statement.h | 444 ++++---- include/sqlpp11/statement_fwd.h | 4 +- include/sqlpp11/sum.h | 147 +-- include/sqlpp11/table.h | 131 +-- include/sqlpp11/table_alias.h | 70 +- include/sqlpp11/table_ref.h | 34 +- include/sqlpp11/text.h | 406 ++++---- include/sqlpp11/transaction.h | 105 +- include/sqlpp11/tvin.h | 234 ++--- include/sqlpp11/type_traits.h | 636 ++++++------ include/sqlpp11/union.h | 278 ++--- include/sqlpp11/union_data.h | 62 +- include/sqlpp11/union_flags.h | 61 +- include/sqlpp11/update.h | 138 ++- include/sqlpp11/update_list.h | 369 +++---- include/sqlpp11/using.h | 304 +++--- include/sqlpp11/value_or_null.h | 61 +- include/sqlpp11/value_type.h | 4 +- include/sqlpp11/value_type_fwd.h | 48 +- include/sqlpp11/verbatim.h | 75 +- include/sqlpp11/verbatim_table.h | 99 +- include/sqlpp11/where.h | 483 ++++----- include/sqlpp11/with.h | 245 ++--- include/sqlpp11/wrap_operand.h | 314 +++--- include/sqlpp11/wrap_operand_fwd.h | 9 +- include/sqlpp11/wrong.h | 26 +- pre-commit | 70 ++ test_constraints/count_of_count.cpp | 4 +- test_constraints/max_of_max.cpp | 4 +- test_constraints/must_not_insert.cpp | 4 +- test_constraints/must_not_update.cpp | 4 +- ...onversion_operator_if_null_not_trivial.cpp | 23 +- test_constraints/require_insert.cpp | 4 +- tests/BooleanExpression.cpp | 15 +- tests/CustomQuery.cpp | 56 +- tests/Function.cpp | 760 +++++++------- tests/Insert.cpp | 73 +- tests/Interpret.cpp | 291 +++--- tests/Minimalistic.cpp | 2 +- tests/MockDb.h | 405 ++++---- tests/Prepared.cpp | 175 ++-- tests/Remove.cpp | 55 +- tests/Result.cpp | 89 +- tests/Sample.h | 168 +-- tests/Select.cpp | 172 ++-- tests/SelectType.cpp | 640 ++++++------ tests/Union.cpp | 32 +- tests/Update.cpp | 63 +- tests/With.cpp | 23 +- tests/is_regular.h | 43 +- 168 files changed, 11984 insertions(+), 11583 deletions(-) create mode 100755 pre-commit diff --git a/.clang-format b/.clang-format index f94da0a4..1d9d0f26 100644 --- a/.clang-format +++ b/.clang-format @@ -14,7 +14,7 @@ BreakBeforeBinaryOperators: false BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BinPackParameters: false -ColumnLimit: 160 +ColumnLimit: 120 ConstructorInitializerAllOnOneLineOrOnePerLine: true DerivePointerAlignment: false ExperimentalAutoDetectBinPacking: false diff --git a/connector_api/bind_result.h b/connector_api/bind_result.h index d14de772..c269b925 100644 --- a/connector_api/bind_result.h +++ b/connector_api/bind_result.h @@ -1,17 +1,17 @@ /* * 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 @@ -24,7 +24,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef SQLPP_DATABASE_BIND_RESULT_H #define SQLPP_DATABASE_BIND_RESULT_H @@ -32,62 +31,61 @@ namespace sqlpp { - namespace database - { - /* - * bind_result_t binds values of a sqlpp11 result row - * to the results of a statement - */ - class bind_result_t - { - public: - bind_result_t(); // default constructor for a result that will not yield a valid row - bind_result_t(...); - bind_result_t(const bind_result_t&) = delete; - bind_result_t(bind_result_t&& rhs); - bind_result_t& operator=(const bind_result_t&) = delete; - bind_result_t& operator=(bind_result_t&&); - ~bind_result_t(); + namespace database + { + /* + * bind_result_t binds values of a sqlpp11 result row + * to the results of a statement + */ + class bind_result_t + { + public: + bind_result_t(); // default constructor for a result that will not yield a valid row + bind_result_t(...); + bind_result_t(const bind_result_t&) = delete; + bind_result_t(bind_result_t&& rhs); + bind_result_t& operator=(const bind_result_t&) = delete; + bind_result_t& operator=(bind_result_t&&); + ~bind_result_t(); - bool operator==(const bind_result_t& rhs) const; + bool operator==(const bind_result_t& rhs) const; - template - void next(ResultRow& result_row); + template + void next(ResultRow& result_row); - // something similar to this: - /* - { - if (!_handle) - { - result_row.invalidate(); - return; - } + // something similar to this: + /* + { + if (!_handle) + { + result_row.invalidate(); + return; + } - if (next_impl()) - { - if (not result_row) - { - result_row.validate(); - } - result_row._bind(*this); // bind result row values to results - } - else - { - if (result_row) - result_row.invalidate(); - } - }; - */ + if (next_impl()) + { + if (not result_row) + { + result_row.validate(); + } + result_row._bind(*this); // bind result row values to results + } + else + { + if (result_row) + result_row.invalidate(); + } + }; + */ - // These are called by the result row to bind individual result values - // More will be added over time - void _bind_boolean_result(size_t index, signed char* value, bool* is_null); - void _bind_floating_point_result(size_t index, double* value, bool* is_null); - void _bind_integral_result(size_t index, int64_t* value, bool* is_null); - void _bind_text_result(size_t index, const char** text, size_t* len); - ... - }; - - } + // These are called by the result row to bind individual result values + // More will be added over time + void _bind_boolean_result(size_t index, signed char* value, bool* is_null); + void _bind_floating_point_result(size_t index, double* value, bool* is_null); + void _bind_integral_result(size_t index, int64_t* value, bool* is_null); + void _bind_text_result(size_t index, const char** text, size_t* len); + ... + }; + } } #endif diff --git a/connector_api/connection.h b/connector_api/connection.h index 9a23d8b7..dc2f81c2 100644 --- a/connector_api/connection.h +++ b/connector_api/connection.h @@ -1,17 +1,17 @@ /* * 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 @@ -24,122 +24,125 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef SQLPP_DATABASE_CONNECTION_H #define SQLPP_DATABASE_CONNECTION_H #include #include -#include // You may use char result or bind result or both -#include // to represent results of select and prepared select +#include // You may use char result or bind result or both +#include // to represent results of select and prepared select namespace sqlpp { - namespace database - { - // The context is not a requirement, but if the database requires - // any deviations from the SQL standard, you should use your own - // context in order to specialize the behaviour, see also interpreter.h - struct context_t - { - template - std::ostream& operator<<(T t); + namespace database + { + // The context is not a requirement, but if the database requires + // any deviations from the SQL standard, you should use your own + // context in order to specialize the behaviour, see also interpreter.h + struct context_t + { + template + std::ostream& operator<<(T t); - std::string escape(std::string arg); - }; + std::string escape(std::string arg); + }; - class connection: public sqlpp::connection // this inheritance helps with ADL for dynamic_select, for instance - { - public: - using _traits = ::sqlpp::make_traits<::sqlpp::no_value_t, - ::sqlpp::tag::enforce_null_result_treatment // If that is what you really want, leave it out otherwise - >; + class connection : public sqlpp::connection // this inheritance helps with ADL for dynamic_select, for instance + { + public: + using _traits = ::sqlpp::make_traits< + ::sqlpp::no_value_t, + ::sqlpp::tag::enforce_null_result_treatment // If that is what you really want, leave it out otherwise + >; - using _prepared_statement_t = << handle to a prepared statement of the database >>; - using _serializer_context_t = << This context is used to serialize a statement >> - using _interpreter_context_t = << This context is used interpret a statement >>; - // serializer and interpreter are typically the same for string based connectors - // the types are required for dynamic statement components, see sqlpp11/interpretable.h + using _prepared_statement_t = << handle to a prepared statement of the database >> ; + using _serializer_context_t = << This context is used to serialize a statement >> using _interpreter_context_t = + << This context is used interpret a statement >> + ; + // serializer and interpreter are typically the same for string based connectors + // the types are required for dynamic statement components, see sqlpp11/interpretable.h - connection(...); - ~connection(); - connection(const connection&) = delete; - connection(connection&&) = delete; - connection& operator=(const connection&) = delete; - connection& operator=(connection&&) = delete; + connection(...); + ~connection(); + connection(const connection&) = delete; + connection(connection&&) = delete; + connection& operator=(const connection&) = delete; + connection& operator=(connection&&) = delete; - //! "direct" select - template - <> select(const Select& s); + //! "direct" select + template + << bind_result_t >> + select(const Select& s); - //! prepared select - template - _prepared_statement_t prepare_select(Select& s); + //! prepared select + template + _prepared_statement_t prepare_select(Select& s); - template - <> run_prepared_select(const PreparedSelect& s); // call s._bind_params() + template + << bind_result_t >> + run_prepared_select(const PreparedSelect& s); // call s._bind_params() - //! "direct insert - template - size_t insert(const Insert& i); + //! "direct insert + template + size_t insert(const Insert& i); - //! prepared insert - template - _prepared_statement_t prepare_insert(Insert& i); + //! prepared insert + template + _prepared_statement_t prepare_insert(Insert& i); - template - size_t run_prepared_insert(const PreparedInsert& i); // call i._bind_params() + template + size_t run_prepared_insert(const PreparedInsert& i); // call i._bind_params() - //! "direct" update - template - size_t update(const Update& u); + //! "direct" update + template + size_t update(const Update& u); - //! "prepared" update - template - _prepared_statement_t prepare_update(Update& u); + //! "prepared" update + template + _prepared_statement_t prepare_update(Update& u); - template - size_t run_prepared_update(const PreparedUpdate& u); // call u._bind_params() + template + size_t run_prepared_update(const PreparedUpdate& u); // call u._bind_params() - //! "direct" remove - template - size_t remove(const Remove& r) + //! "direct" remove + template + size_t remove(const Remove& r) - //! prepared remove - template - _prepared_statement_t prepare_remove(Remove& r); + //! prepared remove + template + _prepared_statement_t prepare_remove(Remove& r); - template - size_t run_prepared_remove(const PreparedRemove& r); // call r._bind_params() + template + size_t run_prepared_remove(const PreparedRemove& r); // call r._bind_params() - //! call run on the argument - template - auto operator() (const T& t) -> decltype(t._run(*this)) - { - return t._run(*this); - } + //! call run on the argument + template + auto operator()(const T& t) -> decltype(t._run(*this)) + { + return t._run(*this); + } - //! call prepare on the argument - template - auto prepare(const T& t) -> decltype(t._prepare(*this)) - { - return t._prepare(*this); - } + //! call prepare on the argument + template + auto prepare(const T& t) -> decltype(t._prepare(*this)) + { + return t._prepare(*this); + } - //! start transaction - void start_transaction(); + //! start transaction + void start_transaction(); - //! commit transaction (or throw transaction if the transaction has been finished already) - void commit_transaction(); + //! commit transaction (or throw transaction if the transaction has been finished already) + void commit_transaction(); - //! rollback transaction with or without reporting the rollback (or throw if the transaction has been finished already) - void rollback_transaction(bool report); + //! rollback transaction with or without reporting the rollback (or throw if the transaction has been finished + // already) + void rollback_transaction(bool report); - //! report a rollback failure (will be called by transactions in case of a rollback failure in the destructor) - void report_rollback_failure(const std::string message) noexcept; - }; - - } + //! report a rollback failure (will be called by transactions in case of a rollback failure in the destructor) + void report_rollback_failure(const std::string message) noexcept; + }; + } } #include diff --git a/connector_api/interpreter.h b/connector_api/interpreter.h index d59add96..fd694635 100644 --- a/connector_api/interpreter.h +++ b/connector_api/interpreter.h @@ -1,17 +1,17 @@ /* * 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 @@ -31,32 +31,31 @@ #include /* - * sqlpp11 offers an interpreter that can be used to serialize the expression tree + * sqlpp11 offers an interpreter that can be used to serialize the expression tree * into a standard SQL string. * - * The connector library can specialize the interpreter template to partially or + * The connector library can specialize the interpreter template to partially or * completely change the way the expression tree is interpreted. * * For example, this specialization will produce indexed parameters instead of just '?' */ namespace sqlpp { - namespace vendor - { - template - struct interpreter_t> - { - using T = parameter_t; + namespace vendor + { + template + struct interpreter_t> + { + using T = parameter_t; - static database::context_t& _(const T& t, database::context_t& context) - { - context << "?" << context.count(); - context.pop_count(); - return context; - } - }; - - } + static database::context_t& _(const T& t, database::context_t& context) + { + context << "?" << context.count(); + context.pop_count(); + return context; + } + }; + } } #endif diff --git a/connector_api/prepared_statement.h b/connector_api/prepared_statement.h index 1524e0f0..7a329788 100644 --- a/connector_api/prepared_statement.h +++ b/connector_api/prepared_statement.h @@ -1,17 +1,17 @@ /* * 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 @@ -24,7 +24,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef SQLPP_DATABASE_PREPARED_STATEMENT_H #define SQLPP_DATABASE_PREPARED_STATEMENT_H @@ -33,28 +32,28 @@ namespace sqlpp { - namespace database - { - class prepared_statement_t - { - public: - prepared_statement_t() = delete; - prepared_statement_t(...); - prepared_statement_t(const prepared_statement_t&) = delete; - prepared_statement_t(prepared_statement_t&& rhs); - prepared_statement_t& operator=(const prepared_statement_t&) = delete; - prepared_statement_t& operator=(prepared_statement_t&&); - ~prepared_statement_t(); + namespace database + { + class prepared_statement_t + { + public: + prepared_statement_t() = delete; + prepared_statement_t(...); + prepared_statement_t(const prepared_statement_t&) = delete; + prepared_statement_t(prepared_statement_t&& rhs); + prepared_statement_t& operator=(const prepared_statement_t&) = delete; + prepared_statement_t& operator=(prepared_statement_t&&); + ~prepared_statement_t(); - bool operator==(const prepared_statement_t& rhs) const; + bool operator==(const prepared_statement_t& rhs) const; - // These are called by the sqlpp11::prepared_*_t to bind the individual parameters - // More will be added over time - void _bind_boolean_parameter(size_t index, const signed char* value, bool is_null); - void _bind_floating_point_parameter(size_t index, const double* value, bool is_null); - void _bind_integral_parameter(size_t index, const int64_t* value, bool is_null); - void _bind_text_parameter(size_t index, const std::string* value, bool is_null); - }; - } + // These are called by the sqlpp11::prepared_*_t to bind the individual parameters + // More will be added over time + void _bind_boolean_parameter(size_t index, const signed char* value, bool is_null); + void _bind_floating_point_parameter(size_t index, const double* value, bool is_null); + void _bind_integral_parameter(size_t index, const int64_t* value, bool is_null); + void _bind_text_parameter(size_t index, const std::string* value, bool is_null); + }; + } } #endif diff --git a/examples/Sample.h b/examples/Sample.h index 01e7d92d..a4512a88 100644 --- a/examples/Sample.h +++ b/examples/Sample.h @@ -5,6 +5,7 @@ #include #include +// clang-format off namespace test { namespace TabPerson_ diff --git a/examples/TabSample.h b/examples/TabSample.h index 09e7f1ea..9cadacf7 100644 --- a/examples/TabSample.h +++ b/examples/TabSample.h @@ -1,17 +1,17 @@ /* * 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 @@ -30,7 +30,7 @@ #include #include - +// clang-format off namespace TabFoo_ { struct Omega @@ -60,7 +60,7 @@ namespace TabFoo_ } struct TabFoo: sqlpp::table_base_t< - TabFoo, + TabFoo, TabFoo_::Omega > { @@ -151,8 +151,8 @@ namespace TabSample_ } struct TabSample: sqlpp::table_base_t< - TabSample, - TabSample_::Alpha, + TabSample, + TabSample_::Alpha, TabSample_::Beta, TabSample_::Gamma > diff --git a/examples/insert.cpp b/examples/insert.cpp index 107e806c..ab3d0bdb 100644 --- a/examples/insert.cpp +++ b/examples/insert.cpp @@ -29,40 +29,38 @@ int insert(int, char**) { - MockDb db; + MockDb db; - test::TabPerson p; - test::TabFeature f; + test::TabPerson p; + test::TabFeature f; - db(insert_into(f).set(f.name = "loves c++", f.fatal = false)); + db(insert_into(f).set(f.name = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.nahme = "loves c++", f.fatal = false)); + // db(insert_into(f).set(f.nahme = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name == "loves c++", f.fatal = false)); + // db(insert_into(f).set(f.name == "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name = "loves c++", f.fatal = "false")); + // db(insert_into(f).set(f.name = "loves c++", f.fatal = "false")); - //db(insert_into(p).set(f.name = "loves c++", f.fatal = false)); + // db(insert_into(p).set(f.name = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name = "loves c++", p.feature = 7)); + // db(insert_into(f).set(f.name = "loves c++", p.feature = 7)); - //db(insert_into(f).set(f.id = 42, f.name = "loves c++", f.fatal = false)); + // db(insert_into(f).set(f.id = 42, f.name = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name = "loves c++")); + // db(insert_into(f).set(f.name = "loves c++")); + db(insert_into(f).default_values()); - db(insert_into(f).default_values()); + auto i = insert_into(p).columns(p.name, p.feature); + i.values.add(p.name = "Roland", p.feature = 1); + i.values.add(p.name = "Zaphod", p.feature = sqlpp::default_value); + db(i); - auto i = insert_into(p).columns(p.name, p.feature); - i.values.add(p.name = "Roland", p.feature = 1); - i.values.add(p.name = "Zaphod", p.feature = sqlpp::default_value); - db(i); + auto pi = db.prepare(insert_into(p).set(p.name = parameter(f.name), p.feature = parameter(p.feature))); + pi.params.name = "likes java"; + pi.params.feature = true; - - auto pi = db.prepare(insert_into(p).set(p.name = parameter(f.name), p.feature = parameter(p.feature))); - pi.params.name = "likes java"; - pi.params.feature = true; - - db(pi); - return 0; + db(pi); + return 0; } diff --git a/examples/ppgen.cpp b/examples/ppgen.cpp index 48ca5610..56374a22 100644 --- a/examples/ppgen.cpp +++ b/examples/ppgen.cpp @@ -24,7 +24,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if 0 // syntax example +#if 0 // syntax example SQLPP_DECLARE_TABLE( (table, \ SQLPP_DROP_IF_EXISTS \ @@ -45,6 +45,7 @@ SQLPP_DECLARE_TABLE( #include "MockDb.h" +// clang-format off SQLPP_DECLARE_TABLE( (tab_person) , @@ -60,42 +61,41 @@ SQLPP_DECLARE_TABLE( (name , varchar(255), SQLPP_NULL ) (fatal, bool , SQLPP_NOT_NULL ) ) +// clang-format on int ppgen(int, char**) { - MockDb db; - tab_person::tab_person p; - tab_feature::tab_feature f; + MockDb db; + tab_person::tab_person p; + tab_feature::tab_feature f; - db(insert_into(f).set(f.name = "loves c++", f.fatal = false)); + db(insert_into(f).set(f.name = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.nahme = "loves c++", f.fatal = false)); + // db(insert_into(f).set(f.nahme = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name == "loves c++", f.fatal = false)); + // db(insert_into(f).set(f.name == "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name = "loves c++", f.fatal = "false")); + // db(insert_into(f).set(f.name = "loves c++", f.fatal = "false")); - //db(insert_into(p).set(f.name = "loves c++", f.fatal = false)); + // db(insert_into(p).set(f.name = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name = "loves c++", p.feature = 7)); + // db(insert_into(f).set(f.name = "loves c++", p.feature = 7)); - //db(insert_into(f).set(f.id = 42, f.name = "loves c++", f.fatal = false)); + // db(insert_into(f).set(f.id = 42, f.name = "loves c++", f.fatal = false)); - //db(insert_into(f).set(f.name = "loves c++")); + // db(insert_into(f).set(f.name = "loves c++")); + db(insert_into(f).default_values()); - db(insert_into(f).default_values()); + auto i = insert_into(p).columns(p.name, p.feature); + i.values.add(p.name = "Roland", p.feature = 1); + i.values.add(p.name = "Zaphod", p.feature = sqlpp::default_value); + db(i); - auto i = insert_into(p).columns(p.name, p.feature); - i.values.add(p.name = "Roland", p.feature = 1); - i.values.add(p.name = "Zaphod", p.feature = sqlpp::default_value); - db(i); + auto pi = db.prepare(insert_into(p).set(p.name = parameter(f.name), p.feature = parameter(p.feature))); + pi.params.name = "likes java"; + pi.params.feature = true; - - auto pi = db.prepare(insert_into(p).set(p.name = parameter(f.name), p.feature = parameter(p.feature))); - pi.params.name = "likes java"; - pi.params.feature = true; - - db(pi); - return 0; + db(pi); + return 0; } diff --git a/examples/remove.cpp b/examples/remove.cpp index 84cdb8b4..c2b41b1d 100644 --- a/examples/remove.cpp +++ b/examples/remove.cpp @@ -29,13 +29,11 @@ int remove(int, char**) { - MockDb db; + MockDb db; - test::TabPerson p; - test::TabFeature q; + test::TabPerson p; + test::TabFeature q; - db(remove_from(p) - .using_(p, q) - .where(p.feature == q.id and q.fatal == true)); - return 0; + db(remove_from(p).using_(p, q).where(p.feature == q.id and q.fatal == true)); + return 0; } diff --git a/examples/sample.cpp b/examples/sample.cpp index d3b71849..e506f443 100644 --- a/examples/sample.cpp +++ b/examples/sample.cpp @@ -1,25 +1,25 @@ /* * Copyright (c) 2014-2015 Roland Bock * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 + * + * 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. */ @@ -29,31 +29,28 @@ int main() { - MockDb db; + MockDb db; - test::TabPerson p; - test::TabFeature f; + test::TabPerson p; + test::TabFeature f; - db(insert_into(f).set(f.name = "Loves C++", p.fatal = false)); + db(insert_into(f).set(f.name = "Loves C++", p.fatal = false)); - db(insert_into(f).set(p.name = "Roland", p.feature = 1)); + db(insert_into(f).set(p.name = "Roland", p.feature = 1)); - auto s = select(all_of(p)) - .from(p, q) - .where(p.name == any(select(q.name) - .from(q) - .where(true))) - .group_by(q.name) - .having(p.name.like("%Bee%")) - .order_by(p.name.asc()) - .limit(3).offset(7); + auto s = select(all_of(p)) + .from(p, q) + .where(p.name == any(select(q.name).from(q).where(true))) + .group_by(q.name) + .having(p.name.like("%Bee%")) + .order_by(p.name.asc()) + .limit(3) + .offset(7); - auto x = s.as(sqlpp::alias::x); - for (const auto& row : db(select(p.id, x.name) - .from(p.join(x).on(p.feature == x.feature)) - .where(true))) - { - int id = row.id; - std::string name = row.name; - } + auto x = s.as(sqlpp::alias::x); + for (const auto& row : db(select(p.id, x.name).from(p.join(x).on(p.feature == x.feature)).where(true))) + { + int id = row.id; + std::string name = row.name; + } } diff --git a/examples/select.cpp b/examples/select.cpp index 1b9849d4..77265d99 100644 --- a/examples/select.cpp +++ b/examples/select.cpp @@ -38,23 +38,22 @@ SQLPP_ALIAS_PROVIDER(cheesecake) int select(int, char**) { - static constexpr bool some_condition = true; - static constexpr bool some_other_condition = false; + static constexpr bool some_condition = true; + static constexpr bool some_other_condition = false; - MockDb db; + MockDb db; - test::TabPerson p; - test::TabFeature f; + test::TabPerson p; + test::TabFeature f; - for (const auto& row : db(select(all_of(p)).from(p).where(p.id > 7))) - { - int64_t id = row.id; - std::string name = row.name; - int64_t feature = row.feature; - } + for (const auto& row : db(select(all_of(p)).from(p).where(p.id > 7))) + { + int64_t id = row.id; + std::string name = row.name; + int64_t feature = row.feature; + } - -#if 0 +#if 0 for (const auto& row : db(select(p.name).from(p).where(p.name.like("Herb%")))) { int64_t id = row.id; @@ -63,8 +62,6 @@ int select(int, char**) } #endif - - #if 0 for (const auto& row : db(select(p.name, f.name.as(cheesecake)).from(p,f).where(p.id > 7 and p.feature == 3))) { @@ -75,8 +72,6 @@ int select(int, char**) } #endif - - #if 0 for (const auto& row : db(select(multi_column(all_of(p)).as(p), multi_column(f.name, f.id).as(f)).from(p,f).where(true))) { @@ -88,12 +83,6 @@ int select(int, char**) } #endif - - - - - - #if 0 auto s = select(p.id, p.name, f.id.as(cheesecake)) .from(p, f) @@ -117,41 +106,21 @@ int select(int, char**) } #endif - - #if !0 - auto dysel = dynamic_select(db).dynamic_columns(p.name).from(p).dynamic_where(); + auto dysel = dynamic_select(db).dynamic_columns(p.name).from(p).dynamic_where(); - if (some_condition) - dysel.selected_columns.add(p.feature); + if (some_condition) + dysel.selected_columns.add(p.feature); - if (some_other_condition) - dysel.where.add(p.id > 17); + if (some_other_condition) + dysel.where.add(p.id > 17); - for (const auto& row : db(dysel)) - { - std::string name = row.name; - std::string feature = row.at("feature"); - } + for (const auto& row : db(dysel)) + { + std::string name = row.name; + std::string feature = row.at("feature"); + } #endif - - - - - - - - - - - - - - - - - - - return 0; + return 0; } diff --git a/examples/update.cpp b/examples/update.cpp index 887535f5..a6f0b0c5 100644 --- a/examples/update.cpp +++ b/examples/update.cpp @@ -29,11 +29,11 @@ int update(int, char**) { - MockDb db; + MockDb db; - test::TabPerson p; - //test::TabFeature q; + test::TabPerson p; + // test::TabFeature q; - db(update(p).set(p.feature = 7).where(p.id == 23)); - return 0; + db(update(p).set(p.feature = 7).where(p.id == 23)); + return 0; } diff --git a/include/sqlpp11/alias.h b/include/sqlpp11/alias.h index 18ecc1da..0a041a9e 100644 --- a/include/sqlpp11/alias.h +++ b/include/sqlpp11/alias.h @@ -32,45 +32,44 @@ namespace sqlpp { - template - struct expression_alias_t - { - using _traits = make_traits, tag::is_selectable, tag::is_alias>; - using _nodes = detail::type_vector; + template + struct expression_alias_t + { + using _traits = make_traits, tag::is_selectable, tag::is_alias>; + using _nodes = detail::type_vector; - static_assert(is_expression_t::value, "invalid argument for an expression alias"); - static_assert(not is_alias_t::value, "cannot create an alias of an alias"); + static_assert(is_expression_t::value, "invalid argument for an expression alias"); + static_assert(not is_alias_t::value, "cannot create an alias of an alias"); - using _alias_t = typename AliasProvider::_alias_t; + using _alias_t = typename AliasProvider::_alias_t; - expression_alias_t(Expression expression): - _expression(expression) - {} + expression_alias_t(Expression expression) : _expression(expression) + { + } - expression_alias_t(const expression_alias_t&) = default; - expression_alias_t(expression_alias_t&&) = default; - expression_alias_t& operator=(const expression_alias_t&) = default; - expression_alias_t& operator=(expression_alias_t&&) = default; - ~expression_alias_t() = default; + expression_alias_t(const expression_alias_t&) = default; + expression_alias_t(expression_alias_t&&) = default; + expression_alias_t& operator=(const expression_alias_t&) = default; + expression_alias_t& operator=(expression_alias_t&&) = default; + ~expression_alias_t() = default; - Expression _expression; - }; + Expression _expression; + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = expression_alias_t; - - static Context& _(const T& t, Context& context) - { - serialize_operand(t._expression, context); - context << " AS "; - context << name_of::char_ptr(); - return context; - } - }; + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = expression_alias_t; + static Context& _(const T& t, Context& context) + { + serialize_operand(t._expression, context); + context << " AS "; + context << name_of::char_ptr(); + return context; + } + }; } #endif diff --git a/include/sqlpp11/alias_provider.h b/include/sqlpp11/alias_provider.h index cd59b2b2..38bbf528 100644 --- a/include/sqlpp11/alias_provider.h +++ b/include/sqlpp11/alias_provider.h @@ -30,69 +30,76 @@ #include #include -#define SQLPP_ALIAS_PROVIDER(name) \ - struct name##_t\ -{\ - struct _alias_t\ - {\ - static constexpr const char _literal[] = #name;\ - using _name_t = sqlpp::make_char_sequence;\ - template\ - struct _member_t\ - {\ - T name;\ - T& operator()() { return name; }\ - const T& operator()() const { return name; }\ - };\ - };\ -};\ -constexpr name##_t name = {}; +#define SQLPP_ALIAS_PROVIDER(name) \ + struct name##_t \ + { \ + struct _alias_t \ + { \ + static constexpr const char _literal[] = #name; \ + using _name_t = sqlpp::make_char_sequence; \ + template \ + struct _member_t \ + { \ + T name; \ + T& operator()() \ + { \ + return name; \ + } \ + const T& operator()() const \ + { \ + return name; \ + } \ + }; \ + }; \ + }; \ + constexpr name##_t name = {}; namespace sqlpp { - template - struct is_alias_provider_t - { - static constexpr bool value = false; - }; + template + struct is_alias_provider_t + { + static constexpr bool value = false; + }; - template - struct is_alias_provider_t>::value, void>::type> - { - static constexpr bool value = true; - }; + template + struct is_alias_provider_t< + T, + typename std::enable_if>::value, void>::type> + { + static constexpr bool value = true; + }; - namespace alias - { - SQLPP_ALIAS_PROVIDER(a) - SQLPP_ALIAS_PROVIDER(b) - SQLPP_ALIAS_PROVIDER(c) - SQLPP_ALIAS_PROVIDER(d) - SQLPP_ALIAS_PROVIDER(e) - SQLPP_ALIAS_PROVIDER(f) - SQLPP_ALIAS_PROVIDER(g) - SQLPP_ALIAS_PROVIDER(h) - SQLPP_ALIAS_PROVIDER(i) - SQLPP_ALIAS_PROVIDER(j) - SQLPP_ALIAS_PROVIDER(k) - SQLPP_ALIAS_PROVIDER(l) - SQLPP_ALIAS_PROVIDER(m) - SQLPP_ALIAS_PROVIDER(n) - SQLPP_ALIAS_PROVIDER(o) - SQLPP_ALIAS_PROVIDER(p) - SQLPP_ALIAS_PROVIDER(q) - SQLPP_ALIAS_PROVIDER(s) - SQLPP_ALIAS_PROVIDER(t) - SQLPP_ALIAS_PROVIDER(u) - SQLPP_ALIAS_PROVIDER(v) - SQLPP_ALIAS_PROVIDER(w) - SQLPP_ALIAS_PROVIDER(x) - SQLPP_ALIAS_PROVIDER(y) - SQLPP_ALIAS_PROVIDER(z) - SQLPP_ALIAS_PROVIDER(left) - SQLPP_ALIAS_PROVIDER(right) - } + namespace alias + { + SQLPP_ALIAS_PROVIDER(a) + SQLPP_ALIAS_PROVIDER(b) + SQLPP_ALIAS_PROVIDER(c) + SQLPP_ALIAS_PROVIDER(d) + SQLPP_ALIAS_PROVIDER(e) + SQLPP_ALIAS_PROVIDER(f) + SQLPP_ALIAS_PROVIDER(g) + SQLPP_ALIAS_PROVIDER(h) + SQLPP_ALIAS_PROVIDER(i) + SQLPP_ALIAS_PROVIDER(j) + SQLPP_ALIAS_PROVIDER(k) + SQLPP_ALIAS_PROVIDER(l) + SQLPP_ALIAS_PROVIDER(m) + SQLPP_ALIAS_PROVIDER(n) + SQLPP_ALIAS_PROVIDER(o) + SQLPP_ALIAS_PROVIDER(p) + SQLPP_ALIAS_PROVIDER(q) + SQLPP_ALIAS_PROVIDER(s) + SQLPP_ALIAS_PROVIDER(t) + SQLPP_ALIAS_PROVIDER(u) + SQLPP_ALIAS_PROVIDER(v) + SQLPP_ALIAS_PROVIDER(w) + SQLPP_ALIAS_PROVIDER(x) + SQLPP_ALIAS_PROVIDER(y) + SQLPP_ALIAS_PROVIDER(z) + SQLPP_ALIAS_PROVIDER(left) + SQLPP_ALIAS_PROVIDER(right) + } } #endif - diff --git a/include/sqlpp11/all_of.h b/include/sqlpp11/all_of.h index b8f59bed..4c4076cd 100644 --- a/include/sqlpp11/all_of.h +++ b/include/sqlpp11/all_of.h @@ -33,48 +33,46 @@ namespace sqlpp { - template - struct all_of_t - { - using _column_tuple_t = typename Table::_column_tuple_t; + template + struct all_of_t + { + using _column_tuple_t = typename Table::_column_tuple_t; - template - detail::copy_tuple_args_t as(const AliasProvider& alias) - { - return multi_column(_column_tuple_t{}).as(alias); - } - }; + template + detail::copy_tuple_args_t as(const AliasProvider& alias) + { + return multi_column(_column_tuple_t{}).as(alias); + } + }; - template - auto all_of(Table) -> all_of_t
- { - return {}; - } + template + auto all_of(Table) -> all_of_t
+ { + return {}; + } - struct assert_no_stand_alone_all_of_t - { - using type = std::false_type; + struct assert_no_stand_alone_all_of_t + { + using type = std::false_type; - template - static void _() - { - static_assert(wrong_t::value, "all_of(table) seems to be used outside of select"); - } - }; + template + static void _() + { + static_assert(wrong_t::value, "all_of(table) seems to be used outside of select"); + } + }; - template - struct serializer_t> - { - using _serialize_check = assert_no_stand_alone_all_of_t; - using T = all_of_t
; - - static Context& _(const T&, const Context&) - { - _serialize_check::_(); - } - }; + template + struct serializer_t> + { + using _serialize_check = assert_no_stand_alone_all_of_t; + using T = all_of_t
; + static Context& _(const T&, const Context&) + { + _serialize_check::_(); + } + }; } #endif - diff --git a/include/sqlpp11/any.h b/include/sqlpp11/any.h index daf92732..f7d7885b 100644 --- a/include/sqlpp11/any.h +++ b/include/sqlpp11/any.h @@ -33,49 +33,49 @@ namespace sqlpp { - template - struct any_t - { - using _traits = make_traits, tag::is_multi_expression>; - using _nodes = detail::type_vector; - any_t(Select select): - _select(select) - {} + any_t(Select select) : _select(select) + { + } - any_t(const any_t&) = default; - any_t(any_t&&) = default; - any_t& operator=(const any_t&) = default; - any_t& operator=(any_t&&) = default; - ~any_t() = default; + any_t(const any_t&) = default; + any_t(any_t&&) = default; + any_t& operator=(const any_t&) = default; + any_t& operator=(any_t&&) = default; + ~any_t() = default; - Select _select; - }; + Select _select; + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = any_t; - static Context& _(const T& t, Context& context) - { - context << "ANY("; - serialize(t._select, context); - context << ")"; - return context; - } - }; - - template - auto any(T t) -> any_t> - { - static_assert(is_select_t>::value, "any() requires a select expression as argument"); - static_assert(is_expression_t>::value, "any() requires a single column select expression as argument"); - // FIXME: can we accept non-values like NULL here? - return { t }; - } + static Context& _(const T& t, Context& context) + { + context << "ANY("; + serialize(t._select, context); + context << ")"; + return context; + } + }; + template + auto any(T t) -> any_t> + { + static_assert(is_select_t>::value, "any() requires a select expression as argument"); + static_assert(is_expression_t>::value, + "any() requires a single column select expression as argument"); + // FIXME: can we accept non-values like NULL here? + return {t}; + } } #endif diff --git a/include/sqlpp11/assignment.h b/include/sqlpp11/assignment.h index 6e00160d..7517f8f5 100644 --- a/include/sqlpp11/assignment.h +++ b/include/sqlpp11/assignment.h @@ -37,46 +37,46 @@ namespace sqlpp { - template - struct assignment_t - { - using _traits = make_traits; - using _lhs_t = Lhs; - using _rhs_t = rhs_wrap_t, trivial_value_is_null_t<_lhs_t>::value>; - using _nodes = detail::type_vector<_lhs_t, _rhs_t>; + template + struct assignment_t + { + using _traits = make_traits; + using _lhs_t = Lhs; + using _rhs_t = rhs_wrap_t, trivial_value_is_null_t<_lhs_t>::value>; + using _nodes = detail::type_vector<_lhs_t, _rhs_t>; - static_assert(can_be_null_t<_lhs_t>::value ? true : not (std::is_same<_rhs_t, null_t>::value or is_tvin_t<_rhs_t>::value), "column must not be null"); + static_assert(can_be_null_t<_lhs_t>::value ? true + : not(std::is_same<_rhs_t, null_t>::value or is_tvin_t<_rhs_t>::value), + "column must not be null"); - assignment_t(_lhs_t lhs, _rhs_t rhs): - _lhs(lhs), - _rhs(rhs) - {} + 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; + 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; - }; + _lhs_t _lhs; + _rhs_t _rhs; + }; - template - struct serializer_t> - { - using T = assignment_t; - using _serialize_check = serialize_check_of; - - static Context& _(const T& t, Context& context) - { - serialize(simple_column(t._lhs), context); - context << "="; - serialize_operand(t._rhs, context); - return context; - } - }; + template + struct serializer_t> + { + using T = assignment_t; + using _serialize_check = serialize_check_of; + static Context& _(const T& t, Context& context) + { + serialize(simple_column(t._lhs), context); + context << "="; + serialize_operand(t._rhs, context); + return context; + } + }; } #endif diff --git a/include/sqlpp11/auto_alias.h b/include/sqlpp11/auto_alias.h index 7b2c9da9..43ce044c 100644 --- a/include/sqlpp11/auto_alias.h +++ b/include/sqlpp11/auto_alias.h @@ -31,36 +31,35 @@ namespace sqlpp { - template - struct has_auto_alias_t - { - static constexpr bool value = false; - }; + template + struct has_auto_alias_t + { + static constexpr bool value = false; + }; - template - struct has_auto_alias_t::value>::type> - { - static constexpr bool value = true; - }; + template + struct has_auto_alias_t::value>::type> + { + static constexpr bool value = true; + }; - namespace detail - { - template - struct auto_alias_impl - { - using type = T; - }; + namespace detail + { + template + struct auto_alias_impl + { + using type = T; + }; - template - struct auto_alias_impl::value>::type> - { - using type = expression_alias_t; - }; - } + template + struct auto_alias_impl::value>::type> + { + using type = expression_alias_t; + }; + } - template - using auto_alias_t = typename detail::auto_alias_impl::type; + template + using auto_alias_t = typename detail::auto_alias_impl::type; } - #endif diff --git a/include/sqlpp11/avg.h b/include/sqlpp11/avg.h index 5a23a851..9a4aa642 100644 --- a/include/sqlpp11/avg.h +++ b/include/sqlpp11/avg.h @@ -32,88 +32,95 @@ namespace sqlpp { - struct avg_alias_t - { - struct _alias_t - { - static constexpr const char _literal[] = "avg_"; - using _name_t = sqlpp::make_char_sequence; - template - struct _member_t - { - T avg; - T& operator()() { return avg; } - const T& operator()() const { return avg; } - }; - }; - }; + struct avg_alias_t + { + struct _alias_t + { + static constexpr const char _literal[] = "avg_"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T avg; + T& operator()() + { + return avg; + } + const T& operator()() const + { + return avg; + } + }; + }; + }; - template - struct avg_t: - public expression_operators, floating_point>, - public alias_operators> - { - using _traits = make_traits; - using _nodes = detail::type_vector; + template + struct avg_t : public expression_operators, floating_point>, + public alias_operators> + { + using _traits = make_traits; + using _nodes = detail::type_vector; - static_assert(is_noop::value or std::is_same::value, "avg() used with flag other than 'distinct'"); - static_assert(is_numeric_t::value, "avg() requires a value expression as argument"); + static_assert(is_noop::value or std::is_same::value, + "avg() used with flag other than 'distinct'"); + static_assert(is_numeric_t::value, "avg() requires a value expression as argument"); - using _auto_alias_t = avg_alias_t; + using _auto_alias_t = avg_alias_t; - avg_t(Expr expr): - _expr(expr) - {} + avg_t(Expr expr) : _expr(expr) + { + } - avg_t(const avg_t&) = default; - avg_t(avg_t&&) = default; - avg_t& operator=(const avg_t&) = default; - avg_t& operator=(avg_t&&) = default; - ~avg_t() = default; + avg_t(const avg_t&) = default; + avg_t(avg_t&&) = default; + avg_t& operator=(const avg_t&) = default; + avg_t& operator=(avg_t&&) = default; + ~avg_t() = default; - Expr _expr; - }; + Expr _expr; + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = avg_t; + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = avg_t; - static Context& _(const T& t, Context& context) - { - context << "AVG("; - if (std::is_same::value) - { - serialize(Flag(), context); - context << ' '; - serialize_operand(t._expr, context); - } - else - { - serialize(t._expr, context); - } - context << ")"; - return context; - } - }; + static Context& _(const T& t, Context& context) + { + context << "AVG("; + if (std::is_same::value) + { + serialize(Flag(), context); + context << ' '; + serialize_operand(t._expr, context); + } + else + { + serialize(t._expr, context); + } + context << ")"; + return context; + } + }; - template - auto avg(T t) -> avg_t> - { - static_assert(not contains_aggregate_function_t>::value, "avg() cannot be used on an aggregate function"); - static_assert(is_numeric_t>::value, "avg() requires a value expression as argument"); - return { t }; - } - - template - auto avg(const distinct_t&, T t) -> avg_t> - { - static_assert(not contains_aggregate_function_t>::value, "avg() cannot be used on an aggregate function"); - static_assert(is_numeric_t>::value, "avg() requires a value expression as argument"); - return { t }; - } + template + auto avg(T t) -> avg_t> + { + static_assert(not contains_aggregate_function_t>::value, + "avg() cannot be used on an aggregate function"); + static_assert(is_numeric_t>::value, "avg() requires a value expression as argument"); + return {t}; + } + template + auto avg(const distinct_t&, T t) -> avg_t> + { + static_assert(not contains_aggregate_function_t>::value, + "avg() cannot be used on an aggregate function"); + static_assert(is_numeric_t>::value, "avg() requires a value expression as argument"); + return {t}; + } } #endif diff --git a/include/sqlpp11/bad_statement.h b/include/sqlpp11/bad_statement.h index 1151f287..03635a28 100644 --- a/include/sqlpp11/bad_statement.h +++ b/include/sqlpp11/bad_statement.h @@ -29,13 +29,13 @@ namespace sqlpp { - struct bad_statement - { - template - bad_statement(T&&...) {} - }; + struct bad_statement + { + template + bad_statement(T&&...) + { + } + }; } #endif - - diff --git a/include/sqlpp11/basic_expression_operators.h b/include/sqlpp11/basic_expression_operators.h index 7d9ddda8..032ecd34 100644 --- a/include/sqlpp11/basic_expression_operators.h +++ b/include/sqlpp11/basic_expression_operators.h @@ -38,119 +38,122 @@ namespace sqlpp { - // basic operators - template - struct basic_expression_operators - { - template - struct _is_valid_comparison_operand - { - static constexpr bool value = - (is_expression_t::value // expressions are OK - or is_multi_expression_t::value) // multi-expressions like ANY are OK for comparisons, too - and ValueType::template _is_valid_operand::value // the correct value type is required, of course - ; - }; + // basic operators + template + struct basic_expression_operators + { + template + struct _is_valid_comparison_operand + { + static constexpr bool value = + (is_expression_t::value // expressions are OK + or + is_multi_expression_t::value) // multi-expressions like ANY are OK for comparisons, too + and + ValueType::template _is_valid_operand::value // the correct value type is required, of course + ; + }; - template - equal_to_t> operator==(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); + template + equal_to_t> operator==(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); - return { *static_cast(this), {rhs{t}} }; - } + return {*static_cast(this), {rhs{t}}}; + } - template - not_equal_to_t> operator!=(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); + template + not_equal_to_t> operator!=(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); - return { *static_cast(this), {rhs{t}} }; - } + return {*static_cast(this), {rhs{t}}}; + } - template - less_than_t> operator<(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); + template + less_than_t> operator<(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); - return { *static_cast(this), rhs{t} }; - } + return {*static_cast(this), rhs{t}}; + } - template - less_equal_t> operator<=(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); + template + less_equal_t> operator<=(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); - return { *static_cast(this), rhs{t} }; - } + return {*static_cast(this), rhs{t}}; + } - template - greater_than_t> operator>(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); + template + greater_than_t> operator>(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); - return { *static_cast(this), rhs{t} }; - } + return {*static_cast(this), rhs{t}}; + } - template - greater_equal_t> operator>=(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); + template + greater_equal_t> operator>=(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_comparison_operand::value, "invalid rhs operand in comparison"); - return { *static_cast(this), rhs{t} }; - } + return {*static_cast(this), rhs{t}}; + } - is_null_t is_null() const - { - return { *static_cast(this) }; - } + is_null_t is_null() const + { + return {*static_cast(this)}; + } - is_not_null_t is_not_null() const - { - return { *static_cast(this) }; - } + is_not_null_t is_not_null() const + { + return {*static_cast(this)}; + } - sort_order_t asc() const - { - return { *static_cast(this) }; - } + sort_order_t asc() const + { + return {*static_cast(this)}; + } - sort_order_t desc() const - { - return { *static_cast(this) }; - } + sort_order_t desc() const + { + return {*static_cast(this)}; + } - // Hint: use value_list wrapper for containers... - template - in_t...> in(T... t) const - { - static_assert(logic::all_t<_is_valid_comparison_operand>::value...>::value, "at least one operand of in() is not valid"); - return { *static_cast(this), wrap_operand_t{t}... }; - } + // Hint: use value_list wrapper for containers... + template + in_t...> in(T... t) const + { + static_assert(logic::all_t<_is_valid_comparison_operand>::value...>::value, + "at least one operand of in() is not valid"); + return {*static_cast(this), wrap_operand_t{t}...}; + } - template - not_in_t...> not_in(T... t) const - { - static_assert(logic::all_t<_is_valid_comparison_operand>::value...>::value, "at least one operand of in() is not valid"); - return { *static_cast(this), wrap_operand_t{t}... }; - } - }; - - template - struct alias_operators - { - template - expression_alias_t as(const alias_provider&) const - { - return { *static_cast(this) }; - } - }; + template + not_in_t...> not_in(T... t) const + { + static_assert(logic::all_t<_is_valid_comparison_operand>::value...>::value, + "at least one operand of in() is not valid"); + return {*static_cast(this), wrap_operand_t{t}...}; + } + }; + template + struct alias_operators + { + template + expression_alias_t as(const alias_provider&) const + { + return {*static_cast(this)}; + } + }; } #endif diff --git a/include/sqlpp11/boolean.h b/include/sqlpp11/boolean.h index d9a218b4..620c5715 100644 --- a/include/sqlpp11/boolean.h +++ b/include/sqlpp11/boolean.h @@ -37,199 +37,197 @@ namespace sqlpp { - // boolean value type - struct boolean - { - using _traits = make_traits; - using _tag = tag::is_boolean; - using _cpp_value_type = bool; + // boolean value type + struct boolean + { + using _traits = make_traits; + using _tag = tag::is_boolean; + using _cpp_value_type = bool; - template - using _is_valid_operand = is_boolean_t; - }; + template + using _is_valid_operand = is_boolean_t; + }; - // boolean parameter type - template<> - struct parameter_value_t - { - using _value_type = boolean; // FIXME - using _cpp_value_type = typename _value_type::_cpp_value_type; + // boolean parameter type + template <> + struct parameter_value_t + { + using _value_type = boolean; // FIXME + using _cpp_value_type = typename _value_type::_cpp_value_type; - parameter_value_t(): - _value(false), - _is_null(true) - {} + parameter_value_t() : _value(false), _is_null(true) + { + } - parameter_value_t(const _cpp_value_type& val): - _value(val), - _is_null(false) - {} + parameter_value_t(const _cpp_value_type& val) : _value(val), _is_null(false) + { + } - parameter_value_t& operator=(const _cpp_value_type& val) - { - _value = val; - _is_null = false; - return *this; - } + parameter_value_t& operator=(const _cpp_value_type& val) + { + _value = val; + _is_null = false; + return *this; + } - parameter_value_t& operator=(const tvin_t>& t) - { - if (t._is_trivial()) - { - _value = false; - _is_null = true; - } - else - { - _value = t._value._t; - _is_null = false; - } - return *this; - } + parameter_value_t& operator=(const tvin_t>& t) + { + if (t._is_trivial()) + { + _value = false; + _is_null = true; + } + else + { + _value = t._value._t; + _is_null = false; + } + return *this; + } - parameter_value_t& operator=(const std::nullptr_t&) - { - _value = false; - _is_null = true; - return *this; - } + parameter_value_t& operator=(const std::nullptr_t&) + { + _value = false; + _is_null = true; + return *this; + } - bool is_null() const - { - return _is_null; - } + bool is_null() const + { + return _is_null; + } - _cpp_value_type value() const - { - return _value; - } + _cpp_value_type value() const + { + return _value; + } - operator _cpp_value_type() const { return value(); } + operator _cpp_value_type() const + { + return value(); + } - template - void _bind(Target& target, size_t index) const - { - target._bind_boolean_parameter(index, &_value, _is_null); - } + template + void _bind(Target& target, size_t index) const + { + target._bind_boolean_parameter(index, &_value, _is_null); + } - private: - signed char _value; - bool _is_null; - }; + private: + signed char _value; + bool _is_null; + }; - // boolean expression operators - template - struct expression_operators: public basic_expression_operators - { - template - using _is_valid_operand = is_valid_operand; + // boolean expression operators + template + struct expression_operators : public basic_expression_operators + { + template + using _is_valid_operand = is_valid_operand; - template - logical_and_t> operator and(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_operand::value, "invalid rhs operand"); + template + logical_and_t> operator and(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_operand::value, "invalid rhs operand"); - return { *static_cast(this), rhs{t} }; - } + return {*static_cast(this), rhs{t}}; + } - template - logical_or_t> operator or(T t) const - { - using rhs = wrap_operand_t; - static_assert(_is_valid_operand::value, "invalid rhs operand"); + template + logical_or_t> operator or(T t) const + { + using rhs = wrap_operand_t; + static_assert(_is_valid_operand::value, "invalid rhs operand"); - return { *static_cast(this), rhs{t} }; - } + return {*static_cast(this), rhs{t}}; + } - logical_not_t operator not() const - { - return { *static_cast(this) }; - } - }; + logical_not_t operator not() const + { + return {*static_cast(this)}; + } + }; - // boolean column operators - template - struct column_operators - { - }; + // boolean column operators + template + struct column_operators + { + }; - // boolean result field - template - struct result_field_t: public result_field_methods_t> - { - static_assert(std::is_same, boolean>::value, "field type mismatch"); - using _cpp_value_type = typename boolean::_cpp_value_type; + // boolean result field + template + struct result_field_t : public result_field_methods_t> + { + static_assert(std::is_same, boolean>::value, "field type mismatch"); + using _cpp_value_type = typename boolean::_cpp_value_type; - result_field_t(): - _is_valid(false), - _is_null(true), - _value(false) - {} + result_field_t() : _is_valid(false), _is_null(true), _value(false) + { + } - void _validate() - { - _is_valid = true; - } + void _validate() + { + _is_valid = true; + } - void _invalidate() - { - _is_valid = false; - _is_null = true; - _value = 0; - } + void _invalidate() + { + _is_valid = false; + _is_null = true; + _value = 0; + } - bool is_null() const - { - if (not _is_valid) - throw exception("accessing is_null in non-existing row"); - return _is_null; - } + bool is_null() const + { + if (not _is_valid) + throw exception("accessing is_null in non-existing row"); + return _is_null; + } - bool _is_trivial() const - { - if (not _is_valid) - throw exception("accessing is_null in non-existing row"); + bool _is_trivial() const + { + if (not _is_valid) + throw exception("accessing is_null in non-existing row"); - return value() == false; - } + return value() == false; + } - _cpp_value_type value() const - { - if (not _is_valid) - throw exception("accessing value in non-existing row"); + _cpp_value_type value() const + { + if (not _is_valid) + throw exception("accessing value in non-existing row"); - if (_is_null) - { - if (enforce_null_result_treatment_t::value and not null_is_trivial_value_t::value) - { - throw exception("accessing value of NULL field"); - } - else - { - return false; - } - } - return _value; - } + if (_is_null) + { + if (enforce_null_result_treatment_t::value and not null_is_trivial_value_t::value) + { + throw exception("accessing value of NULL field"); + } + else + { + return false; + } + } + return _value; + } - template - void _bind(Target& target, size_t i) - { - target._bind_boolean_result(i, &_value, &_is_null); - } + template + void _bind(Target& target, size_t i) + { + target._bind_boolean_result(i, &_value, &_is_null); + } - private: - bool _is_valid; - bool _is_null; - signed char _value; - }; - - template - inline std::ostream& operator<<(std::ostream& os, const result_field_t& e) - { - return serialize(e, os); - } + private: + bool _is_valid; + bool _is_null; + signed char _value; + }; + template + inline std::ostream& operator<<(std::ostream& os, const result_field_t& e) + { + return serialize(e, os); + } } #endif diff --git a/include/sqlpp11/boolean_expression.h b/include/sqlpp11/boolean_expression.h index cc79e9a2..a0652103 100644 --- a/include/sqlpp11/boolean_expression.h +++ b/include/sqlpp11/boolean_expression.h @@ -32,54 +32,53 @@ namespace sqlpp { - template - struct boolean_expression_t: public expression_operators, boolean> - { - using _traits = make_traits; - using _nodes = detail::type_vector<>; + template + struct boolean_expression_t : public expression_operators, boolean> + { + using _traits = make_traits; + using _nodes = detail::type_vector<>; - template - boolean_expression_t(Expr expr): - _expr(expr) - { - static_assert(is_expression_t::value, "boolean_expression requires a boolean expression argument"); - static_assert(is_boolean_t::value, "boolean_expression requires a boolean expression argument"); - } + template + boolean_expression_t(Expr expr) + : _expr(expr) + { + static_assert(is_expression_t::value, "boolean_expression requires a boolean expression argument"); + static_assert(is_boolean_t::value, "boolean_expression requires a boolean expression argument"); + } - boolean_expression_t(const boolean_expression_t&) = default; - boolean_expression_t(boolean_expression_t&&) = default; - boolean_expression_t& operator=(const boolean_expression_t&) = default; - boolean_expression_t& operator=(boolean_expression_t&&) = default; - ~boolean_expression_t() = default; + boolean_expression_t(const boolean_expression_t&) = default; + boolean_expression_t(boolean_expression_t&&) = default; + boolean_expression_t& operator=(const boolean_expression_t&) = default; + boolean_expression_t& operator=(boolean_expression_t&&) = default; + ~boolean_expression_t() = default; - interpretable_t _expr; - }; + interpretable_t _expr; + }; - template - boolean_expression_t boolean_expression(T t) - { - using Expr = wrap_operand_t; - return {Expr{t}}; - } + template + boolean_expression_t boolean_expression(T t) + { + using Expr = wrap_operand_t; + return {Expr{t}}; + } - template - boolean_expression_t boolean_expression(const Database&, T t) - { - return boolean_expression(t); - } + template + boolean_expression_t boolean_expression(const Database&, T t) + { + return boolean_expression(t); + } - template - struct serializer_t> - { - using _serialize_check = consistent_t; - using T = boolean_expression_t; - - static Context& _(const T& t, Context& context) - { - return serialize(t._expr, context); - } - }; + template + struct serializer_t> + { + using _serialize_check = consistent_t; + using T = boolean_expression_t; + static Context& _(const T& t, Context& context) + { + return serialize(t._expr, context); + } + }; } #endif diff --git a/include/sqlpp11/char_sequence.h b/include/sqlpp11/char_sequence.h index 5d7ee1c3..88920c22 100644 --- a/include/sqlpp11/char_sequence.h +++ b/include/sqlpp11/char_sequence.h @@ -31,26 +31,28 @@ namespace sqlpp { - template struct char_sequence - { - static const char* char_ptr() - { - static char s[] = {Cs...}; - return s; - }; - }; + template + struct char_sequence + { + static const char* char_ptr() + { + static char s[] = {Cs...}; + return s; + }; + }; - template - struct make_char_sequence_impl; + template + struct make_char_sequence_impl; - template - struct make_char_sequence_impl> - { - using type = char_sequence; - }; + template + struct make_char_sequence_impl> + { + using type = char_sequence; + }; - template - using make_char_sequence = typename make_char_sequence_impl>::type; + template + using make_char_sequence = + typename make_char_sequence_impl>::type; } #endif diff --git a/include/sqlpp11/column.h b/include/sqlpp11/column.h index 4985735e..25d86233 100644 --- a/include/sqlpp11/column.h +++ b/include/sqlpp11/column.h @@ -41,84 +41,81 @@ namespace sqlpp { - template - struct column_t: - public expression_operators, value_type_of>, - public column_operators, value_type_of> - { - struct _traits - { - using _value_type = value_type_of; - using _tags = detail::make_joined_set_t, typename ColumnSpec::_traits::_tags>; - }; + template + struct column_t : public expression_operators, value_type_of>, + public column_operators, value_type_of> + { + struct _traits + { + using _value_type = value_type_of; + using _tags = detail::make_joined_set_t, + typename ColumnSpec::_traits::_tags>; + }; - using _nodes = detail::type_vector<>; - using _required_tables = detail::type_set
; - using _can_be_null = column_spec_can_be_null_t; + using _nodes = detail::type_vector<>; + using _required_tables = detail::type_set
; + using _can_be_null = column_spec_can_be_null_t; - using _spec_t = ColumnSpec; - using _table = Table; - using _alias_t = typename _spec_t::_alias_t; + using _spec_t = ColumnSpec; + using _table = Table; + using _alias_t = typename _spec_t::_alias_t; - template - using _is_valid_operand = is_valid_operand, T>; + template + using _is_valid_operand = is_valid_operand, T>; - column_t() = default; - column_t(const column_t&) = default; - column_t(column_t&&) = default; - column_t& operator=(const column_t&) = default; - column_t& operator=(column_t&&) = default; - ~column_t() = default; + column_t() = default; + column_t(const column_t&) = default; + column_t(column_t&&) = default; + column_t& operator=(const column_t&) = default; + column_t& operator=(column_t&&) = default; + ~column_t() = default; - template - auto table() const -> _table - { - static_assert(is_table_t::value, "cannot call get_table for columns of a sub-selects or cte"); - return _table{}; - } + template + auto table() const -> _table + { + static_assert(is_table_t::value, "cannot call get_table for columns of a sub-selects or cte"); + return _table{}; + } - template - expression_alias_t as(const alias_provider&) const - { - return { *this }; - } + template + expression_alias_t as(const alias_provider&) const + { + return {*this}; + } - template - auto operator =(T t) const -> assignment_t> - { - using rhs = wrap_operand_t; - static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); + template + auto operator=(T t) const -> assignment_t> + { + using rhs = wrap_operand_t; + static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); - return { *this, {rhs{t}} }; - } + return {*this, {rhs{t}}}; + } - auto operator =(null_t) const - ->assignment_t - { - static_assert(can_be_null_t::value, "column cannot be null"); - return { *this, null_t{} }; - } + auto operator=(null_t) const -> assignment_t + { + static_assert(can_be_null_t::value, "column cannot be null"); + return {*this, null_t{}}; + } - auto operator =(default_value_t) const - ->assignment_t - { - return { *this, default_value_t{} }; - } - }; + auto operator=(default_value_t) const -> assignment_t + { + return {*this, default_value_t{}}; + } + }; - template - struct serializer_t> - { - using _serialize_check = consistent_t; - using T = column_t; - - static Context& _(const T&, Context& context) - { - context << name_of::char_ptr() << '.' << name_of::char_ptr(); - return context; - } - }; + template + struct serializer_t> + { + using _serialize_check = consistent_t; + using T = column_t; + static Context& _(const T&, Context& context) + { + context << name_of::char_ptr() << '.' << name_of::char_ptr(); + return context; + } + }; } #endif diff --git a/include/sqlpp11/column_fwd.h b/include/sqlpp11/column_fwd.h index c6899454..6eb4415f 100644 --- a/include/sqlpp11/column_fwd.h +++ b/include/sqlpp11/column_fwd.h @@ -24,14 +24,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef SQLPP_COLUMN_FWD_H #define SQLPP_COLUMN_FWD_H namespace sqlpp { - template - struct column_t; + template + struct column_t; } #endif diff --git a/include/sqlpp11/concat.h b/include/sqlpp11/concat.h index 5b2d3209..dba4cddc 100644 --- a/include/sqlpp11/concat.h +++ b/include/sqlpp11/concat.h @@ -35,69 +35,67 @@ namespace sqlpp { - struct text; + struct text; - struct concat_alias_t - { - struct _alias_t - { - static constexpr const char _literal[] = "concat_"; - using _name_t = sqlpp::make_char_sequence; - template - struct _member_t - { - T concat; - }; - }; - }; + struct concat_alias_t + { + struct _alias_t + { + static constexpr const char _literal[] = "concat_"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T concat; + }; + }; + }; - template - struct concat_t: - public expression_operators, text>, - public alias_operators> - { - using _traits = make_traits; - using _nodes = detail::type_vector; + template + struct concat_t : public expression_operators, text>, public alias_operators> + { + using _traits = make_traits; + using _nodes = detail::type_vector; - using _auto_alias_t = concat_alias_t; + using _auto_alias_t = concat_alias_t; - concat_t(Args... args): - _args(args...) - {} + concat_t(Args... args) : _args(args...) + { + } - concat_t(const concat_t&) = default; - concat_t(concat_t&&) = default; - concat_t& operator=(const concat_t&) = default; - concat_t& operator=(concat_t&&) = default; - ~concat_t() = default; + concat_t(const concat_t&) = default; + concat_t(concat_t&&) = default; + concat_t& operator=(const concat_t&) = default; + concat_t& operator=(concat_t&&) = default; + ~concat_t() = default; - std::tuple _args; - }; + std::tuple _args; + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = concat_t; + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = concat_t; - static Context& _(const T& t, Context& context) - { - context << "("; - interpret_tuple(t._args, "||", context); - context << ")"; - return context; - } - }; + static Context& _(const T& t, Context& context) + { + context << "("; + interpret_tuple(t._args, "||", context); + context << ")"; + return context; + } + }; - template - auto concat(Args... args) - -> concat_t - { - static_assert(sizeof...(Args) >= 2, "concat requires two arguments at least"); - static_assert(logic::all_t>::value...>::value, "at least one non-text argument detected in concat()"); + template + auto concat(Args... args) -> concat_t + { + static_assert(sizeof...(Args) >= 2, "concat requires two arguments at least"); + static_assert(logic::all_t>::value...>::value, + "at least one non-text argument detected in concat()"); - return {args...}; - } + return {args...}; + } } #endif diff --git a/include/sqlpp11/connection.h b/include/sqlpp11/connection.h index fb405251..0b55fd52 100644 --- a/include/sqlpp11/connection.h +++ b/include/sqlpp11/connection.h @@ -29,8 +29,9 @@ namespace sqlpp { - struct connection {}; + struct connection + { + }; } #endif - diff --git a/include/sqlpp11/count.h b/include/sqlpp11/count.h index 3d2ef33d..31353d21 100644 --- a/include/sqlpp11/count.h +++ b/include/sqlpp11/count.h @@ -33,89 +33,96 @@ namespace sqlpp { - struct count_alias_t - { - struct _alias_t - { - static constexpr const char _literal[] = "count_"; - using _name_t = sqlpp::make_char_sequence; - template - struct _member_t - { - T count; - T& operator()() { return count; } - const T& operator()() const { return count; } - }; - }; - }; + struct count_alias_t + { + struct _alias_t + { + static constexpr const char _literal[] = "count_"; + using _name_t = sqlpp::make_char_sequence; + template + struct _member_t + { + T count; + T& operator()() + { + return count; + } + const T& operator()() const + { + return count; + } + }; + }; + }; - template - struct count_t: - public expression_operators, integral>, - public alias_operators> - { - using _traits = make_traits; + template + struct count_t : public expression_operators, integral>, + public alias_operators> + { + using _traits = make_traits; - using _nodes = detail::type_vector; - using _can_be_null = std::false_type; + using _nodes = detail::type_vector; + using _can_be_null = std::false_type; - static_assert(is_noop::value or std::is_same::value, "count() used with flag other than 'distinct'"); + static_assert(is_noop::value or std::is_same::value, + "count() used with flag other than 'distinct'"); - using _auto_alias_t = count_alias_t; + using _auto_alias_t = count_alias_t; - count_t(const Expr expr): - _expr(expr) - {} + count_t(const Expr expr) : _expr(expr) + { + } - count_t(const count_t&) = default; - count_t(count_t&&) = default; - count_t& operator=(const count_t&) = default; - count_t& operator=(count_t&&) = default; - ~count_t() = default; + count_t(const count_t&) = default; + count_t(count_t&&) = default; + count_t& operator=(const count_t&) = default; + count_t& operator=(count_t&&) = default; + ~count_t() = default; - Expr _expr; - }; + Expr _expr; + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = count_t; + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = count_t; - static Context& _(const T& t, Context& context) - { - context << "COUNT("; - if (std::is_same::value) - { - serialize(Flag(), context); - context << ' '; - serialize_operand(t._expr, context); - } - else - { - serialize(t._expr, context); - } - context << ")"; - return context; - } - }; + static Context& _(const T& t, Context& context) + { + context << "COUNT("; + if (std::is_same::value) + { + serialize(Flag(), context); + context << ' '; + serialize_operand(t._expr, context); + } + else + { + serialize(t._expr, context); + } + context << ")"; + return context; + } + }; - template - auto count(T t) -> count_t> - { - static_assert(not contains_aggregate_function_t>::value, "count() cannot be used on an aggregate function"); - static_assert(is_expression_t>::value, "count() requires an expression as argument"); - return { t }; - } - - template - auto count(const distinct_t&, T t) -> count_t> - { - static_assert(not contains_aggregate_function_t>::value, "count() cannot be used on an aggregate function"); - static_assert(is_expression_t>::value, "count() requires an expression as argument"); - return { t }; - } + template + auto count(T t) -> count_t> + { + static_assert(not contains_aggregate_function_t>::value, + "count() cannot be used on an aggregate function"); + static_assert(is_expression_t>::value, "count() requires an expression as argument"); + return {t}; + } + template + auto count(const distinct_t&, T t) -> count_t> + { + static_assert(not contains_aggregate_function_t>::value, + "count() cannot be used on an aggregate function"); + static_assert(is_expression_t>::value, "count() requires an expression as argument"); + return {t}; + } } #endif diff --git a/include/sqlpp11/cte.h b/include/sqlpp11/cte.h index bc971bed..74bb7a1c 100644 --- a/include/sqlpp11/cte.h +++ b/include/sqlpp11/cte.h @@ -40,222 +40,226 @@ namespace sqlpp { - template - struct cte_union_t - { - using _nodes = detail::type_vector<>; - using _required_ctes = detail::make_joined_set_t, required_ctes_of>; - using _parameters = detail::type_vector_cat_t, parameters_of>; + template + struct cte_union_t + { + using _nodes = detail::type_vector<>; + using _required_ctes = detail::make_joined_set_t, required_ctes_of>; + using _parameters = detail::type_vector_cat_t, parameters_of>; - cte_union_t(Lhs lhs, Rhs rhs): - _lhs(lhs), - _rhs(rhs) - {} + cte_union_t(Lhs lhs, Rhs rhs) : _lhs(lhs), _rhs(rhs) + { + } - cte_union_t(const cte_union_t&) = default; - cte_union_t(cte_union_t&&) = default; - cte_union_t& operator=(const cte_union_t&) = default; - cte_union_t& operator=(cte_union_t&&) = default; - ~cte_union_t() = default; + cte_union_t(const cte_union_t&) = default; + cte_union_t(cte_union_t&&) = default; + cte_union_t& operator=(const cte_union_t&) = default; + cte_union_t& operator=(cte_union_t&&) = default; + ~cte_union_t() = default; - Lhs _lhs; - Rhs _rhs; - }; + Lhs _lhs; + Rhs _rhs; + }; - // Interpreters - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = cte_union_t; + // Interpreters + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = cte_union_t; - static Context& _(const T& t, Context& context) - { - serialize(t._lhs, context); - context << " UNION "; - serialize(Flag{}, context); - context << " "; - serialize(t._rhs, context); - return context; - } - }; + static Context& _(const T& t, Context& context) + { + serialize(t._lhs, context); + context << " UNION "; + serialize(Flag{}, context); + context << " "; + serialize(t._rhs, context); + return context; + } + }; - template - struct cte_t; + template + struct cte_t; - template - struct cte_ref_t; + template + struct cte_ref_t; - template - auto from_table(cte_t) -> cte_ref_t - { - return cte_ref_t{}; - } + template + auto from_table(cte_t) -> cte_ref_t + { + return cte_ref_t{}; + } - template - struct from_table_impl> - { - using type = cte_ref_t; - }; + template + struct from_table_impl> + { + using type = cte_ref_t; + }; + template + struct cte_column_spec_t + { + using _alias_t = typename FieldSpec::_alias_t; - template - struct cte_column_spec_t - { - using _alias_t = typename FieldSpec::_alias_t; + using _traits = make_traits, + tag::must_not_insert, + tag::must_not_update, + tag_if::value>>; + }; - using _traits = make_traits, - tag::must_not_insert, - tag::must_not_update, - tag_if::value> - >; - }; + template + struct make_cte_impl + { + using type = void; + }; - template - struct make_cte_impl - { - using type = void; - }; + template + struct make_cte_impl> + { + using type = cte_t; + }; - template - struct make_cte_impl> - { - using type = cte_t; - }; + template + using make_cte_t = typename make_cte_impl>::type; - template - using make_cte_t = typename make_cte_impl>::type; + template + struct cte_t + : public member_t, column_t>>... + { + using _traits = make_traits; // FIXME: is table? really? + using _nodes = detail::type_vector<>; + using _required_ctes = detail::make_joined_set_t, detail::type_set>; + using _parameters = parameters_of; - template - struct cte_t: public member_t, column_t>>... - { - using _traits = make_traits; // FIXME: is table? really? - using _nodes = detail::type_vector<>; - using _required_ctes = detail::make_joined_set_t, detail::type_set>; - using _parameters = parameters_of; + using _alias_t = typename AliasProvider::_alias_t; + constexpr static bool _is_recursive = detail::is_element_of>::value; - using _alias_t = typename AliasProvider::_alias_t; - constexpr static bool _is_recursive = detail::is_element_of>::value; + using _column_tuple_t = std::tuple>...>; - using _column_tuple_t = std::tuple>...>; + template + using _check = logic::all_t::value...>; - template - using _check = logic::all_t::value...>; + using _result_row_t = result_row_t; - using _result_row_t = result_row_t; + template + auto union_distinct(Rhs rhs) const -> + typename std::conditional<_check::value, + cte_t, FieldSpecs...>, + bad_statement>::type + { + static_assert(is_statement_t::value, "argument of union call has to be a statement"); + static_assert(has_policy_t::value, "argument of union call has to be a select"); + static_assert(has_result_row_t::value, "argument of a union has to be a (complete) select statement"); - template - auto union_distinct(Rhs rhs) const - -> typename std::conditional<_check::value, cte_t, FieldSpecs...>, bad_statement>::type - { - static_assert(is_statement_t::value, "argument of union call has to be a statement"); - static_assert(has_policy_t::value, "argument of union call has to be a select"); - static_assert(has_result_row_t::value, "argument of a union has to be a (complete) select statement"); + static_assert(std::is_same<_result_row_t, get_result_row_t>::value, + "both select statements in a union have to have the same result columns (type and name)"); - static_assert(std::is_same<_result_row_t, get_result_row_t>::value, "both select statements in a union have to have the same result columns (type and name)"); + return _union_impl(_check{}, rhs); + } - return _union_impl(_check{}, rhs); - } + template + auto union_all(Rhs rhs) const -> + typename std::conditional<_check::value, + cte_t, FieldSpecs...>, + bad_statement>::type + { + static_assert(is_statement_t::value, "argument of union call has to be a statement"); + static_assert(has_policy_t::value, "argument of union call has to be a select"); + static_assert(has_result_row_t::value, "argument of a union has to be a (complete) select statement"); - template - auto union_all(Rhs rhs) const - -> typename std::conditional<_check::value, cte_t, FieldSpecs...>, bad_statement>::type - { - static_assert(is_statement_t::value, "argument of union call has to be a statement"); - static_assert(has_policy_t::value, "argument of union call has to be a select"); - static_assert(has_result_row_t::value, "argument of a union has to be a (complete) select statement"); + static_assert(std::is_same<_result_row_t, get_result_row_t>::value, + "both select statements in a union have to have the same result columns (type and name)"); - static_assert(std::is_same<_result_row_t, get_result_row_t>::value, "both select statements in a union have to have the same result columns (type and name)"); + return _union_impl(_check{}, rhs); + } - return _union_impl(_check{}, rhs); - } + private: + template + auto _union_impl(const std::false_type&, Rhs rhs) const -> bad_statement; - private: - template - auto _union_impl(const std::false_type&, Rhs rhs) const - -> bad_statement; + template + auto _union_impl(const std::true_type&, Rhs rhs) const + -> cte_t, FieldSpecs...> + { + return cte_union_t{_statement, rhs}; + } - template - auto _union_impl(const std::true_type&, Rhs rhs) const - -> cte_t, FieldSpecs...> - { - return cte_union_t{_statement, rhs}; - } + public: + 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; - public: + Statement _statement; + }; - 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; + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = cte_t; - Statement _statement; - }; + static Context& _(const T& t, Context& context) + { + context << name_of::char_ptr() << " AS ("; + serialize(t._statement, context); + context << ")"; + return context; + } + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = cte_t; + // 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 + template + struct cte_ref_t + { + using _traits = make_traits; // FIXME: is table? really? + using _nodes = detail::type_vector<>; + using _required_ctes = detail::make_type_set_t; + using _provided_tables = detail::type_set; - static Context& _(const T& t, Context& context) - { - context << name_of::char_ptr() << " AS ("; - serialize(t._statement, context); - context << ")"; - return context; - } - }; + using _alias_t = typename AliasProvider::_alias_t; + template + auto as(Statement statement) -> make_cte_t + { + static_assert(required_tables_of::size::value == 0, + "common table expression must not use unknown tables"); + static_assert(not detail::is_element_of>::value, + "common table expression must not self-reference in the first part, use union_all/union_distinct " + "for recursion"); + static_assert(is_static_result_row_t>::value, + "ctes must not have dynamically added columns"); -// 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 - template - struct cte_ref_t - { - using _traits = make_traits; // FIXME: is table? really? - using _nodes = detail::type_vector<>; - using _required_ctes = detail::make_type_set_t; - using _provided_tables = detail::type_set; + return {statement}; + } + }; - using _alias_t = typename AliasProvider::_alias_t; + template + struct serializer_t> + { + using _serialize_check = consistent_t; + using T = cte_ref_t; - template - auto as(Statement statement) - -> make_cte_t - { - static_assert(required_tables_of::size::value == 0, "common table expression must not use unknown tables"); - static_assert(not detail::is_element_of>::value, "common table expression must not self-reference in the first part, use union_all/union_distinct for recursion"); - static_assert(is_static_result_row_t>::value, "ctes must not have dynamically added columns"); - - return { statement }; - } - }; - - template - struct serializer_t> - { - using _serialize_check = consistent_t; - using T = cte_ref_t; - - static Context& _(const T&, Context& context) - { - context << name_of::char_ptr(); - return context; - } - }; - - template - auto cte(const AliasProvider&) - -> cte_ref_t - { - return {}; - } + static Context& _(const T&, Context& context) + { + context << name_of::char_ptr(); + return context; + } + }; + template + auto cte(const AliasProvider&) -> cte_ref_t + { + return {}; + } } #endif diff --git a/include/sqlpp11/custom_query.h b/include/sqlpp11/custom_query.h index 7548b255..efbe576d 100644 --- a/include/sqlpp11/custom_query.h +++ b/include/sqlpp11/custom_query.h @@ -34,111 +34,108 @@ namespace sqlpp { - template - struct custom_query_t; + template + struct custom_query_t; - namespace detail - { - template - struct custom_parts_t - { - using _custom_query_t = custom_query_t; - using _result_type_provider = detail::get_first_if; - using _result_methods_t = typename _result_type_provider::template _result_methods_t<_result_type_provider>; - }; - } + namespace detail + { + template + struct custom_parts_t + { + using _custom_query_t = custom_query_t; + using _result_type_provider = detail::get_first_if; + using _result_methods_t = typename _result_type_provider::template _result_methods_t<_result_type_provider>; + }; + } - template - struct custom_query_t: - private detail::custom_parts_t::_result_methods_t - { - using _methods_t = typename detail::custom_parts_t::_result_methods_t; - using _traits = make_traits; - using _nodes = detail::type_vector; + template + struct custom_query_t : private detail::custom_parts_t::_result_methods_t + { + using _methods_t = typename detail::custom_parts_t::_result_methods_t; + using _traits = make_traits; + using _nodes = detail::type_vector; - using _parameter_check = typename std::conditional>::value == 0, - consistent_t, assert_no_parameters_t>::type; - using _run_check = detail::get_first_if; - using _prepare_check = consistent_t; + using _parameter_check = + typename std::conditional>::value == 0, + consistent_t, + assert_no_parameters_t>::type; + using _run_check = detail::get_first_if; + using _prepare_check = consistent_t; - custom_query_t(Parts... parts): - _parts(parts...) - {} + custom_query_t(Parts... parts) : _parts(parts...) + { + } - custom_query_t(std::tuple parts): - _parts(parts) - {} + custom_query_t(std::tuple parts) : _parts(parts) + { + } - custom_query_t(const custom_query_t&) = default; - custom_query_t(custom_query_t&&) = default; - custom_query_t& operator=(const custom_query_t&) = default; - custom_query_t& operator=(custom_query_t&&) = default; - ~custom_query_t() = default; + custom_query_t(const custom_query_t&) = default; + custom_query_t(custom_query_t&&) = default; + custom_query_t& operator=(const custom_query_t&) = default; + custom_query_t& operator=(custom_query_t&&) = default; + ~custom_query_t() = default; - template - auto _run(Db& db) const -> decltype(std::declval<_methods_t>()._run(db, *this)) - { - _run_check::_(); - return _methods_t::_run(db, *this); - } + template + auto _run(Db& db) const -> decltype(std::declval<_methods_t>()._run(db, *this)) + { + _run_check::_(); + return _methods_t::_run(db, *this); + } - template - auto _prepare(Db& db) const -> decltype(std::declval<_methods_t>()._prepare(db, *this)) - { - _prepare_check::_(); - return _methods_t::_prepare(db, *this); - } + template + auto _prepare(Db& db) const -> decltype(std::declval<_methods_t>()._prepare(db, *this)) + { + _prepare_check::_(); + return _methods_t::_prepare(db, *this); + } - static constexpr size_t _get_static_no_of_parameters() - { - return std::tuple_size>::value; - } + static constexpr size_t _get_static_no_of_parameters() + { + return std::tuple_size>::value; + } - size_t _get_no_of_parameters() const - { - return _get_static_no_of_parameters(); - } + size_t _get_no_of_parameters() const + { + return _get_static_no_of_parameters(); + } - template - auto with_result_type_of(Part part) - -> custom_query_t - { - return {tuple_cat(std::make_tuple(part), _parts)}; - } + template + auto with_result_type_of(Part part) -> custom_query_t + { + return {tuple_cat(std::make_tuple(part), _parts)}; + } - std::tuple _parts; - }; + std::tuple _parts; + }; - template - struct serializer_t> - { - using _serialize_check = serialize_check_of; - using T = custom_query_t; + template + struct serializer_t> + { + using _serialize_check = serialize_check_of; + using T = custom_query_t; - static Context& _(const T& t, Context& context) - { - interpret_tuple_without_braces(t._parts, " ", context); - return context; - } - }; + static Context& _(const T& t, Context& context) + { + interpret_tuple_without_braces(t._parts, " ", context); + return context; + } + }; - template - auto custom_query(Parts... parts) - -> custom_query_t...> - { - static_assert(sizeof...(Parts) > 0, "custom query requires at least one argument"); - return custom_query_t...>(parts...); - } + template + auto custom_query(Parts... parts) -> custom_query_t...> + { + static_assert(sizeof...(Parts) > 0, "custom query requires at least one argument"); + return custom_query_t...>(parts...); + } - template - auto dynamic_custom_query(const Database&, Parts... parts) - -> custom_query_t...> - { - static_assert(sizeof...(Parts) > 0, "custom query requires at least one query argument"); - static_assert(std::is_base_of::value, "Invalid database parameter"); + template + auto dynamic_custom_query(const Database&, Parts... parts) -> custom_query_t...> + { + static_assert(sizeof...(Parts) > 0, "custom query requires at least one query argument"); + static_assert(std::is_base_of::value, "Invalid database parameter"); - return custom_query_t...>(parts...); - } + return custom_query_t...>(parts...); + } } #endif diff --git a/include/sqlpp11/default_value.h b/include/sqlpp11/default_value.h index da9b5dae..bee70bb2 100644 --- a/include/sqlpp11/default_value.h +++ b/include/sqlpp11/default_value.h @@ -31,29 +31,31 @@ namespace sqlpp { - struct default_value_t - { - using _traits = make_traits; - using _nodes = detail::type_vector<>; + struct default_value_t + { + using _traits = make_traits; + using _nodes = detail::type_vector<>; - static constexpr bool _is_trivial() { return false; } - }; + static constexpr bool _is_trivial() + { + return false; + } + }; - template - struct serializer_t - { - using _serialize_check = consistent_t; - using Operand = default_value_t; + template + struct serializer_t + { + using _serialize_check = consistent_t; + using Operand = default_value_t; - static Context& _(const Operand&, Context& context) - { - context << "DEFAULT"; - return context; - } - }; - - constexpr default_value_t default_value = {}; + static Context& _(const Operand&, Context& context) + { + context << "DEFAULT"; + return context; + } + }; + constexpr default_value_t default_value = {}; } #endif diff --git a/include/sqlpp11/detail/copy_tuple_args.h b/include/sqlpp11/detail/copy_tuple_args.h index fdd70da6..9126ebbc 100644 --- a/include/sqlpp11/detail/copy_tuple_args.h +++ b/include/sqlpp11/detail/copy_tuple_args.h @@ -32,52 +32,59 @@ namespace sqlpp { - template - struct all_of_t; + template + struct all_of_t; - namespace detail - { - template - struct as_column_tuple - { - static std::tuple> _(T t) { return std::tuple>(auto_alias_t{t}); } - }; + namespace detail + { + template + struct as_column_tuple + { + static std::tuple> _(T t) + { + return std::tuple>(auto_alias_t{t}); + } + }; - template - struct as_column_tuple> - { - static typename all_of_t::_column_tuple_t _(all_of_t) { return { }; } - }; + template + struct as_column_tuple> + { + static typename all_of_t::_column_tuple_t _(all_of_t) + { + return {}; + } + }; - template - struct as_column_tuple> - { - static std::tuple...> _(std::tuple t) { return t; } - }; + template + struct as_column_tuple> + { + static std::tuple...> _(std::tuple t) + { + return t; + } + }; - template class Target, typename First, typename T> - struct copy_tuple_args_impl - { - static_assert(wrong_t::value, "copy_tuple_args must be called with a tuple"); - }; + template