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

Merge branch 'release/0.57'

This commit is contained in:
rbock 2018-07-06 07:46:32 +02:00
commit 32abab9da4
10 changed files with 58 additions and 5 deletions

View File

@ -93,10 +93,6 @@ Branch / Compiler | clang-3.4, gcc-4.9, Xcode-7 | MSVC 2015/2017 | Test Cov
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)
MSVC 2017 is currently broken, see
- https://github.com/rbock/sqlpp11/issues/181
- https://developercommunity.visualstudio.com/content/problem/95983/c-vs152-153-regression-in-variadic-template-argume.html
Additional information available:
---------------------------------
Past talks about sqlpp11 and some coding concepts used within the library:

View File

@ -66,7 +66,12 @@ namespace sqlpp
}
transaction_t(const transaction_t&) = delete;
transaction_t(transaction_t&&) = default;
transaction_t(transaction_t&& other)
: _db(other._db), _report_unfinished_transaction(other._report_unfinished_transaction), _finished(other._finished)
{
other._finished = true;
}
transaction_t& operator=(const transaction_t&) = delete;
transaction_t& operator=(transaction_t&&) = delete;

View File

@ -52,6 +52,27 @@ namespace sqlpp
bool _is_null;
};
template <typename Context, typename ValueType>
struct serializer_t<Context, value_or_null_t<ValueType>>
{
using _serialize_check = consistent_t;
using Operand = value_or_null_t<ValueType>;
static Context& _(const Operand& t, Context& context)
{
if (t._is_null)
{
context << "NULL";
}
else
{
serialize(wrap_operand_t<typename ValueType::_cpp_value_type>{t._value}, context);
}
return context;
}
};
template <typename T>
auto value_or_null(T t) -> value_or_null_t<value_type_of<wrap_operand_t<T>>>
{

View File

@ -33,6 +33,7 @@ function(test_constraint name pattern)
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
endfunction()
# Compiling these is required to fail (testing some static_assert)
test_constraint(count_of_count "count\\(\\) cannot be used on an aggregate function")
test_constraint(max_of_max "max\\(\\) cannot be used on an aggregate function")
test_constraint(no_conversion_operator_if_null_not_trivial "cannot convert|no viable conversion")

View File

@ -23,6 +23,11 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* NOTE:
* This code must not compile (it is used to test a static_assert)
*/
#include "Sample.h"
#include "MockDb.h"
#include <sqlpp11/functions.h>

View File

@ -23,6 +23,11 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* NOTE:
* This code must not compile (it is used to test a static_assert)
*/
#include "Sample.h"
#include "MockDb.h"
#include <sqlpp11/functions.h>

View File

@ -23,6 +23,11 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* NOTE:
* This code must not compile (it is used to test a static_assert)
*/
#include "Sample.h"
#include "MockDb.h"
#include <sqlpp11/insert.h>

View File

@ -23,6 +23,11 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* NOTE:
* This code must not compile (it is used to test a static_assert)
*/
#include "Sample.h"
#include "MockDb.h"
#include <sqlpp11/update.h>

View File

@ -23,6 +23,11 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* NOTE:
* This code must not compile (it is used to test the absence of a conversion operator)
*/
#include "Sample.h"
#include "MockDb.h"
#include <sqlpp11/sqlpp11.h>

View File

@ -23,6 +23,11 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* NOTE:
* This code must not compile (it is used to test a static_assert)
*/
#include "Sample.h"
#include "MockDb.h"
#include <sqlpp11/insert.h>