mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Fixed some "const" bugs and a parameter_tuple bug
This commit is contained in:
parent
24b44fae65
commit
63ac89accb
@ -102,7 +102,7 @@ namespace sqlpp
|
|||||||
return _parameter_list_t::size::value;
|
return _parameter_list_t::size::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t _get_no_of_parameters()
|
size_t _get_no_of_parameters() const
|
||||||
{
|
{
|
||||||
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ namespace sqlpp
|
|||||||
return _parameter_list_t::size::value;
|
return _parameter_list_t::size::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t _get_no_of_parameters()
|
size_t _get_no_of_parameters() const
|
||||||
{
|
{
|
||||||
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
||||||
}
|
}
|
||||||
|
@ -558,7 +558,7 @@ namespace sqlpp
|
|||||||
return _parameter_list_t::size::value;
|
return _parameter_list_t::size::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t _get_no_of_parameters()
|
size_t _get_no_of_parameters() const
|
||||||
{
|
{
|
||||||
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
||||||
}
|
}
|
||||||
@ -584,8 +584,8 @@ namespace sqlpp
|
|||||||
|
|
||||||
// Prepare
|
// Prepare
|
||||||
template<typename Db>
|
template<typename Db>
|
||||||
auto prepare(Db& db)
|
auto prepare(Db& db) const
|
||||||
-> prepared_select_t<typename std::decay<Db>::type, select_t> const
|
-> prepared_select_t<typename std::decay<Db>::type, select_t>
|
||||||
{
|
{
|
||||||
static_assert(not vendor::is_noop<ExpressionList>::value, "cannot run select without having selected anything");
|
static_assert(not vendor::is_noop<ExpressionList>::value, "cannot run select without having selected anything");
|
||||||
static_assert(is_from_t<From>::value, "cannot run select without a from()");
|
static_assert(is_from_t<From>::value, "cannot run select without a from()");
|
||||||
|
@ -140,7 +140,7 @@ namespace sqlpp
|
|||||||
return _parameter_list_t::size::value;
|
return _parameter_list_t::size::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t _get_no_of_parameters()
|
size_t _get_no_of_parameters() const
|
||||||
{
|
{
|
||||||
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
|
||||||
}
|
}
|
||||||
@ -154,7 +154,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Db>
|
template<typename Db>
|
||||||
auto prepare(Db& db)
|
auto prepare(Db& db) const
|
||||||
-> prepared_update_t<typename std::decay<Db>::type, update_t>
|
-> prepared_update_t<typename std::decay<Db>::type, update_t>
|
||||||
{
|
{
|
||||||
static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update");
|
static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update");
|
||||||
|
4
include/sqlpp11/vendor/insert_list.h
vendored
4
include/sqlpp11/vendor/insert_list.h
vendored
@ -78,7 +78,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _is_insert_list = std::true_type;
|
using _is_insert_list = std::true_type;
|
||||||
using _is_dynamic = typename std::conditional<std::is_same<Database, void>::value, std::false_type, std::true_type>::type;
|
using _is_dynamic = typename std::conditional<std::is_same<Database, void>::value, std::false_type, std::true_type>::type;
|
||||||
using _parameter_tuple_t = std::tuple<typename Assignments::value_type...>;
|
using _parameter_tuple_t = std::tuple<Assignments...>;
|
||||||
|
|
||||||
// check for at least one order expression
|
// check for at least one order expression
|
||||||
static_assert(_is_dynamic::value or sizeof...(Assignments), "at least one select expression required in set()");
|
static_assert(_is_dynamic::value or sizeof...(Assignments), "at least one select expression required in set()");
|
||||||
@ -116,7 +116,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
|
|
||||||
std::tuple<insert_column_t<typename Assignments::column_type>...> _columns;
|
std::tuple<insert_column_t<typename Assignments::column_type>...> _columns;
|
||||||
_parameter_tuple_t _values;
|
std::tuple<typename Assignments::value_type...> _values;
|
||||||
typename vendor::interpretable_list_t<Database> _dynamic_columns;
|
typename vendor::interpretable_list_t<Database> _dynamic_columns;
|
||||||
typename vendor::interpretable_list_t<Database> _dynamic_values;
|
typename vendor::interpretable_list_t<Database> _dynamic_values;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user