0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Assert that parameters are not used in dynamic elements of a query.

This will need to change in the future
This commit is contained in:
Roland Bock 2014-01-07 07:29:55 +01:00
parent b8907df4ef
commit e601747fca
3 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@
#include <ostream> #include <ostream>
#include <vector> #include <vector>
#include <memory> #include <memory>
#include <sqlpp11/parameter_list.h>
namespace sqlpp namespace sqlpp
{ {
@ -65,6 +66,7 @@ namespace sqlpp
template<typename T> template<typename T>
struct _impl_t: public _impl_base struct _impl_t: public _impl_base
{ {
static_assert(not make_parameter_list_t<T>::type::size::value, "parameters not supported in dynamic query parts");
_impl_t(const T& t): _impl_t(const T& t):
_t(t) _t(t)
{} {}

View File

@ -71,7 +71,8 @@ namespace sqlpp
size_t _set_parameter_index(size_t index) size_t _set_parameter_index(size_t index)
{ {
return set_parameter_index(_expressions, index); index = set_parameter_index(_expressions, index);
return index;
} }
_parameter_tuple_t _expressions; _parameter_tuple_t _expressions;

View File

@ -71,7 +71,8 @@ namespace sqlpp
size_t _set_parameter_index(size_t index) size_t _set_parameter_index(size_t index)
{ {
return set_parameter_index(_expressions, index); index = set_parameter_index(_expressions, index);
return index;
} }
_parameter_tuple_t _expressions; _parameter_tuple_t _expressions;