0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Merge branch 'develop' of https://github.com/isliser/sqlpp11 into isliser-develop

Conflicts:
	include/sqlpp11/where.h
This commit is contained in:
rbock 2015-12-27 19:57:42 +01:00
commit bab5b6d8ee
28 changed files with 776 additions and 54 deletions

View File

@ -123,12 +123,23 @@ namespace sqlpp
Expr, Expr,
wrap_operand_t<T>>; wrap_operand_t<T>>;
// workaround for msvs bug
// template <template <typename Lhs, typename... Rhs> class NewExpr, typename... T>
// using _new_nary_expression_t =
// new_nary_expression_t<logic::all_t<check_rhs_comparison_operand_t<ValueType,
// wrap_operand_t<T>>::value...>,
// NewExpr,
// Expr,
// wrap_operand_t<T>...>;
template <template <typename Lhs, typename... Rhs> class NewExpr, typename... T> template <template <typename Lhs, typename... Rhs> class NewExpr, typename... T>
using _new_nary_expression_t = struct _new_nary_expression
new_nary_expression_t<logic::all_t<check_rhs_comparison_operand_t<ValueType, wrap_operand_t<T>>::value...>, {
NewExpr, using type =
Expr, new_nary_expression_t<logic::all_t<check_rhs_comparison_operand_t<ValueType, wrap_operand_t<T>>::value...>,
wrap_operand_t<T>...>; NewExpr,
Expr,
wrap_operand_t<T>...>;
};
template <typename T> template <typename T>
_new_binary_expression_t<equal_to_t, T> operator==(T t) const _new_binary_expression_t<equal_to_t, T> operator==(T t) const
@ -205,18 +216,32 @@ namespace sqlpp
} }
// Hint: use value_list wrapper for containers... // Hint: use value_list wrapper for containers...
// workaround for msvs bug
// template <typename... T>
// _new_nary_expression_t<in_t, T...> in(T... t) const
// {
// check_rhs_in_arguments_t<ValueType, wrap_operand_t<T>...>::_();
// return {*static_cast<const Expr*>(this), wrap_operand_t<T>{t}...};
// }
template <typename... T> template <typename... T>
_new_nary_expression_t<in_t, T...> in(T... t) const typename _new_nary_expression<in_t, T...>::type in(T... t) const
{ {
check_rhs_in_arguments_t<ValueType, wrap_operand_t<T>...>::_(); check_rhs_in_arguments_t<ValueType, wrap_operand_t<T>...>::_();
return {*static_cast<const Expr*>(this), wrap_operand_t<T>{t}...}; return {*static_cast<const Expr*>(this), typename wrap_operand<T>::type{t}...};
} }
// workaround for msvs bug
// template <typename... T>
// _new_nary_expression_t<not_in_t, T...> not_in(T... t) const
// {
// check_rhs_in_arguments_t<ValueType, wrap_operand_t<T>...>::_();
// return {*static_cast<const Expr*>(this), wrap_operand_t<T>{t}...};
// }
template <typename... T> template <typename... T>
_new_nary_expression_t<not_in_t, T...> not_in(T... t) const typename _new_nary_expression<not_in_t, T...>::type not_in(T... t) const
{ {
check_rhs_in_arguments_t<ValueType, wrap_operand_t<T>...>::_(); check_rhs_in_arguments_t<ValueType, wrap_operand_t<T>...>::_();
return {*static_cast<const Expr*>(this), wrap_operand_t<T>{t}...}; return {*static_cast<const Expr*>(this), typename wrap_operand<T>::type{t}...};
} }
template <typename Defer = void> template <typename Defer = void>

View File

@ -104,11 +104,24 @@ namespace sqlpp
} }
}; };
template <typename Context, typename... Args> // workaround for msvs bug https://connect.microsoft.com/VisualStudio/feedback/details/2173053
struct serializer_t<Context, column_t<Args...>> // template <typename Context, typename... Args>
// struct serializer_t<Context, column_t<Args...>>
// {
// using _serialize_check = consistent_t;
// using T = column_t<Args...>;
//
// static Context& _(const T&, Context& context)
// {
// context << name_of<typename T::_table>::char_ptr() << '.' << name_of<T>::char_ptr();
// return context;
// }
// };
template <typename Context, typename Args1, typename Args2>
struct serializer_t<Context, column_t<Args1, Args2>>
{ {
using _serialize_check = consistent_t; using _serialize_check = consistent_t;
using T = column_t<Args...>; using T = column_t<Args1, Args2>;
static Context& _(const T&, Context& context) static Context& _(const T&, Context& context)
{ {

View File

@ -123,9 +123,18 @@ namespace sqlpp
template <typename AliasProvider, typename Statement> template <typename AliasProvider, typename Statement>
using make_cte_t = typename make_cte_impl<AliasProvider, Statement, get_result_row_t<Statement>>::type; using make_cte_t = typename make_cte_impl<AliasProvider, Statement, get_result_row_t<Statement>>::type;
// workaround for msvc unknown internal error
// template <typename AliasProvider, typename Statement, typename... FieldSpecs>
// struct cte_t
// : public member_t<cte_column_spec_t<FieldSpecs>, column_t<AliasProvider, cte_column_spec_t<FieldSpecs>>>...
template <typename AliasProvider, typename FieldSpec>
struct cte_base
{
using type = member_t<cte_column_spec_t<FieldSpec>, column_t<AliasProvider, cte_column_spec_t<FieldSpec>>>;
};
template <typename AliasProvider, typename Statement, typename... FieldSpecs> template <typename AliasProvider, typename Statement, typename... FieldSpecs>
struct cte_t struct cte_t : public cte_base<AliasProvider, FieldSpecs>::type...
: public member_t<cte_column_spec_t<FieldSpecs>, column_t<AliasProvider, cte_column_spec_t<FieldSpecs>>>...
{ {
using _traits = make_traits<no_value_t, tag::is_cte, tag::is_table>; // FIXME: is table? really? using _traits = make_traits<no_value_t, tag::is_cte, tag::is_table>; // FIXME: is table? really?
using _nodes = detail::type_vector<>; using _nodes = detail::type_vector<>;
@ -137,8 +146,13 @@ namespace sqlpp
using _column_tuple_t = std::tuple<column_t<AliasProvider, cte_column_spec_t<FieldSpecs>>...>; using _column_tuple_t = std::tuple<column_t<AliasProvider, cte_column_spec_t<FieldSpecs>>...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
// template <typename... T>
// using _check = logic::all_t<is_statement_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_statement_t<T>::value...>; struct _check : logic::all_t<is_statement_t<T>::value...>
{
};
using _result_row_t = result_row_t<void, FieldSpecs...>; using _result_row_t = result_row_t<void, FieldSpecs...>;

View File

@ -45,7 +45,9 @@ namespace sqlpp
struct _alias_t struct _alias_t
{ {
static constexpr const char _literal[] = "like_"; // workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2100550
// static constexpr const char _literal[] = "like_";
static constexpr const char _literal[6] = "like_";
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>; using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template <typename T> template <typename T>
struct _member_t struct _member_t

View File

@ -246,6 +246,22 @@ namespace sqlpp
template <template <typename> class Transformation, typename T> template <template <typename> class Transformation, typename T>
using transform_set_t = typename transform_set<Transformation, T>::type; using transform_set_t = typename transform_set<Transformation, T>::type;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/feedback/details/2173198
template <typename T>
struct make_name_of_set
{
static_assert(wrong_t<make_name_of_set>::value, "invalid argument for transform_set");
};
template <typename... E>
struct make_name_of_set<type_set<E...>>
{
using type = make_type_set_t<typename E::_alias_t::_name_t...>;
};
template <typename T>
using make_name_of_set_t = typename make_name_of_set<T>::type;
} }
} }

View File

@ -236,9 +236,17 @@ namespace sqlpp
}; };
} }
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
template <typename Expr>
using lhs = detail::lhs_impl<Expr>;
template <typename Expr> template <typename Expr>
using lhs_t = typename detail::lhs_impl<Expr>::type; using lhs_t = typename detail::lhs_impl<Expr>::type;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
template <typename Expr>
using rhs = detail::rhs_impl<Expr>;
template <typename Expr> template <typename Expr>
using rhs_t = typename detail::rhs_impl<Expr>::type; using rhs_t = typename detail::rhs_impl<Expr>::type;
} }

View File

@ -63,6 +63,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -72,6 +78,13 @@ namespace sqlpp
{ {
using _data_t = extra_tables_data_t<Tables...>; using _data_t = extra_tables_data_t<Tables...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: extra_tables{std::forward<Args>(args)...}
{
}
_impl_t<Policies> extra_tables; _impl_t<Policies> extra_tables;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -105,6 +118,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -114,6 +133,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_extra_tables{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_extra_tables; _impl_t<Policies> no_extra_tables;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -133,8 +159,13 @@ namespace sqlpp
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_extra_tables_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_extra_tables_t, T>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_table_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_table_t<T>::value...>; struct _check : logic::all_t<is_table_t<T>::value...>
{
};
using _consistency_check = consistent_t; using _consistency_check = consistent_t;
@ -159,7 +190,9 @@ namespace sqlpp
static constexpr std::size_t _number_of_tables = detail::sum(provided_tables_of<Tables>::size::value...); static constexpr std::size_t _number_of_tables = detail::sum(provided_tables_of<Tables>::size::value...);
using _unique_tables = detail::make_joined_set_t<provided_tables_of<Tables>...>; using _unique_tables = detail::make_joined_set_t<provided_tables_of<Tables>...>;
using _unique_table_names = detail::transform_set_t<name_of, _unique_tables>; // workaround for msvc bug https://connect.microsoft.com/VisualStudio/feedback/details/2173198
// using _unique_table_names = detail::transform_set_t<name_of, _unique_tables>;
using _unique_table_names = detail::make_name_of_set_t<_unique_tables>;
static_assert(_number_of_tables == _unique_tables::size::value, static_assert(_number_of_tables == _unique_tables::size::value,
"at least one duplicate table detected in extra_tables()"); "at least one duplicate table detected in extra_tables()");
static_assert(_number_of_tables == _unique_table_names::size::value, static_assert(_number_of_tables == _unique_table_names::size::value,

View File

@ -71,6 +71,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Table> template <typename Table>
void add(Table table) void add(Table table)
{ {
@ -78,7 +84,9 @@ namespace sqlpp
static_assert(is_table_t<Table>::value, "invalid table argument in from::add()"); static_assert(is_table_t<Table>::value, "invalid table argument in from::add()");
using _known_tables = using _known_tables =
detail::make_joined_set_t<provided_tables_of<Tables>...>; // Hint: Joins contain more than one table detail::make_joined_set_t<provided_tables_of<Tables>...>; // Hint: Joins contain more than one table
using _known_table_names = detail::transform_set_t<name_of, _known_tables>; // workaround for msvc bug https://connect.microsoft.com/VisualStudio/feedback/details/2173198
// using _known_table_names = detail::transform_set_t<name_of, _known_tables>;
using _known_table_names = detail::make_name_of_set_t<_known_tables>;
static_assert(not detail::is_element_of<typename Table::_alias_t, _known_table_names>::value, static_assert(not detail::is_element_of<typename Table::_alias_t, _known_table_names>::value,
"Must not use the same table name twice in from()"); "Must not use the same table name twice in from()");
using _serialize_check = sqlpp::serialize_check_t<typename Database::_serializer_context_t, Table>; using _serialize_check = sqlpp::serialize_check_t<typename Database::_serializer_context_t, Table>;
@ -109,6 +117,13 @@ namespace sqlpp
{ {
using _data_t = from_data_t<Database, Tables...>; using _data_t = from_data_t<Database, Tables...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: from{std::forward<Args>(args)...}
{
}
_impl_t<Policies> from; _impl_t<Policies> from;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -142,6 +157,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -151,6 +172,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_from{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_from; _impl_t<Policies> no_from;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -169,8 +197,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_table_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_table_t<T>::value...>; struct _check : logic::all_t<is_table_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_from_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_from_t, T>;
@ -208,7 +241,7 @@ namespace sqlpp
static constexpr std::size_t _number_of_tables = detail::sum(provided_tables_of<Tables>::size::value...); static constexpr std::size_t _number_of_tables = detail::sum(provided_tables_of<Tables>::size::value...);
using _unique_tables = detail::make_joined_set_t<provided_tables_of<Tables>...>; using _unique_tables = detail::make_joined_set_t<provided_tables_of<Tables>...>;
using _unique_table_names = detail::transform_set_t<name_of, _unique_tables>; using _unique_table_names = detail::make_name_of_set_t<_unique_tables>;
static_assert(_number_of_tables == _unique_tables::size::value, static_assert(_number_of_tables == _unique_tables::size::value,
"at least one duplicate table detected in from()"); "at least one duplicate table detected in from()");
static_assert(_number_of_tables == _unique_table_names::size::value, static_assert(_number_of_tables == _unique_table_names::size::value,

View File

@ -78,6 +78,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Expression> template <typename Expression>
void add_ntc(Expression expression) void add_ntc(Expression expression)
{ {
@ -119,6 +125,13 @@ namespace sqlpp
{ {
using _data_t = group_by_data_t<Database, Expressions...>; using _data_t = group_by_data_t<Database, Expressions...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: group_by{std::forward<Args>(args)...}
{
}
_impl_t<Policies> group_by; _impl_t<Policies> group_by;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -154,6 +167,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -163,6 +182,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_group_by{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_group_by; _impl_t<Policies> no_group_by;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -181,8 +207,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_expression_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_expression_t<T>::value...>; struct _check : logic::all_t<is_expression_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_group_by_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_group_by_t, T>;

View File

@ -74,6 +74,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Expression> template <typename Expression>
void add_ntc(Expression expression) void add_ntc(Expression expression)
{ {
@ -115,6 +121,13 @@ namespace sqlpp
{ {
using _data_t = having_data_t<Database, Expressions...>; using _data_t = having_data_t<Database, Expressions...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: having{std::forward<Args>(args)...}
{
}
_impl_t<Policies> having; _impl_t<Policies> having;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -150,6 +163,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -159,6 +178,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_having{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_having; _impl_t<Policies> no_having;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -177,8 +203,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_expression_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_expression_t<T>::value...>; struct _check : logic::all_t<is_expression_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_having_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_having_t, T>;

View File

@ -78,6 +78,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -87,6 +93,13 @@ namespace sqlpp
{ {
using _data_t = insert_default_values_data_t; using _data_t = insert_default_values_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: default_values{std::forward<Args>(args)...}
{
}
_impl_t<Policies> default_values; _impl_t<Policies> default_values;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -111,7 +124,7 @@ namespace sqlpp
struct insert_list_data_t struct insert_list_data_t
{ {
insert_list_data_t(Assignments... assignments) insert_list_data_t(Assignments... assignments)
: _assignments(assignments...), _columns({assignments._lhs}...), _values(assignments._rhs...) : _assignments(assignments...), _columns(assignments._lhs...), _values(assignments._rhs...)
{ {
} }
@ -142,27 +155,71 @@ namespace sqlpp
SQLPP_PORTABLE_STATIC_ASSERT(assert_insert_dynamic_set_statement_dynamic_t, SQLPP_PORTABLE_STATIC_ASSERT(assert_insert_dynamic_set_statement_dynamic_t,
"dynamic_set must not be called in a static statement"); "dynamic_set must not be called in a static statement");
// workaround for msvc bugs https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269 &
// https://connect.microsoft.com/VisualStudio/Feedback/Details/2173198
// template <typename... Assignments>
// using check_insert_set_t = static_combined_check_t<
// static_check_t<logic::all_t<is_assignment_t<Assignments>::value...>::value, assert_insert_set_assignments_t>,
// static_check_t<not detail::has_duplicates<lhs_t<Assignments>...>::value, assert_insert_set_no_duplicates_t>,
// static_check_t<logic::none_t<must_not_insert_t<lhs_t<Assignments>>::value...>::value,
// assert_insert_set_prohibited_t>,
// static_check_t<sizeof...(Assignments) == 0 or
// detail::make_joined_set_t<required_tables_of<lhs_t<Assignments>>...>::size::value == 1,
// assert_insert_set_one_table_t>>;
template <typename Expr>
struct must_not_insert
{
static const bool value = must_not_insert_t<lhs_t<Expr>>::value;
};
template <typename... Assignments> template <typename... Assignments>
using check_insert_set_t = static_combined_check_t< using check_insert_set_t = static_combined_check_t<
static_check_t<logic::all_t<is_assignment_t<Assignments>::value...>::value, assert_insert_set_assignments_t>, static_check_t<logic::all_t<detail::is_assignment_impl<Assignments>::type::value...>::value,
static_check_t<not detail::has_duplicates<lhs_t<Assignments>...>::value, assert_insert_set_no_duplicates_t>, assert_insert_set_assignments_t>,
static_check_t<logic::none_t<must_not_insert_t<lhs_t<Assignments>>::value...>::value, static_check_t<not detail::has_duplicates<typename lhs<Assignments>::type...>::value,
assert_insert_set_prohibited_t>, assert_insert_set_no_duplicates_t>,
static_check_t<sizeof...(Assignments) == 0 or static_check_t<logic::none_t<must_not_insert<Assignments>::value...>::value, assert_insert_set_prohibited_t>,
detail::make_joined_set_t<required_tables_of<lhs_t<Assignments>>...>::size::value == 1, static_check_t<
assert_insert_set_one_table_t>>; sizeof...(Assignments) == 0 or
detail::make_joined_set_t<required_tables_of<typename lhs<Assignments>::type>...>::size::value == 1,
assert_insert_set_one_table_t>>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... Assignments>
// using check_insert_static_set_t =
// static_combined_check_t<check_insert_set_t<Assignments...>,
// static_check_t<sizeof...(Assignments) != 0, assert_insert_static_set_count_args_t>,
// static_check_t<detail::have_all_required_columns<lhs_t<Assignments>...>::value,
// assert_insert_static_set_all_required_t>>;
template <typename... Assignments>
struct check_insert_static_set
{
using type = static_combined_check_t<
check_insert_set_t<Assignments...>,
static_check_t<sizeof...(Assignments) != 0, assert_insert_static_set_count_args_t>,
static_check_t<detail::have_all_required_columns<typename lhs<Assignments>::type...>::value,
assert_insert_static_set_all_required_t>>;
};
template <typename... Assignments> template <typename... Assignments>
using check_insert_static_set_t = using check_insert_static_set_t = typename check_insert_static_set<Assignments...>::type;
static_combined_check_t<check_insert_set_t<Assignments...>,
static_check_t<sizeof...(Assignments) != 0, assert_insert_static_set_count_args_t>, // workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
static_check_t<detail::have_all_required_columns<lhs_t<Assignments>...>::value, // template <typename Database, typename... Assignments>
assert_insert_static_set_all_required_t>>; // using check_insert_dynamic_set_t = static_combined_check_t<
// static_check_t<not std::is_same<Database, void>::value, assert_insert_dynamic_set_statement_dynamic_t>,
// check_insert_set_t<Assignments...>>;
template <typename Database, typename... Assignments>
struct check_insert_dynamic_set
{
using type = static_combined_check_t<
static_check_t<not std::is_same<Database, void>::value, assert_insert_dynamic_set_statement_dynamic_t>,
check_insert_set_t<Assignments...>>;
};
template <typename Database, typename... Assignments> template <typename Database, typename... Assignments>
using check_insert_dynamic_set_t = static_combined_check_t< using check_insert_dynamic_set_t = typename check_insert_dynamic_set<Database, Assignments...>::type;
static_check_t<not std::is_same<Database, void>::value, assert_insert_dynamic_set_statement_dynamic_t>,
check_insert_set_t<Assignments...>>;
SQLPP_PORTABLE_STATIC_ASSERT( SQLPP_PORTABLE_STATIC_ASSERT(
assert_no_unknown_tables_in_insert_assignments_t, assert_no_unknown_tables_in_insert_assignments_t,
@ -188,6 +245,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Assignment> template <typename Assignment>
void add_ntc(Assignment assignment) void add_ntc(Assignment assignment)
{ {
@ -234,6 +297,13 @@ namespace sqlpp
{ {
using _data_t = insert_list_data_t<Database, Assignments...>; using _data_t = insert_list_data_t<Database, Assignments...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: insert_list{std::forward<Args>(args)...}
{
}
_impl_t<Policies> insert_list; _impl_t<Policies> insert_list;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -259,7 +329,8 @@ namespace sqlpp
template <typename... Columns> template <typename... Columns>
struct column_list_data_t struct column_list_data_t
{ {
column_list_data_t(Columns... cols) : _columns(simple_column_t<Columns>{cols}...) // workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
column_list_data_t(Columns... cols) : _columns(simple_column_t<Columns>(cols)...)
{ {
} }
@ -292,6 +363,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename... Assignments> template <typename... Assignments>
void add(Assignments... assignments) void add(Assignments... assignments)
{ {
@ -326,6 +403,13 @@ namespace sqlpp
{ {
using _data_t = column_list_data_t<Columns...>; using _data_t = column_list_data_t<Columns...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: values{std::forward<Args>(args)...}
{
}
_impl_t<Policies> values; _impl_t<Policies> values;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -363,6 +447,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -372,6 +462,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_insert_values{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_insert_values; _impl_t<Policies> no_insert_values;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -390,8 +487,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _column_check = logic::all_t<is_column_t<T>::value...>;
template <typename... T> template <typename... T>
using _column_check = logic::all_t<is_column_t<T>::value...>; struct _column_check : logic::all_t<is_column_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_insert_value_list_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_insert_value_list_t, T>;

View File

@ -71,6 +71,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -80,6 +86,13 @@ namespace sqlpp
{ {
using _data_t = into_data_t<Database, Table>; using _data_t = into_data_t<Database, Table>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: into{std::forward<Args>(args)...}
{
}
_impl_t<Policies> into; _impl_t<Policies> into;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {

View File

@ -64,6 +64,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -73,6 +79,13 @@ namespace sqlpp
{ {
using _data_t = limit_data_t<Limit>; using _data_t = limit_data_t<Limit>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: limit{std::forward<Args>(args)...}
{
}
_impl_t<Policies> limit; _impl_t<Policies> limit;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -131,6 +144,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Limit> template <typename Limit>
void set(Limit value) void set(Limit value)
{ {
@ -151,6 +170,13 @@ namespace sqlpp
{ {
using _data_t = dynamic_limit_data_t<Database>; using _data_t = dynamic_limit_data_t<Database>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: limit{std::forward<Args>(args)...}
{
}
_impl_t<Policies> limit; _impl_t<Policies> limit;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -183,6 +209,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -192,6 +224,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_limit{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_limit; _impl_t<Policies> no_limit;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {

View File

@ -38,9 +38,25 @@ namespace sqlpp
struct logic_helper; struct logic_helper;
// see http://lists.boost.org/Archives/boost/2014/05/212946.php :-) // see http://lists.boost.org/Archives/boost/2014/05/212946.php :-)
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
template <bool... B>
struct all
{
using type = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>;
};
template <bool... B> template <bool... B>
using all_t = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>; using all_t = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
template <bool... B>
struct any
{
using type =
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>;
};
template <bool... B> template <bool... B>
using any_t = using any_t =
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>; std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>;

View File

@ -66,6 +66,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -75,6 +81,13 @@ namespace sqlpp
{ {
using _data_t = offset_data_t<Offset>; using _data_t = offset_data_t<Offset>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: offset{std::forward<Args>(args)...}
{
}
_impl_t<Policies> offset; _impl_t<Policies> offset;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -133,6 +146,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Offset> template <typename Offset>
void set(Offset value) void set(Offset value)
{ {
@ -153,6 +172,13 @@ namespace sqlpp
{ {
using _data_t = dynamic_offset_data_t<Database>; using _data_t = dynamic_offset_data_t<Database>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: offset{std::forward<Args>(args)...}
{
}
_impl_t<Policies> offset; _impl_t<Policies> offset;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -197,6 +223,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -206,6 +238,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_offset{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_offset; _impl_t<Policies> no_offset;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {

View File

@ -75,6 +75,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Expression> template <typename Expression>
void add_ntc(Expression expression) void add_ntc(Expression expression)
{ {
@ -116,6 +122,13 @@ namespace sqlpp
{ {
using _data_t = order_by_data_t<Database, Expressions...>; using _data_t = order_by_data_t<Database, Expressions...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: order_by{std::forward<Args>(args)...}
{
}
_impl_t<Policies> order_by; _impl_t<Policies> order_by;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -151,6 +164,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -160,6 +179,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2091069
template <typename... Args>
_base_t(Args&&... args)
: no_order_by{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_order_by; _impl_t<Policies> no_order_by;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -178,8 +204,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_sort_order_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_sort_order_t<T>::value...>; struct _check : logic::all_t<is_sort_order_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_order_by_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_order_by_t, T>;

View File

@ -184,6 +184,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename NamedExpression> template <typename NamedExpression>
void add_ntc(NamedExpression namedExpression) void add_ntc(NamedExpression namedExpression)
{ {
@ -231,6 +237,13 @@ namespace sqlpp
{ {
using _data_t = select_column_list_data_t<Database, Columns...>; using _data_t = select_column_list_data_t<Database, Columns...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: selected_columns{std::forward<Args>(args)...}
{
}
_impl_t<Policies> selected_columns; _impl_t<Policies> selected_columns;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -380,6 +393,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -389,6 +408,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_selected_columns{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_selected_columns; _impl_t<Policies> no_selected_columns;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -407,8 +433,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<(is_selectable_t<T>::value or is_multi_column_t<T>::value)...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<(is_selectable_t<T>::value or is_multi_column_t<T>::value)...>; struct _check : logic::all_t<(is_selectable_t<T>::value or is_multi_column_t<T>::value)...>
{
};
template <typename... T> template <typename... T>
static constexpr auto _check_tuple(std::tuple<T...>) -> _check<T...> static constexpr auto _check_tuple(std::tuple<T...>) -> _check<T...>

View File

@ -71,6 +71,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Flag> template <typename Flag>
void add_ntc(Flag flag) void add_ntc(Flag flag)
{ {
@ -112,6 +118,13 @@ namespace sqlpp
{ {
using _data_t = select_flag_list_data_t<Database, Flags...>; using _data_t = select_flag_list_data_t<Database, Flags...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: select_flags{std::forward<Args>(args)...}
{
}
_impl_t<Policies> select_flags; _impl_t<Policies> select_flags;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -144,6 +157,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -153,6 +172,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_select_flags{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_select_flags; _impl_t<Policies> no_select_flags;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -171,8 +197,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_select_flag_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_select_flag_t<T>::value...>; struct _check : logic::all_t<detail::is_select_flag_impl<T>::type::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_select_flag_list_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_select_flag_list_t, T>;

View File

@ -38,6 +38,12 @@ namespace sqlpp
using _column_t = Column; using _column_t = Column;
_column_t _column; _column_t _column;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
simple_column_t() = default;
simple_column_t(const _column_t& column) : _column{column}
{
}
using _traits = make_traits<no_value_t, tag::is_noop>; using _traits = make_traits<no_value_t, tag::is_noop>;
using _nodes = detail::type_vector<>; using _nodes = detail::type_vector<>;
}; };

View File

@ -73,6 +73,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -82,6 +88,13 @@ namespace sqlpp
{ {
using _data_t = single_table_data_t<Database, Table>; using _data_t = single_table_data_t<Database, Table>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: from{std::forward<Args>(args)...}
{
}
_impl_t<Policies> from; _impl_t<Policies> from;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {

View File

@ -84,10 +84,17 @@ namespace sqlpp
template <typename Expression> template <typename Expression>
using _no_unknown_tables = detail::is_subset_of<required_tables_of<Expression>, _known_tables>; using _no_unknown_tables = detail::is_subset_of<required_tables_of<Expression>, _known_tables>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
// template <typename... Expressions>
// using _no_unknown_aggregates =
// logic::any_t<_all_provided_aggregates::size::value == 0,
// logic::all_t<is_aggregate_expression_t<_all_provided_aggregates,
// Expressions>::value...>::value>;
template <typename... Expressions> template <typename... Expressions>
using _no_unknown_aggregates = using _no_unknown_aggregates =
logic::any_t<_all_provided_aggregates::size::value == 0, logic::any_t<_all_provided_aggregates::size::value == 0,
logic::all_t<is_aggregate_expression_t<_all_provided_aggregates, Expressions>::value...>::value>; logic::all_t<detail::is_aggregate_expression_impl<_all_provided_aggregates,
Expressions>::type::value...>::value>;
template <template <typename> class Predicate> template <template <typename> class Predicate>
using any_t = logic::any_t<Predicate<Policies>::value...>; using any_t = logic::any_t<Predicate<Policies>::value...>;
@ -193,10 +200,17 @@ namespace sqlpp
{ {
} }
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename Statement, typename Term>
// statement_t(Statement statement, Term term)
// : Policies::template _base_t<_policies_t>{typename Policies::template _impl_t<_policies_t>{
// detail::pick_arg<typename Policies::template _base_t<_policies_t>>(statement, term)}}...
// {
// }
template <typename Statement, typename Term> template <typename Statement, typename Term>
statement_t(Statement statement, Term term) statement_t(Statement statement, Term term)
: Policies::template _base_t<_policies_t>{typename Policies::template _impl_t<_policies_t>{ : Policies::template _base_t<_policies_t>(typename Policies::template _impl_t<_policies_t>(
detail::pick_arg<typename Policies::template _base_t<_policies_t>>(statement, term)}}... detail::pick_arg<typename Policies::template _base_t<_policies_t>>(statement, term)))...
{ {
} }
@ -265,6 +279,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -274,6 +294,13 @@ namespace sqlpp
{ {
using _data_t = NameData; using _data_t = NameData;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: statement_name{std::forward<Args>(args)...}
{
}
_impl_t<Policies> statement_name; _impl_t<Policies> statement_name;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {

View File

@ -41,8 +41,11 @@ namespace sqlpp
{ {
}; };
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173198
// template <typename Table, typename... ColumnSpec>
// struct table_t : public table_base_t, public member_t<ColumnSpec, column_t<Table, ColumnSpec>>...
template <typename Table, typename... ColumnSpec> template <typename Table, typename... ColumnSpec>
struct table_t : public table_base_t, public member_t<ColumnSpec, column_t<Table, ColumnSpec>>... struct table_t : public table_base_t, public ColumnSpec::_alias_t::template _member_t<column_t<Table, ColumnSpec>>...
{ {
using _traits = make_traits<no_value_t, tag::is_raw_table, tag::is_table>; using _traits = make_traits<no_value_t, tag::is_raw_table, tag::is_table>;

View File

@ -35,8 +35,11 @@
namespace sqlpp namespace sqlpp
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173198
// template <typename AliasProvider, typename Table, typename... ColumnSpec>
// struct table_alias_t : public member_t<ColumnSpec, column_t<AliasProvider, ColumnSpec>>...
template <typename AliasProvider, typename Table, typename... ColumnSpec> template <typename AliasProvider, typename Table, typename... ColumnSpec>
struct table_alias_t : public member_t<ColumnSpec, column_t<AliasProvider, ColumnSpec>>... struct table_alias_t : public ColumnSpec::_alias_t::template _member_t<column_t<AliasProvider, ColumnSpec>>...
{ {
// FIXME: Need to add join functionality // FIXME: Need to add join functionality
using _traits = make_traits<value_type_of<Table>, using _traits = make_traits<value_type_of<Table>,

View File

@ -78,7 +78,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
public: // workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -88,6 +93,13 @@ namespace sqlpp
{ {
using _data_t = union_data_t<Database, Flag, Lhs, Rhs>; using _data_t = union_data_t<Database, Flag, Lhs, Rhs>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: union_{std::forward<Args>(args)...}
{
}
_impl_t<Policies> union_; _impl_t<Policies> union_;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -137,6 +149,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -146,6 +164,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_union{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_union; _impl_t<Policies> no_union;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -164,8 +189,11 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_statement_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_statement_t<T>::value...>; using _check = typename logic::all<is_statement_t<T>::value...>::type;
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = union_statement_t<Check::value, T>; using _new_statement_t = union_statement_t<Check::value, T>;

View File

@ -71,6 +71,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Assignment> template <typename Assignment>
void add_ntc(Assignment assignment) void add_ntc(Assignment assignment)
{ {
@ -116,6 +122,13 @@ namespace sqlpp
{ {
using _data_t = update_list_data_t<Database, Assignments...>; using _data_t = update_list_data_t<Database, Assignments...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: assignments{std::forward<Args>(args)...}
{
}
_impl_t<Policies> assignments; _impl_t<Policies> assignments;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -152,6 +165,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -161,6 +180,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_assignments{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_assignments; _impl_t<Policies> no_assignments;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -179,8 +205,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_assignment_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_assignment_t<T>::value...>; struct _check : public logic::all_t<is_assignment_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_update_list_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_update_list_t, T>;

View File

@ -69,6 +69,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Table> template <typename Table>
void add(Table table) void add(Table table)
{ {
@ -102,6 +108,13 @@ namespace sqlpp
{ {
using _data_t = using_data_t<Database, Tables...>; using _data_t = using_data_t<Database, Tables...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: using_{std::forward<Args>(args)...}
{
}
_impl_t<Policies> using_; _impl_t<Policies> using_;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -136,6 +149,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -145,6 +164,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_using{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_using; _impl_t<Policies> no_using;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -163,8 +189,13 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_table_t<T>::value...>;
template <typename... T> template <typename... T>
using _check = logic::all_t<is_table_t<T>::value...>; struct _check : logic::all_t<is_table_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_using_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_using_t, T>;

View File

@ -75,6 +75,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
template <typename Expression> template <typename Expression>
void add_ntc(Expression expression) void add_ntc(Expression expression)
{ {
@ -118,6 +124,13 @@ namespace sqlpp
{ {
using _data_t = where_data_t<Database, Expressions...>; using _data_t = where_data_t<Database, Expressions...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: where{std::forward<Args>(args)...}
{
}
_impl_t<Policies> where; _impl_t<Policies> where;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -160,6 +173,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -169,6 +188,13 @@ namespace sqlpp
{ {
using _data_t = where_data_t<void, bool>; using _data_t = where_data_t<void, bool>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: where{std::forward<Args>(args)...}
{
}
_impl_t<Policies> where; _impl_t<Policies> where;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -231,6 +257,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -240,6 +272,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_where{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_where; _impl_t<Policies> no_where;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -258,6 +297,14 @@ namespace sqlpp
using _database_t = typename Policies::_database_t; using _database_t = typename Policies::_database_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
// template <typename... T>
// using _check = logic::all_t<is_expression_t<T>::value...>;
template <typename... T>
struct _check : logic::all_t<is_expression_t<T>::value...>
{
};
template <typename Check, typename T> template <typename Check, typename T>
using _new_statement_t = new_statement_t<Check::value, Policies, no_where_t, T>; using _new_statement_t = new_statement_t<Check::value, Policies, no_where_t, T>;

View File

@ -79,7 +79,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
public: // workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -89,6 +94,13 @@ namespace sqlpp
{ {
using _data_t = with_data_t<Database, Expressions...>; using _data_t = with_data_t<Database, Expressions...>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: with{std::forward<Args>(args)...}
{
}
_impl_t<Policies> with; _impl_t<Policies> with;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {
@ -122,6 +134,12 @@ namespace sqlpp
template <typename Policies> template <typename Policies>
struct _impl_t struct _impl_t
{ {
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
_impl_t() = default;
_impl_t(const _data_t& data) : _data(data)
{
}
_data_t _data; _data_t _data;
}; };
@ -131,6 +149,13 @@ namespace sqlpp
{ {
using _data_t = no_data_t; using _data_t = no_data_t;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
template <typename... Args>
_base_t(Args&&... args)
: no_with{std::forward<Args>(args)...}
{
}
_impl_t<Policies> no_with; _impl_t<Policies> no_with;
_impl_t<Policies>& operator()() _impl_t<Policies>& operator()()
{ {