mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Streamlined some typenames
This commit is contained in:
parent
3d777d982a
commit
581353dc53
@ -36,11 +36,6 @@
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
// Hint: Columns/Values could be supported by .columns().values().values()...
|
||||
// values could take values or assignments. The latter would be stripped
|
||||
// The insert would store a vector of tuples of values.
|
||||
// Hint: Select could be supported by perfect forwarding to the methods of _select member (always changing the whole type of the
|
||||
// insert.
|
||||
template<
|
||||
typename Table = noop,
|
||||
typename InsertList = noop
|
||||
@ -57,10 +52,10 @@ namespace sqlpp
|
||||
static_assert(is_noop<InsertList>::value or is_insert_list_t<InsertList>::value, "invalid 'InsertList' argument");
|
||||
|
||||
template<typename... Assignment>
|
||||
using add_insert_list_t = insert_t<Table, insert_list_t<must_not_insert_t, typename std::decay<Assignment>::type...>>;
|
||||
using set_insert_list_t = insert_t<Table, insert_list_t<must_not_insert_t, typename std::decay<Assignment>::type...>>;
|
||||
|
||||
template<typename... Assignment>
|
||||
add_insert_list_t<Assignment...> set(Assignment&&... assignment)
|
||||
set_insert_list_t<Assignment...> set(Assignment&&... assignment)
|
||||
{
|
||||
static_assert(std::is_same<InsertList, noop>::value, "cannot call set() twice");
|
||||
return {
|
||||
|
@ -54,12 +54,12 @@ namespace sqlpp
|
||||
static_assert(is_noop<Where>::value or is_where_t<Where>::value, "invalid 'Where' argument");
|
||||
|
||||
template<typename... Tab>
|
||||
using add_using_t = remove_t<Table, using_t<typename std::decay<Tab>::type...>, Where>;
|
||||
using set_using_t = remove_t<Table, using_t<typename std::decay<Tab>::type...>, Where>;
|
||||
template<typename Expr>
|
||||
using add_where_t = remove_t<Table, Using, where_t<typename std::decay<Expr>::type>>;
|
||||
using set_where_t = remove_t<Table, Using, where_t<typename std::decay<Expr>::type>>;
|
||||
|
||||
template<typename... Tab>
|
||||
add_using_t<Tab...> using_(Tab&&... tab)
|
||||
set_using_t<Tab...> using_(Tab&&... tab)
|
||||
{
|
||||
static_assert(std::is_same<Using, noop>::value, "cannot call using() twice");
|
||||
static_assert(std::is_same<Where, noop>::value, "cannot call using() after where()");
|
||||
@ -71,7 +71,7 @@ namespace sqlpp
|
||||
}
|
||||
|
||||
template<typename Expr>
|
||||
add_where_t<Expr> where(Expr&& where)
|
||||
set_where_t<Expr> where(Expr&& where)
|
||||
{
|
||||
static_assert(std::is_same<Where, noop>::value, "cannot call where() twice");
|
||||
return {
|
||||
|
@ -54,12 +54,12 @@ namespace sqlpp
|
||||
static_assert(is_noop<Where>::value or is_where_t<Where>::value, "invalid 'Where' argument");
|
||||
|
||||
template<typename... Assignment>
|
||||
using add_assignments_t = update_t<Table, assignment_list_t<must_not_update_t, typename std::decay<Assignment>::type...>, Where>;
|
||||
using set_assignments_t = update_t<Table, assignment_list_t<must_not_update_t, typename std::decay<Assignment>::type...>, Where>;
|
||||
template<typename Expr>
|
||||
using add_where_t = update_t<Table, Assignments, where_t<typename std::decay<Expr>::type>>;
|
||||
using set_where_t = update_t<Table, Assignments, where_t<typename std::decay<Expr>::type>>;
|
||||
|
||||
template<typename... Assignment>
|
||||
add_assignments_t<Assignment...> set(Assignment&&... assignment)
|
||||
set_assignments_t<Assignment...> set(Assignment&&... assignment)
|
||||
{
|
||||
static_assert(std::is_same<Assignments, noop>::value, "cannot call set() twice");
|
||||
return {
|
||||
@ -70,7 +70,7 @@ namespace sqlpp
|
||||
}
|
||||
|
||||
template<typename Expr>
|
||||
add_where_t<Expr> where(Expr&& where)
|
||||
set_where_t<Expr> where(Expr&& where)
|
||||
{
|
||||
static_assert(not std::is_same<Assignments, noop>::value, "cannot call where() if set() hasn't been called yet");
|
||||
static_assert(std::is_same<Where, noop>::value, "cannot call where() twice");
|
||||
|
Loading…
Reference in New Issue
Block a user