0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Added constraints that insert and update require some value specs

This commit is contained in:
rbock 2014-08-11 21:03:55 +02:00
parent 27649b3af2
commit c0902f8683
2 changed files with 8 additions and 2 deletions

View File

@ -322,7 +322,10 @@ namespace sqlpp
template<typename T>
using _new_statement_t = typename Policies::template _new_statement_t<no_insert_value_list_t, 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<insert_default_values_t>

View File

@ -167,7 +167,10 @@ namespace sqlpp
template<typename T>
using _new_statement_t = typename Policies::template _new_statement_t<no_update_list_t, T>;
static void _check_consistency() {}
static void _check_consistency()
{
static_assert(wrong_t<_methods_t>::value, "update assignments required, i.e. set(...)");
}
template<typename... Assignments>
auto set(Assignments... assignments)