0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Added _table_set to select_column_list.h

This commit is contained in:
rbock 2014-03-28 18:10:58 +01:00
parent 3f1460cd2e
commit dba5c992ed
4 changed files with 9 additions and 1 deletions

View File

@ -191,6 +191,9 @@ namespace sqlpp
using type = typename joined_set<type_set<E...>, _rest>::type; using type = typename joined_set<type_set<E...>, _rest>::type;
}; };
template<typename... Sets>
using make_joined_set_t = typename make_joined_set<Sets...>::type;
} }
} }

View File

@ -29,6 +29,7 @@
#include <sqlpp11/no_value.h> #include <sqlpp11/no_value.h>
#include <sqlpp11/detail/logic.h> #include <sqlpp11/detail/logic.h>
#include <sqlpp11/detail/type_set.h>
#include <sqlpp11/detail/copy_tuple_args.h> #include <sqlpp11/detail/copy_tuple_args.h>
@ -42,6 +43,8 @@ namespace sqlpp
{ {
static_assert(detail::all_t<is_named_expression_t, Columns...>::value, "multi_column parameters need to be named expressions"); static_assert(detail::all_t<is_named_expression_t, Columns...>::value, "multi_column parameters need to be named expressions");
using _table_set = sqlpp::detail::make_joined_set_t<typename Columns::_table_set...>;
multi_column_t(std::tuple<Columns...> columns): multi_column_t(std::tuple<Columns...> columns):
_columns(columns) _columns(columns)
{} {}
@ -75,6 +78,7 @@ namespace sqlpp
static_assert(detail::all_t<is_named_expression_t, Columns...>::value, "multi_column parameters need to be named expressions"); static_assert(detail::all_t<is_named_expression_t, Columns...>::value, "multi_column parameters need to be named expressions");
using _name_t = typename AliasProvider::_name_t; using _name_t = typename AliasProvider::_name_t;
using _table_set = sqlpp::detail::make_joined_set_t<typename Columns::_table_set...>;
multi_column_alias_t(multi_column_t<void, Columns...> multi_column): multi_column_alias_t(multi_column_t<void, Columns...> multi_column):
_columns(multi_column._columns) _columns(multi_column._columns)

View File

@ -81,7 +81,6 @@ namespace sqlpp
typename Limit = vendor::no_limit_t, typename Limit = vendor::no_limit_t,
typename Offset = vendor::no_offset_t typename Offset = vendor::no_offset_t
> >
#warning: idea: require from() for anything AFTER FROM, including dynamic columns. Then just check for from() in the run methods
struct select_t: public detail::select_helper_t<ColumnList, From>::_value_type::template expression_operators<select_t<Database, FlagList, ColumnList, From, Where, GroupBy, Having, OrderBy, Limit, Offset>> struct select_t: public detail::select_helper_t<ColumnList, From>::_value_type::template expression_operators<select_t<Database, FlagList, ColumnList, From, Where, GroupBy, Having, OrderBy, Limit, Offset>>
{ {
using _database_t = Database; using _database_t = Database;

View File

@ -139,6 +139,8 @@ namespace sqlpp
using _parameter_tuple_t = std::tuple<Columns...>; using _parameter_tuple_t = std::tuple<Columns...>;
using size = std::tuple_size<_parameter_tuple_t>; using size = std::tuple_size<_parameter_tuple_t>;
using _table_set = sqlpp::detail::make_joined_set_t<typename Columns::_table_set...>;
static_assert(not ::sqlpp::detail::has_duplicates<Columns...>::value, "at least one duplicate argument detected"); static_assert(not ::sqlpp::detail::has_duplicates<Columns...>::value, "at least one duplicate argument detected");
template<typename T> template<typename T>