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

Merge branch 'release/0.50'

This commit is contained in:
rbock 2017-07-16 07:52:02 +02:00
commit 307da227ac
6 changed files with 28 additions and 13 deletions

View File

@ -1,10 +1,12 @@
os: Visual Studio 2015
os:
- Visual Studio 2015
- Visual Studio 2017
platform:
- x64
configuration:
- Debug
#- Debug
- Release
matrix:

View File

@ -17,7 +17,7 @@ See [Changes](ChangeLog.md)
Status:
-------
Branch / Compiler | clang-3.4, gcc-4.9, Xcode-7 | MSVC 2015 | Test Coverage
Branch / Compiler | clang-3.4, gcc-4.9, Xcode-7 | MSVC 2015/2017 | Test Coverage
------------------| -------------------------------|-------------|---------------
master | [![Build Status](https://travis-ci.org/rbock/sqlpp11.svg?branch=master)](https://travis-ci.org/rbock/sqlpp11?branch=master) | [![Build status](https://ci.appveyor.com/api/projects/status/eid7mwqgavo0h61h/branch/master?svg=true)](https://ci.appveyor.com/project/rbock/sqlpp11/branch/master) | [![Coverage Status](https://coveralls.io/repos/rbock/sqlpp11/badge.svg?branch=master)](https://coveralls.io/r/rbock/sqlpp11?branch=master)
develop | [![Build Status](https://travis-ci.org/rbock/sqlpp11.svg?branch=develop)](https://travis-ci.org/rbock/sqlpp11?branch=develop) | [![Build status](https://ci.appveyor.com/api/projects/status/eid7mwqgavo0h61h/branch/develop?svg=true)](https://ci.appveyor.com/project/rbock/sqlpp11/branch/develop) | [![Coverage Status](https://coveralls.io/repos/rbock/sqlpp11/badge.svg?branch=develop)](https://coveralls.io/r/rbock/sqlpp11?branch=develop)

View File

@ -162,7 +162,7 @@ namespace sqlpp
using _serialize_check = serialize_check_of<Context>;
using T = for_update_data_t;
static Context& _(const T& t, Context& context)
static Context& _(const T&, Context& context)
{
context << " FOR UPDATE ";
return context;

View File

@ -181,6 +181,12 @@ namespace sqlpp
static_check_t<not std::is_same<Database, void>::value, assert_having_dynamic_statement_dynamic_t>,
check_having_t<Expression>>;
template <typename... Exprs>
constexpr auto are_all_parameters_expressions() -> bool
{
return logic::all_t<is_expression_t<Exprs>::value...>::value;
}
// NO HAVING YET
struct no_having_t
{
@ -237,7 +243,7 @@ namespace sqlpp
// 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...>
struct _check : std::integral_constant<bool, are_all_parameters_expressions<T...>()>
{
};

View File

@ -54,6 +54,12 @@ namespace sqlpp
namespace detail
{
template <typename... Policies>
constexpr auto is_any_policy_missing() -> bool
{
return logic::any_t<is_missing_t<Policies>::value...>::value;
}
template <typename Db = void, typename... Policies>
struct statement_policies_t
{
@ -122,11 +128,10 @@ namespace sqlpp
}
using _value_type =
typename std::conditional<logic::none_t<is_missing_t<Policies>::value...>::value,
value_type_of<_result_type_provider>,
no_value_t // if a required statement part is missing (e.g. columns in a select),
typename std::conditional<is_any_policy_missing<Policies...>(),
no_value_t, // if a required statement part is missing (e.g. columns in a select),
// then the statement cannot be used as a value
>::type;
value_type_of<_result_type_provider>>::type;
using _traits =
make_traits<_value_type, tag_if<tag::is_expression, not std::is_same<_value_type, no_value_t>::value>>;

View File

@ -31,11 +31,13 @@
namespace
{
/*
auto getTrue() -> std::string
{
MockDb::_serializer_context_t printer = {};
return serialize(sqlpp::value(true), printer).str();
}
*/
auto getFalse() -> std::string
{
@ -47,14 +49,14 @@ namespace
int ForUpdate(int, char* [])
{
const auto foo = test::TabFoo{};
const auto bar = test::TabBar{};
// const auto bar = test::TabBar{};
// Unconditionally
compare(__LINE__, select(foo.omega).from(foo).unconditionally().for_update(), "SELECT tab_foo.omega FROM tab_foo FOR UPDATE ");
compare(__LINE__, select(foo.omega).from(foo).unconditionally().for_update(),
"SELECT tab_foo.omega FROM tab_foo FOR UPDATE ");
// Never
compare(__LINE__, where(sqlpp::value(false)), " WHERE " + getFalse());
return 0;
}