From c0902f8683bf2a44b704ba9b0865af14caa94624 Mon Sep 17 00:00:00 2001 From: rbock Date: Mon, 11 Aug 2014 21:03:55 +0200 Subject: [PATCH] Added constraints that insert and update require some value specs --- include/sqlpp11/insert_value_list.h | 5 ++++- include/sqlpp11/update_list.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/sqlpp11/insert_value_list.h b/include/sqlpp11/insert_value_list.h index bb20ee69..3157b2bf 100644 --- a/include/sqlpp11/insert_value_list.h +++ b/include/sqlpp11/insert_value_list.h @@ -322,7 +322,10 @@ namespace sqlpp template using _new_statement_t = typename Policies::template _new_statement_t; - static void _check_consistency() {} + static void _check_consistency() + { + static_assert(wrong_t<_methods_t>::value, "insert values required, e.g. set(...) or default_values()"); + } auto default_values() -> _new_statement_t diff --git a/include/sqlpp11/update_list.h b/include/sqlpp11/update_list.h index 6b8a255a..1ee40173 100644 --- a/include/sqlpp11/update_list.h +++ b/include/sqlpp11/update_list.h @@ -167,7 +167,10 @@ namespace sqlpp template using _new_statement_t = typename Policies::template _new_statement_t; - static void _check_consistency() {} + static void _check_consistency() + { + static_assert(wrong_t<_methods_t>::value, "update assignments required, i.e. set(...)"); + } template auto set(Assignments... assignments)