mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-04 04:00:39 -06:00
Merge pull request #60 from isliser/feature/appveyor
added msvc workaround & fixed minor bugs in tests
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include "MockDb.h"
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
int insert(int, char**)
|
||||
int insert(int, char*[])
|
||||
{
|
||||
MockDb db{};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ SQLPP_DECLARE_TABLE(
|
||||
)
|
||||
// clang-format on
|
||||
|
||||
int ppgen(int, char**)
|
||||
int ppgen(int, char*[])
|
||||
{
|
||||
MockDb db{};
|
||||
const auto p = tab_person::tab_person{};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "MockDb.h"
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
int remove(int, char**)
|
||||
int remove(int, char*[])
|
||||
{
|
||||
MockDb db{};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
SQLPP_ALIAS_PROVIDER(cheesecake)
|
||||
|
||||
int select(int, char**)
|
||||
int select(int, char*[])
|
||||
{
|
||||
static constexpr bool some_condition = true;
|
||||
static constexpr bool some_other_condition = false;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "MockDb.h"
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
int update(int, char**)
|
||||
int update(int, char*[])
|
||||
{
|
||||
MockDb db{};
|
||||
|
||||
|
||||
@@ -226,15 +226,25 @@ namespace sqlpp
|
||||
SQLPP_PORTABLE_STATIC_ASSERT(assert_where_dynamic_statement_dynamic_t,
|
||||
"dynamic_where() must not be called in a static statement");
|
||||
|
||||
// workaround for msvc bugs https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629 & https://connect.microsoft.com/VisualStudio/feedback/details/2173198
|
||||
// template <typename... Expressions>
|
||||
// using check_where_t = static_combined_check_t<
|
||||
// static_check_t<logic::all_t<is_expression_t<Expressions>::value...>::value, assert_where_expressions_t>,
|
||||
// static_check_t<logic::all_t<is_boolean_t<Expressions>::value...>::value, assert_where_boolean_t>,
|
||||
// static_check_t<logic::all_t<(not contains_aggregate_function_t<Expressions>::value)...>::value,
|
||||
// assert_where_no_aggregate_functions_t>>;
|
||||
template <typename... Expressions>
|
||||
using check_where_t = static_combined_check_t<
|
||||
static_check_t<logic::all_t<detail::is_expression_impl<Expressions>::type::value...>::value,
|
||||
assert_where_expressions_t>,
|
||||
static_check_t<
|
||||
logic::all_t<std::is_same<typename detail::value_type_of_impl<Expressions>::type, boolean>::value...>::value,
|
||||
assert_where_boolean_t>,
|
||||
static_check_t<logic::all_t<(not detail::contains_aggregate_function_impl<Expressions>::type::value)...>::value,
|
||||
assert_where_no_aggregate_functions_t>>;
|
||||
struct check_where
|
||||
{
|
||||
using type = static_combined_check_t<
|
||||
static_check_t<logic::all_t<detail::is_expression_impl<Expressions>::type::value...>::value, assert_where_expressions_t>,
|
||||
static_check_t<logic::all_t<is_boolean_t<Expressions>::value...>::value, assert_where_boolean_t>,
|
||||
static_check_t<logic::all_t<(not detail::contains_aggregate_function_impl<Expressions>::type::value)...>::value,
|
||||
assert_where_no_aggregate_functions_t>>;
|
||||
};
|
||||
|
||||
template <typename... Expressions>
|
||||
using check_where_t = typename check_where<Expressions...>::type;
|
||||
|
||||
template <typename... Expressions>
|
||||
using check_where_static_t =
|
||||
@@ -331,15 +341,6 @@ namespace sqlpp
|
||||
return _where_impl<void>(Check{}, expressions...);
|
||||
}
|
||||
|
||||
auto dynamic_where() const -> _new_statement_t<check_where_dynamic_t<_database_t>, where_t<_database_t>>
|
||||
{
|
||||
using Check = check_where_dynamic_t<_database_t>;
|
||||
Check{}._();
|
||||
|
||||
return _where_impl<_database_t>(Check{});
|
||||
}
|
||||
|
||||
// MSVC does not comprehend this, and must therefore have a separate function with no arguments.
|
||||
template <typename... Expressions>
|
||||
auto dynamic_where(Expressions... expressions) const
|
||||
-> _new_statement_t<check_where_dynamic_t<_database_t, Expressions...>, where_t<_database_t, Expressions...>>
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char*[])
|
||||
{
|
||||
no_group_by();
|
||||
dynamic_group_by();
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char*[])
|
||||
{
|
||||
when();
|
||||
then();
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char*[])
|
||||
{
|
||||
allowed_comparands();
|
||||
disallowed_comparands();
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char*[])
|
||||
{
|
||||
allowed_comparands();
|
||||
disallowed_comparands();
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char*[])
|
||||
{
|
||||
static_set();
|
||||
dynamic_set();
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char*[])
|
||||
{
|
||||
static_where();
|
||||
dynamic_where();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "MockDb.h"
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
int BooleanExpression(int, char**)
|
||||
int BooleanExpression(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
#include <sqlpp11/custom_query.h>
|
||||
|
||||
int CustomQuery(int, char**)
|
||||
int CustomQuery(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
SQLPP_ALIAS_PROVIDER(now)
|
||||
|
||||
int DateTime(int, char**)
|
||||
int DateTime(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
SQLPP_ALIAS_PROVIDER(kaesekuchen)
|
||||
|
||||
int Function(int, char**)
|
||||
int Function(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
const auto f = test::TabFoo{};
|
||||
@@ -446,11 +446,11 @@ int Function(int, char**)
|
||||
|
||||
for (const auto& row : db(select(all_of(t)).from(t).where(true)))
|
||||
{
|
||||
static_assert(std::is_same<decltype(sqlpp::tvin(row.alpha)), sqlpp::tvin_arg_t<decltype(row.alpha)>>::value,
|
||||
static_assert(std::is_same<decltype(sqlpp::tvin(row.alpha)), sqlpp::tvin_arg_t<typename std::remove_const<decltype(row.alpha)>::type>>::value,
|
||||
"result fields are accepted and not wrapped");
|
||||
static_assert(std::is_same<decltype(sqlpp::tvin(row.beta)), sqlpp::tvin_arg_t<decltype(row.beta)>>::value,
|
||||
static_assert(std::is_same<decltype(sqlpp::tvin(row.beta)), sqlpp::tvin_arg_t<typename std::remove_const<decltype(row.beta)>::type>>::value,
|
||||
"result fields are accepted and not wrapped");
|
||||
static_assert(std::is_same<decltype(sqlpp::tvin(row.gamma)), sqlpp::tvin_arg_t<decltype(row.gamma)>>::value,
|
||||
static_assert(std::is_same<decltype(sqlpp::tvin(row.gamma)), sqlpp::tvin_arg_t<typename std::remove_const<decltype(row.gamma)>::type>>::value,
|
||||
"result fields are accepted and not wrapped");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <sqlpp11/functions.h>
|
||||
#include <iostream>
|
||||
|
||||
int Insert(int, char**)
|
||||
int Insert(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int Interpret(int, char**)
|
||||
int Interpret(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
int Minimalistic(int, char**)
|
||||
int Minimalistic(int, char*[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/functions.h>
|
||||
#include <sqlpp11/select.h>
|
||||
|
||||
int Prepared(int, char**)
|
||||
int Prepared(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
// test::TabFoo f;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "MockDb.h"
|
||||
#include "is_regular.h"
|
||||
|
||||
int Remove(int, char**)
|
||||
int Remove(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
static_assert(not sqlpp::enforce_null_result_treatment_t<MockDb>::value, "MockDb interprets NULL as trivial");
|
||||
static_assert(sqlpp::enforce_null_result_treatment_t<EnforceDb>::value, "MockDb does not interpret NULL as trivial");
|
||||
|
||||
int Result(int, char**)
|
||||
int Result(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
EnforceDb edb{};
|
||||
|
||||
@@ -42,7 +42,7 @@ int64_t getColumn(Db&& db, const Column& column)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Select(int, char**)
|
||||
int Select(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace alias
|
||||
SQLPP_ALIAS_PROVIDER(right)
|
||||
}
|
||||
|
||||
int SelectType(int, char**)
|
||||
int SelectType(int, char*[])
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
const auto f = test::TabFoo{};
|
||||
const auto t = test::TabBar{};
|
||||
auto f = test::TabFoo{};
|
||||
auto t = test::TabBar{};
|
||||
|
||||
// Test a table
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/alias_provider.h>
|
||||
#include <iostream>
|
||||
|
||||
int Union(int, char**)
|
||||
int Union(int, char*[])
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "MockDb.h"
|
||||
#include "is_regular.h"
|
||||
|
||||
int Update(int, char**)
|
||||
int Update(int, char*[])
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/alias_provider.h>
|
||||
#include <iostream>
|
||||
|
||||
int With(int, char**)
|
||||
int With(int, char*[])
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
Reference in New Issue
Block a user