mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Added tags missing and return_value
missing indicates that a statement part has yet to be added (e.g. columns in a select). return_value indicates that a statement part can be used as a return value.
This commit is contained in:
parent
f314c6d070
commit
e39444b0f7
@ -157,6 +157,9 @@ namespace sqlpp
|
||||
using type = typename make_type_set_if<Predicate, Rest...>::type::template insert_if<Predicate, T>::type;
|
||||
};
|
||||
|
||||
template<template<typename> class Predicate, typename... T>
|
||||
using make_type_set_if_t = typename make_type_set_if<Predicate, T...>::type;
|
||||
|
||||
template<template<typename> class Predicate, typename... T>
|
||||
struct make_type_set_if_not
|
||||
{
|
||||
|
@ -145,9 +145,9 @@ namespace sqlpp
|
||||
>::type;
|
||||
|
||||
using _value_type = typename std::conditional<
|
||||
is_select_column_list_t<_column_list_t>::value and is_subset_of<required_tables_of<_column_list_t>, provided_tables_of<_from_t>>::value,
|
||||
detail::make_type_set_if_t<is_missing_t, FlagList, ColumnList, From, ExtraTables, Where, GroupBy, Having, OrderBy, Limit, Offset>::size::value == 0,
|
||||
value_type_of<_column_list_t>,
|
||||
no_value_t // If something is selected that requires a table, then we require a from for this to be a value
|
||||
no_value_t // if a required statement part is missing (columns in a select), then the statement cannot be used as a value
|
||||
>::type;
|
||||
|
||||
using _traits = make_traits<_value_type>;
|
||||
|
@ -106,6 +106,8 @@ namespace sqlpp
|
||||
SQLPP_IS_COLUMN_TRAIT_GENERATOR(trivial_value_is_null);
|
||||
|
||||
SQLPP_IS_VALUE_TRAIT_GENERATOR(noop);
|
||||
SQLPP_IS_VALUE_TRAIT_GENERATOR(missing);
|
||||
SQLPP_IS_VALUE_TRAIT_GENERATOR(return_value);
|
||||
SQLPP_IS_VALUE_TRAIT_GENERATOR(table);
|
||||
SQLPP_IS_VALUE_TRAIT_GENERATOR(join);
|
||||
SQLPP_IS_VALUE_TRAIT_GENERATOR(pseudo_table);
|
||||
|
6
include/sqlpp11/vendor/select_column_list.h
vendored
6
include/sqlpp11/vendor/select_column_list.h
vendored
@ -47,14 +47,14 @@ namespace sqlpp
|
||||
template<typename... Rest>
|
||||
struct get_first_argument_if_unique
|
||||
{
|
||||
using _traits = make_traits<no_value_t, tag::select_column_list>;
|
||||
using _traits = make_traits<no_value_t, tag::select_column_list, tag::return_value>;
|
||||
struct _name_t {};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct get_first_argument_if_unique<T>
|
||||
{
|
||||
using _traits = make_traits<value_type_of<T>, tag::select_column_list, tag::expression, tag::named_expression>;
|
||||
using _traits = make_traits<value_type_of<T>, tag::select_column_list, tag::return_value, tag::expression, tag::named_expression>;
|
||||
using _name_t = typename T::_name_t;
|
||||
};
|
||||
}
|
||||
@ -239,7 +239,7 @@ namespace sqlpp
|
||||
{
|
||||
struct no_select_column_list_t
|
||||
{
|
||||
using _traits = make_traits<no_value_t, ::sqlpp::tag::noop>;
|
||||
using _traits = make_traits<no_value_t, ::sqlpp::tag::noop, ::sqlpp::tag::missing>;
|
||||
using _recursive_traits = make_recursive_traits<>;
|
||||
|
||||
template<typename Db>
|
||||
|
Loading…
Reference in New Issue
Block a user