mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Some cleanup
This commit is contained in:
parent
89d7ed837d
commit
e7fcb03ca6
@ -47,7 +47,6 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#warning: Need to use in tests
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct has_enabled_over : public std::is_base_of<enable_over<T>, T>
|
struct has_enabled_over : public std::is_base_of<enable_over<T>, T>
|
||||||
{
|
{
|
||||||
|
@ -41,41 +41,40 @@ namespace sqlpp
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto join(T t) const -> decltype(::sqlpp::join(this->derived(), t))
|
auto join(T t) const -> decltype(::sqlpp::join(this->derived(), std::move(t)))
|
||||||
{
|
{
|
||||||
#warning: move?
|
return ::sqlpp::join(this->derived(), std::move(t));
|
||||||
return ::sqlpp::join(this->derived(), t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto inner_join(T t) const -> decltype(::sqlpp::inner_join(this->derived(), t))
|
auto inner_join(T t) const -> decltype(::sqlpp::inner_join(this->derived(), std::move(t)))
|
||||||
{
|
{
|
||||||
return ::sqlpp::inner_join(this->derived(), t);
|
return ::sqlpp::inner_join(this->derived(), std::move(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto left_outer_join(T t) const -> decltype(::sqlpp::left_outer_join(this->derived(), t))
|
auto left_outer_join(T t) const -> decltype(::sqlpp::left_outer_join(this->derived(), std::move(t)))
|
||||||
{
|
{
|
||||||
return ::sqlpp::left_outer_join(this->derived(), t);
|
return ::sqlpp::left_outer_join(this->derived(), std::move(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto right_outer_join(T t) const -> decltype(::sqlpp::right_outer_join(this->derived(), t))
|
auto right_outer_join(T t) const -> decltype(::sqlpp::right_outer_join(this->derived(), std::move(t)))
|
||||||
{
|
{
|
||||||
return ::sqlpp::right_outer_join(this->derived(), t);
|
return ::sqlpp::right_outer_join(this->derived(), std::move(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
#warning: There is no full_outer_join in mysql?
|
#warning: There is no full_outer_join in mysql?
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto full_outer_join(T t) const -> decltype(::sqlpp::full_outer_join(this->derived(), t))
|
auto full_outer_join(T t) const -> decltype(::sqlpp::full_outer_join(this->derived(), std::move(t)))
|
||||||
{
|
{
|
||||||
return ::sqlpp::full_outer_join(this->derived(), t);
|
return ::sqlpp::full_outer_join(this->derived(), std::move(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto cross_join(T t) const -> decltype(::sqlpp::cross_join(this->derived(), t))
|
auto cross_join(T t) const -> decltype(::sqlpp::cross_join(this->derived(), std::move(t)))
|
||||||
{
|
{
|
||||||
return ::sqlpp::cross_join(this->derived(), t);
|
return ::sqlpp::cross_join(this->derived(), std::move(t));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace sqlpp
|
} // namespace sqlpp
|
||||||
|
@ -41,11 +41,6 @@ namespace sqlpp
|
|||||||
};
|
};
|
||||||
struct delete_t : public statement_name_t<delete_name_t>
|
struct delete_t : public statement_name_t<delete_name_t>
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t>;
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Statement>
|
template <typename Statement>
|
||||||
struct _result_methods_t
|
struct _result_methods_t
|
||||||
{
|
{
|
||||||
|
@ -43,11 +43,6 @@ namespace sqlpp
|
|||||||
|
|
||||||
struct insert_t : public statement_name_t<insert_name_t>
|
struct insert_t : public statement_name_t<insert_name_t>
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t>;
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Statement>
|
template <typename Statement>
|
||||||
struct _result_methods_t
|
struct _result_methods_t
|
||||||
{
|
{
|
||||||
|
@ -55,14 +55,8 @@ namespace sqlpp
|
|||||||
template <typename Table>
|
template <typename Table>
|
||||||
struct into_t
|
struct into_t
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t, tag::is_into>;
|
|
||||||
|
|
||||||
using _data_t = into_data_t<Table>;
|
using _data_t = into_data_t<Table>;
|
||||||
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// Base template to be inherited by the statement
|
// Base template to be inherited by the statement
|
||||||
template <typename Policies>
|
template <typename Policies>
|
||||||
struct _base_t
|
struct _base_t
|
||||||
|
@ -253,10 +253,6 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t, tag::is_noop, tag::is_missing>;
|
using _traits = make_traits<no_value_t, tag::is_noop, tag::is_missing>;
|
||||||
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
using _data_t = no_data_t;
|
using _data_t = no_data_t;
|
||||||
|
|
||||||
// Base template to be inherited by the statement
|
// Base template to be inherited by the statement
|
||||||
|
@ -54,18 +54,12 @@ namespace sqlpp
|
|||||||
template <typename Table>
|
template <typename Table>
|
||||||
struct single_table_t
|
struct single_table_t
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t, tag::is_single_table>;
|
#warning: can't we do this with a table_t<> specialization?
|
||||||
|
|
||||||
#warning: can't we do this with a table_t<> specialization
|
|
||||||
static_assert(is_table<Table>::value, "argument has to be a table");
|
static_assert(is_table<Table>::value, "argument has to be a table");
|
||||||
static_assert(required_tables_of_t<Table>::empty(), "table depends on another table");
|
static_assert(required_tables_of_t<Table>::empty(), "table depends on another table");
|
||||||
|
|
||||||
using _data_t = single_table_data_t<Table>;
|
using _data_t = single_table_data_t<Table>;
|
||||||
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// Base template to be inherited by the statement
|
// Base template to be inherited by the statement
|
||||||
template <typename Policies>
|
template <typename Policies>
|
||||||
struct _base_t
|
struct _base_t
|
||||||
|
@ -43,11 +43,6 @@ namespace sqlpp
|
|||||||
|
|
||||||
struct update_t : public statement_name_t<update_name_t>
|
struct update_t : public statement_name_t<update_name_t>
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t>;
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Statement>
|
template <typename Statement>
|
||||||
struct _result_methods_t
|
struct _result_methods_t
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,6 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#warning: Why would we need this?
|
|
||||||
template <typename Exp>
|
template <typename Exp>
|
||||||
using make_parameter_list_t = parameter_list_t<parameters_of_t<Exp>>;
|
using make_parameter_list_t = parameter_list_t<parameters_of_t<Exp>>;
|
||||||
} // namespace sqlpp
|
} // namespace sqlpp
|
||||||
|
@ -71,7 +71,6 @@ namespace sqlpp
|
|||||||
template <typename Context, typename Expr>
|
template <typename Context, typename Expr>
|
||||||
auto to_sql_string(Context& context, const group_by_column<Expr>& t) -> std::string
|
auto to_sql_string(Context& context, const group_by_column<Expr>& t) -> std::string
|
||||||
{
|
{
|
||||||
#warning: Untested
|
|
||||||
return to_sql_string(context, t._expr);
|
return to_sql_string(context, t._expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +83,5 @@ template <typename Expr, typename = check_declare_group_by_column_args<Expr>>
|
|||||||
return {std::move(expr)};
|
return {std::move(expr)};
|
||||||
}
|
}
|
||||||
|
|
||||||
#warning Add tests
|
|
||||||
|
|
||||||
} // namespace sqlpp11
|
} // namespace sqlpp11
|
||||||
|
|
||||||
|
@ -35,13 +35,6 @@ namespace sqlpp
|
|||||||
struct noop
|
struct noop
|
||||||
{
|
{
|
||||||
#warning: All this should go away
|
#warning: All this should go away
|
||||||
using _traits = make_traits<no_value_t, tag::is_noop>;
|
|
||||||
using _nodes = detail::type_vector<>;
|
|
||||||
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Statement>
|
template <typename Statement>
|
||||||
struct _result_methods_t
|
struct _result_methods_t
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,5 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#warning Add tests
|
|
||||||
|
|
||||||
} // namespace sqlpp11
|
} // namespace sqlpp11
|
||||||
|
|
||||||
|
@ -218,11 +218,6 @@ namespace sqlpp
|
|||||||
struct no_returning_column_list_t
|
struct no_returning_column_list_t
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t, tag::is_noop, tag::is_missing>;
|
using _traits = make_traits<no_value_t, tag::is_noop, tag::is_missing>;
|
||||||
using _nodes = ::sqlpp::detail::type_vector<>;
|
|
||||||
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
using _data_t = no_data_t;
|
using _data_t = no_data_t;
|
||||||
|
@ -49,11 +49,6 @@ namespace sqlpp
|
|||||||
template <typename InsertOrAlternative>
|
template <typename InsertOrAlternative>
|
||||||
struct insert_or_t : public statement_name_t<InsertOrAlternative>
|
struct insert_or_t : public statement_name_t<InsertOrAlternative>
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t>;
|
|
||||||
struct _sqlpp_name_tag
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Statement>
|
template <typename Statement>
|
||||||
struct _result_methods_t
|
struct _result_methods_t
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,9 @@ void test_group_by()
|
|||||||
auto col_int = test::TabFoo{}.id;
|
auto col_int = test::TabFoo{}.id;
|
||||||
auto col_txt = test::TabFoo{}.textNnD;
|
auto col_txt = test::TabFoo{}.textNnD;
|
||||||
|
|
||||||
|
// Test that declared group by columns are considered group by columns
|
||||||
|
static_assert(sqlpp::is_group_by_column<decltype(declare_group_by_column(v))>::value, "");
|
||||||
|
|
||||||
// Constant values are neutral and therefore considered neither aggregate and non-aggregate.
|
// Constant values are neutral and therefore considered neither aggregate and non-aggregate.
|
||||||
static_assert(decltype(known_aggregate_columns_as_expected(col_int))::value, "");
|
static_assert(decltype(known_aggregate_columns_as_expected(col_int))::value, "");
|
||||||
static_assert(decltype(known_aggregate_columns_as_expected(col_int, col_txt))::value, "");
|
static_assert(decltype(known_aggregate_columns_as_expected(col_int, col_txt))::value, "");
|
||||||
|
Loading…
Reference in New Issue
Block a user