Moved check_consistency call to statement
This commit is contained in:
rbock
2014-06-13 09:33:08 +02:00
parent f8e0e90477
commit 4d1b60d93a
6 changed files with 49 additions and 104 deletions
+2 -21
View File
@@ -56,31 +56,12 @@ namespace sqlpp
return static_cast<const _statement_t&>(*this);
}
static constexpr size_t _get_static_no_of_parameters()
{
#warning need to fix this
return 0;
//return _parameter_list_t::size::value;
}
size_t _get_no_of_parameters() const
{
#warning need to fix this
return 0;
//return _parameter_list_t::size::value;
}
void _check_consistency() const
{
// FIXME: Read up on what is allowed/prohibited in INSERT
}
template<typename Db>
auto _run(Db& db) const -> decltype(db.remove(_get_statement()))
{
_check_consistency();
_statement_t::_check_consistency();
static_assert(_get_static_no_of_parameters() == 0, "cannot run remove directly with parameters, use prepare instead");
static_assert(_statement_t::_get_static_no_of_parameters() == 0, "cannot run remove directly with parameters, use prepare instead");
return db.remove(*this);
}