Add support for std::array blobs

This commit is contained in:
Philippe Daouadi
2018-03-09 18:16:29 +01:00
committed by rbock
parent 7b16f03aa0
commit 1b12fddb7a
3 changed files with 16 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#include <sqlpp11/sqlpp11.h>
#include <iostream>
#include <array>
namespace
{
@@ -60,6 +61,10 @@ int Blob(int, char* [])
compare(__LINE__, select(foo.book).from(foo).where(foo.book == toByteVector("john doe")),
"SELECT tab_foo.book FROM tab_foo WHERE (tab_foo.book=x'6A6F686E20646F65')");
std::array<uint8_t, 8> arr{{'j', 'o', 'h', 'n', ' ', 'd', 'o', 'e'}};
compare(__LINE__, select(foo.book).from(foo).where(foo.book == arr),
"SELECT tab_foo.book FROM tab_foo WHERE (tab_foo.book=x'6A6F686E20646F65')");
// Never
compare(__LINE__, where(sqlpp::value(false)), " WHERE " + getFalse());