0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Merge branch 'release/0.46'

This commit is contained in:
rbock 2017-03-12 12:17:27 +01:00
commit 9100e51637
29 changed files with 349 additions and 173 deletions

View File

@ -40,23 +40,28 @@ namespace sqlpp
struct result_field_t<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>> struct result_field_t<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>>
: public result_field_base<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>> : public result_field_base<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>>
{ {
const char* text{nullptr}; // Non-owning
size_t len{};
template <typename Target> template <typename Target>
void _bind(Target& target, size_t index) void _bind(Target& target, size_t index)
{ {
const char* text{nullptr};
size_t len{};
target._bind_text_result(index, &text, &len); target._bind_text_result(index, &text, &len);
this->_value = {text, len}; if (text)
this->_value.assign(text, len);
else
this->_value.assign("", 0);
this->_is_null = (text == nullptr); this->_is_null = (text == nullptr);
} }
template <typename Target> template <typename Target>
void _post_bind(Target& target, size_t index) void _post_bind(Target& target, size_t index)
{ {
const char* text{nullptr};
size_t len{};
target._post_bind_text_result(index, &text, &len); target._post_bind_text_result(index, &text, &len);
this->_value = {text, len}; if (text)
this->_value.assign(text, len);
else
this->_value.assign("", 0);
this->_is_null = (text == nullptr); this->_is_null = (text == nullptr);
} }
}; };

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,6 +24,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen_h #ifndef _sqlpp__ppgen_h
#define _sqlpp__ppgen_h #define _sqlpp__ppgen_h
@ -78,111 +80,141 @@
/***************************************************************************/ /***************************************************************************/
// tools // tools
#define SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) BOOST_PP_TUPLE_ELEM(0, BOOST_PP_EXPAND table) #define SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \
BOOST_PP_TUPLE_ELEM(0, BOOST_PP_EXPAND table)
#define SQLPP_DECLARE_TABLE_GET_TABLE_PROPS(table) SQLPP_BOOST_PP_TUPLE_POP_FRONT(BOOST_PP_EXPAND table) #define SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(col) \
BOOST_PP_TUPLE_ELEM(0, col)
#define SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(col) BOOST_PP_TUPLE_ELEM(0, col) #define SQLPP_DECLARE_TABLE_ENUM_COLUMNS(unused, table, elem) \
,table::SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem)
#define SQLPP_DECLARE_TABLE_ENUM_COLUMNS(unused, table, elem) , table::SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem)
/***************************************************************************/ /***************************************************************************/
// columns // columns
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_AUX(unused, size, idx, elem) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_AUX(unused, size, idx, elem) \
BOOST_PP_CAT(SQLPP_DECLARE_COLUMN_GEN_TRAITS_, BOOST_PP_CAT(SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_, elem))(elem) \ BOOST_PP_CAT( \
BOOST_PP_COMMA_IF(BOOST_PP_LESS(BOOST_PP_ADD(idx, 1), size)) SQLPP_DECLARE_COLUMN_GEN_TRAITS_ \
,BOOST_PP_CAT(SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_, elem) \
)(elem) \
BOOST_PP_COMMA_IF(BOOST_PP_LESS(BOOST_PP_ADD(idx, 1), size))
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS(props) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS(props) \
BOOST_PP_SEQ_FOR_EACH_I(SQLPP_DECLARE_COLUMN_GEN_TRAITS_AUX, BOOST_PP_TUPLE_SIZE(props), BOOST_PP_TUPLE_TO_SEQ(props)) BOOST_PP_SEQ_FOR_EACH_I( \
SQLPP_DECLARE_COLUMN_GEN_TRAITS_AUX \
,BOOST_PP_TUPLE_SIZE(props) \
,BOOST_PP_TUPLE_TO_SEQ(props) \
)
#define SQLPP_DECLARE_COLUMN(unused, data, elem) \ #define SQLPP_DECLARE_COLUMN(unused, data, elem) \
struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) \ struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) \
{ \ { \
struct _alias_t \ struct _alias_t \
{ \ { \
static constexpr const char _literal[] = BOOST_PP_STRINGIZE(SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem)); \ static constexpr const char _literal[] = \
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>; \ BOOST_PP_STRINGIZE(SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem)); \
\ using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>; \
template <typename T> \ \
struct _member_t \ template <typename T> \
{ \ struct _member_t \
T SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \ { \
\ T SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \
T& operator()() \ \
{ \ T& operator()() \
return SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \ { \
} \ return SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \
const T& operator()() const \ } \
{ \ const T& operator()() const \
return SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \ { \
} \ return SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \
}; /* struct _member_t */ \ } \
}; /* struct _alias_t */ \ }; /* struct _member_t */ \
\ }; /* struct _alias_t */ \
using _traits = sqlpp::make_traits<SQLPP_DECLARE_COLUMN_GEN_TRAITS(SQLPP_BOOST_PP_TUPLE_POP_FRONT(elem))>; \ \
\ using _traits = sqlpp::make_traits< \
SQLPP_DECLARE_COLUMN_GEN_TRAITS(SQLPP_BOOST_PP_TUPLE_POP_FRONT(elem)) \
>; \
}; /* struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) */ }; /* struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) */
/***************************************************************************/ /***************************************************************************/
// table props // table props
#define SQLPP_DECLARE_TABLE_GEN_PROPS_AUX(unused1, unused2, elem) \ #define SQLPP_DECLARE_TABLE_GEN_PROPS_AUX(unused1, unused2, elem) \
BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GEN_, BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_PROC_LAZY_, elem))(elem) BOOST_PP_CAT( \
SQLPP_DECLARE_TABLE_GEN_ \
,BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_PROC_LAZY_, elem) \
)(elem)
#define SQLPP_DECLARE_TABLE_GEN_PROPS(table) \ #define SQLPP_DECLARE_TABLE_GEN_PROPS(table) \
BOOST_PP_SEQ_FOR_EACH(SQLPP_DECLARE_TABLE_GEN_PROPS_AUX, ~, \ BOOST_PP_SEQ_FOR_EACH( \
BOOST_PP_TUPLE_TO_SEQ(SQLPP_BOOST_PP_TUPLE_POP_FRONT(table))) SQLPP_DECLARE_TABLE_GEN_PROPS_AUX \
,~ \
,BOOST_PP_TUPLE_TO_SEQ(SQLPP_BOOST_PP_TUPLE_POP_FRONT(table)) \
)
/***************************************************************************/ /***************************************************************************/
// main // main
#define SQLPP_DECLARE_TABLE_IMPL(table, cols) \ #define SQLPP_DECLARE_TABLE_IMPL(table, cols) \
namespace SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \ namespace SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \
{ \ { \
namespace BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _) \ namespace BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _) \
{ \ { \
BOOST_PP_SEQ_FOR_EACH(SQLPP_DECLARE_COLUMN, ~, cols) \ BOOST_PP_SEQ_FOR_EACH( \
} /* namespace BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _) */ \ SQLPP_DECLARE_COLUMN \
\ ,~ \
struct SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \ ,cols \
: sqlpp::table_t<SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) BOOST_PP_SEQ_FOR_EACH( \ ) \
SQLPP_DECLARE_TABLE_ENUM_COLUMNS, BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _), cols)> \ } /* namespace BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _) */ \
{ \ \
BOOST_PP_IF(BOOST_PP_LESS(BOOST_PP_TUPLE_SIZE(table), 2), \ struct SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \
BOOST_PP_TUPLE_EAT(), \ : sqlpp::table_t< \
SQLPP_DECLARE_TABLE_GEN_PROPS)(BOOST_PP_EXPAND table) \ SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \
\ BOOST_PP_SEQ_FOR_EACH( \
struct _alias_t \ SQLPP_DECLARE_TABLE_ENUM_COLUMNS \
{ \ ,BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _) \
static constexpr const char _literal[] = BOOST_PP_STRINGIZE(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table)); \ ,cols \
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>; \ ) \
\ > \
template <typename T> \ { \
struct _member_t \ BOOST_PP_IF( \
{ \ BOOST_PP_LESS(BOOST_PP_TUPLE_SIZE(table), 2) \
T SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table); \ ,BOOST_PP_TUPLE_EAT() \
\ ,SQLPP_DECLARE_TABLE_GEN_PROPS \
T& operator()() \ )(BOOST_PP_EXPAND table) \
{ \ \
return SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table); \ struct _alias_t \
} \ { \
const T& operator()() const \ static constexpr const char _literal[] = \
{ \ BOOST_PP_STRINGIZE(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table)); \
return SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table); \ using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>; \
} \ \
\ template <typename T> \
}; /* struct _member_t */ \ struct _member_t \
\ { \
}; /* struct _alias_t */ \ T SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table); \
\ \
}; /* struct SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) */ \ T& operator()() \
{ \
return SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table); \
} \
const T& operator()() const \
{ \
return SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table); \
} \
\
}; /* struct _member_t */ \
}; /* struct _alias_t */ \
}; /* struct SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) */ \
} }
/***************************************************************************/ /***************************************************************************/
#define SQLPP_DECLARE_TABLE(table, cols) \ #define SQLPP_DECLARE_TABLE(table, cols) \
SQLPP_DECLARE_TABLE_IMPL(BOOST_PP_CAT(SQLPP_WRAP_SEQUENCE_X table, 0), BOOST_PP_CAT(SQLPP_WRAP_SEQUENCE_X cols, 0)) SQLPP_DECLARE_TABLE_IMPL( \
BOOST_PP_CAT(SQLPP_WRAP_SEQUENCE_X table, 0) \
,BOOST_PP_CAT(SQLPP_WRAP_SEQUENCE_X cols, 0) \
)
/***************************************************************************/ /***************************************************************************/

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,12 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__auto_increment_h #ifndef _sqlpp__ppgen__colops__auto_increment_h
#define _sqlpp__ppgen__colops__auto_increment_h #define _sqlpp__ppgen__colops__auto_increment_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_AUTO_INCREMENT \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_AUTO_INCREMENT \
PROC_SQLPP_AUTO_INCREMENT PROC_SQLPP_AUTO_INCREMENT
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_AUTO_INCREMENT(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_AUTO_INCREMENT(...) \
::sqlpp::tag::must_not_insert, ::sqlpp::tag::must_not_update ::sqlpp::tag::must_not_insert, ::sqlpp::tag::must_not_update
#endif // _sqlpp__ppgen__colops__auto_increment_h #endif // _sqlpp__ppgen__colops__auto_increment_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,19 +24,29 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__blob_h #ifndef _sqlpp__ppgen__colops__blob_h
#define _sqlpp__ppgen__colops__blob_h #define _sqlpp__ppgen__colops__blob_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob PROC_tinyblob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyblob(...) ::sqlpp::blob PROC_tinyblob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyblob(...) \
::sqlpp::blob
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_blob PROC_blob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_blob \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_blob(...) ::sqlpp::blob PROC_blob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_blob(...) \
::sqlpp::blob
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_mediumblob PROC_mediumblob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_mediumblob \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_mediumblob(...) ::sqlpp::blob PROC_mediumblob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_mediumblob(...) \
::sqlpp::blob
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_longblob PROC_longblob #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_longblob \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_longblob(...) ::sqlpp::blob PROC_longblob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_longblob(...) \
::sqlpp::blob
#endif // _sqlpp__ppgen__colops__blob_h #endif // _sqlpp__ppgen__colops__blob_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__bool_h #ifndef _sqlpp__ppgen__colops__bool_h
#define _sqlpp__ppgen__colops__bool_h #define _sqlpp__ppgen__colops__bool_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool PROC_bool #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) ::sqlpp::boolean PROC_bool
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) \
::sqlpp::boolean
#endif // _sqlpp__ppgen__colops__bool_h #endif // _sqlpp__ppgen__colops__bool_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__comment_h #ifndef _sqlpp__ppgen__colops__comment_h
#define _sqlpp__ppgen__colops__comment_h #define _sqlpp__ppgen__colops__comment_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT PROC_SQLPP_COMMENT #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) [COMMENT is not implemented] PROC_SQLPP_COMMENT
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \
[COMMENT is not implemented]
#endif // _sqlpp__ppgen__colops__comment_h #endif // _sqlpp__ppgen__colops__comment_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,12 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__datetime_h #ifndef _sqlpp__ppgen__colops__datetime_h
#define _sqlpp__ppgen__colops__datetime_h #define _sqlpp__ppgen__colops__datetime_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_datetime \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_datetime \
PROC_datetime PROC_datetime
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_datetime(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_datetime(...) \
[datetime is not implemented] [datetime is not implemented]
#endif // _sqlpp__ppgen__colops__datetime_h #endif // _sqlpp__ppgen__colops__datetime_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__default_h #ifndef _sqlpp__ppgen__colops__default_h
#define _sqlpp__ppgen__colops__default_h #define _sqlpp__ppgen__colops__default_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT PROC_SQLPP_DEFAULT #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) [DEFAULT is not implemented] PROC_SQLPP_DEFAULT
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \
[DEFAULT is not implemented]
#endif // _sqlpp__ppgen__colops__default_h #endif // _sqlpp__ppgen__colops__default_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,13 +24,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__floating_point_h #ifndef _sqlpp__ppgen__colops__floating_point_h
#define _sqlpp__ppgen__colops__floating_point_h #define _sqlpp__ppgen__colops__floating_point_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float PROC_float #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_float(...) ::sqlpp::floating_point PROC_float
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_float(...) \
::sqlpp::floating_point
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_double PROC_double #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_double \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_double(...) ::sqlpp::floating_point PROC_double
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_double(...) \
::sqlpp::floating_point
#endif // _sqlpp__ppgen__colops__floating_point_h #endif // _sqlpp__ppgen__colops__floating_point_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__foreign_key_h #ifndef _sqlpp__ppgen__colops__foreign_key_h
#define _sqlpp__ppgen__colops__foreign_key_h #define _sqlpp__ppgen__colops__foreign_key_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_FOREIGN_KEY PROC_SQLPP_FOREIGN_KEY #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_FOREIGN_KEY \
PROC_SQLPP_FOREIGN_KEY
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_FOREIGN_KEY(keyname, tblname, colname) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_FOREIGN_KEY(keyname, tblname, colname) \
[FOREIGN KEY is not implemented] [FOREIGN KEY is not implemented]

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__index_h #ifndef _sqlpp__ppgen__colops__index_h
#define _sqlpp__ppgen__colops__index_h #define _sqlpp__ppgen__colops__index_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX PROC_SQLPP_INDEX #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(indexname, tblname, /* cols */...) [INDEX is not implemented] PROC_SQLPP_INDEX
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(indexname, tblname, /* cols */...) \
[INDEX is not implemented]
#endif // _sqlpp__ppgen__colops__index_h #endif // _sqlpp__ppgen__colops__index_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,19 +24,29 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__integer_h #ifndef _sqlpp__ppgen__colops__integer_h
#define _sqlpp__ppgen__colops__integer_h #define _sqlpp__ppgen__colops__integer_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyint PROC_tinyint #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyint \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyint(...) ::sqlpp::tinyint PROC_tinyint
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyint(...) \
::sqlpp::tinyint
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_smallint PROC_smallint #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_smallint \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_smallint(...) ::sqlpp::smallint PROC_smallint
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_smallint(...) \
::sqlpp::smallint
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_int PROC_int #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_int \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_int(...) ::sqlpp::integer PROC_int
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_int(...) \
::sqlpp::integer
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bigint PROC_bigint #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bigint \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bigint(...) ::sqlpp::bigint PROC_bigint
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bigint(...) \
::sqlpp::bigint
#endif // _sqlpp__ppgen__colops__integer_h #endif // _sqlpp__ppgen__colops__integer_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__not_null_h #ifndef _sqlpp__ppgen__colops__not_null_h
#define _sqlpp__ppgen__colops__not_null_h #define _sqlpp__ppgen__colops__not_null_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL PROC_SQLPP_NOT_NULL #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) ::sqlpp::tag::require_insert PROC_SQLPP_NOT_NULL
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) \
::sqlpp::tag::require_insert
#endif // _sqlpp__ppgen__colops__not_null_h #endif // _sqlpp__ppgen__colops__not_null_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__null_h #ifndef _sqlpp__ppgen__colops__null_h
#define _sqlpp__ppgen__colops__null_h #define _sqlpp__ppgen__colops__null_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL PROC_SQLPP_NULL #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) ::sqlpp::tag::can_be_null PROC_SQLPP_NULL
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) \
::sqlpp::tag::can_be_null
#endif // _sqlpp__ppgen__colops__null_h #endif // _sqlpp__ppgen__colops__null_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,11 +24,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__primary_key_h #ifndef _sqlpp__ppgen__colops__primary_key_h
#define _sqlpp__ppgen__colops__primary_key_h #define _sqlpp__ppgen__colops__primary_key_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_PRIMARY_KEY \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_PRIMARY_KEY \
PROC_SQLPP_PRIMARY_KEY PROC_SQLPP_PRIMARY_KEY
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_PRIMARY_KEY(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_PRIMARY_KEY(...) \
::sqlpp::tag::must_not_update ::sqlpp::tag::must_not_update

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__text_h #ifndef _sqlpp__ppgen__colops__text_h
#define _sqlpp__ppgen__colops__text_h #define _sqlpp__ppgen__colops__text_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text PROC_text #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) ::sqlpp::text PROC_text
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) \
::sqlpp::text
#endif // _sqlpp__ppgen__colops__text_h #endif // _sqlpp__ppgen__colops__text_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,12 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__timestamp_h #ifndef _sqlpp__ppgen__colops__timestamp_h
#define _sqlpp__ppgen__colops__timestamp_h #define _sqlpp__ppgen__colops__timestamp_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_timestamp \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_timestamp \
PROC_timestamp PROC_timestamp
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_timestamp(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_timestamp(...) \
[timestamp is not implemented] [timestamp is not implemented]
#endif // _sqlpp__ppgen__colops__timestamp_h #endif // _sqlpp__ppgen__colops__timestamp_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__unique_index_h #ifndef _sqlpp__ppgen__colops__unique_index_h
#define _sqlpp__ppgen__colops__unique_index_h #define _sqlpp__ppgen__colops__unique_index_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_UNIQUE_INDEX PROC_SQLPP_UNIQUE_INDEX #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_UNIQUE_INDEX \
PROC_SQLPP_UNIQUE_INDEX
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_UNIQUE_INDEX(indexname, tblname, /* cols */...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_UNIQUE_INDEX(indexname, tblname, /* cols */...) \
[UNIQUE INDEX is not implemented] [UNIQUE INDEX is not implemented]

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__colops__varchar_h #ifndef _sqlpp__ppgen__colops__varchar_h
#define _sqlpp__ppgen__colops__varchar_h #define _sqlpp__ppgen__colops__varchar_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_varchar(str) PROC_varchar #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_varchar(str) \
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(str) ::sqlpp::varchar PROC_varchar
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(str) \
::sqlpp::varchar
#endif // _sqlpp__ppgen__colops__varchar_h #endif // _sqlpp__ppgen__colops__varchar_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__tblops__character_set_h #ifndef _sqlpp__ppgen__tblops__character_set_h
#define _sqlpp__ppgen__tblops__character_set_h #define _sqlpp__ppgen__tblops__character_set_h
#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET PROC_SQLPP_CHARACTER_SET #define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET \
#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) [CHARACTER_SET is not implemented] PROC_SQLPP_CHARACTER_SET
#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) \
[CHARACTER_SET is not implemented]
#endif // _sqlpp__ppgen__tblops__character_set_h #endif // _sqlpp__ppgen__tblops__character_set_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__tblops__comment_h #ifndef _sqlpp__ppgen__tblops__comment_h
#define _sqlpp__ppgen__tblops__comment_h #define _sqlpp__ppgen__tblops__comment_h
#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_COMMENT PROC_SQLPP_COMMENT #define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_COMMENT \
#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_COMMENT(str) [COMMENT is not implemented] PROC_SQLPP_COMMENT
#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \
[COMMENT is not implemented]
#endif // _sqlpp__ppgen__tblops__comment_h #endif // _sqlpp__ppgen__tblops__comment_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__tblops__default_h #ifndef _sqlpp__ppgen__tblops__default_h
#define _sqlpp__ppgen__tblops__default_h #define _sqlpp__ppgen__tblops__default_h
#define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_DEFAULT PROC_SQLPP_DEFAULT #define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_DEFAULT \
#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) [DEFAULT is not implemented] PROC_SQLPP_DEFAULT
#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \
[DEFAULT is not implemented]
#endif // _sqlpp__ppgen__tblops__default_h #endif // _sqlpp__ppgen__tblops__default_h

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,10 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__tblops__engine_h #ifndef _sqlpp__ppgen__tblops__engine_h
#define _sqlpp__ppgen__tblops__engine_h #define _sqlpp__ppgen__tblops__engine_h
#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE PROC_SQLPP_ENGINE #define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE \
#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) [ENGINE is not implemented] PROC_SQLPP_ENGINE
#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) \
[ENGINE is not implemented]
#endif // _sqlpp__ppgen__tblops__engine_h #endif // _sqlpp__ppgen__tblops__engine_h

View File

@ -9,6 +9,8 @@
/* See http://www.boost.org for most recent version. */ /* See http://www.boost.org for most recent version. */
// clang-format off
# ifndef SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP # ifndef SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP
# define SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP # define SQLPP_BOOST_PREPROCESSOR_TUPLE_POP_FRONT_HPP

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com) * Copyright (c) 2014-2017, niXman (i dot nixman dog gmail dot com)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
@ -24,13 +24,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// clang-format off
#ifndef _sqlpp__ppgen__tools__wrap_seq_h #ifndef _sqlpp__ppgen__tools__wrap_seq_h
#define _sqlpp__ppgen__tools__wrap_seq_h #define _sqlpp__ppgen__tools__wrap_seq_h
#define SQLPP_WRAP_SEQUENCE_X(...) \ #define SQLPP_WRAP_SEQUENCE_X(...) \
((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_Y ((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_Y
#define SQLPP_WRAP_SEQUENCE_Y(...) \ #define SQLPP_WRAP_SEQUENCE_Y(...) \
((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_X ((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_X
#define SQLPP_WRAP_SEQUENCE_X0 #define SQLPP_WRAP_SEQUENCE_X0
#define SQLPP_WRAP_SEQUENCE_Y0 #define SQLPP_WRAP_SEQUENCE_Y0

View File

@ -27,9 +27,17 @@
#ifndef SQLPP_RESULT_H #ifndef SQLPP_RESULT_H
#define SQLPP_RESULT_H #define SQLPP_RESULT_H
// FIXME: include for move? #include <iterator>
#include <utility>
namespace sqlpp namespace sqlpp
{ {
template <typename>
struct iterator_category
{
using type = std::input_iterator_tag;
};
template <typename DbResult, typename ResultRow> template <typename DbResult, typename ResultRow>
class result_t class result_t
{ {
@ -60,16 +68,22 @@ namespace sqlpp
class iterator class iterator
{ {
public: public:
using iterator_category = typename iterator_category<DbResult>::type;
using value_type = result_row_t;
using pointer = const result_row_t*;
using reference = const result_row_t&;
using difference_type = std::ptrdiff_t;
iterator(db_result_t& result, result_row_t& result_row) : _result(result), _result_row(result_row) iterator(db_result_t& result, result_row_t& result_row) : _result(result), _result_row(result_row)
{ {
} }
const result_row_t& operator*() const reference operator*() const
{ {
return _result_row; return _result_row;
} }
const result_row_t* operator->() const pointer operator->() const
{ {
return &_result_row; return &_result_row;
} }
@ -84,9 +98,17 @@ namespace sqlpp
return not(operator==(rhs)); return not(operator==(rhs));
} }
void operator++() iterator& operator++()
{ {
_result.next(_result_row); _result.next(_result_row);
return *this;
}
iterator operator++(int)
{
auto previous_it = *this;
_result.next(_result_row);
return previous_it;
} }
db_result_t& _result; db_result_t& _result;

View File

@ -169,7 +169,12 @@ ddlName = Or([ddlTerm, ddlString])
ddlArguments = "(" + delimitedList(Or([ddlString, ddlTerm, ddlNum])) + ")" ddlArguments = "(" + delimitedList(Or([ddlString, ddlTerm, ddlNum])) + ")"
ddlNotNull = Group(ddlWord("NOT") + ddlWord("NULL")).setResultsName("notNull") ddlNotNull = Group(ddlWord("NOT") + ddlWord("NULL")).setResultsName("notNull")
ddlDefaultValue = ddlWord("DEFAULT").setResultsName("hasDefaultValue") ddlDefaultValue = ddlWord("DEFAULT").setResultsName("hasDefaultValue")
ddlAutoValue = ddlWord("AUTO_INCREMENT").setResultsName("hasAutoValue") ddlAutoValue = Or([
ddlWord("AUTO_INCREMENT"),
ddlWord("SMALLSERIAL"),
ddlWord("SERIAL"),
ddlWord("BIGSERIAL"),
]).setResultsName("hasAutoValue")
ddlColumnComment = Group(ddlWord("COMMENT") + ddlString).setResultsName("comment") ddlColumnComment = Group(ddlWord("COMMENT") + ddlString).setResultsName("comment")
ddlConstraint = Or([ ddlConstraint = Or([
ddlWord("CONSTRAINT"), ddlWord("CONSTRAINT"),
@ -180,7 +185,8 @@ ddlConstraint = Or([
ddlWord("UNIQUE"), ddlWord("UNIQUE"),
]) ])
ddlColumn = Group(Optional(ddlConstraint).setResultsName("isConstraint") + OneOrMore(MatchFirst([ddlNotNull, ddlAutoValue, ddlDefaultValue, ddlFunctionWord("NOW"), ddlTerm, ddlNum, ddlColumnComment, ddlString, ddlArguments]))) ddlColumn = Group(Optional(ddlConstraint).setResultsName("isConstraint") + OneOrMore(MatchFirst([ddlNotNull, ddlAutoValue, ddlDefaultValue, ddlFunctionWord("NOW"), ddlTerm, ddlNum, ddlColumnComment, ddlString, ddlArguments])))
createTable = Group(ddlWord("CREATE") + ddlWord("TABLE") + ddlName.setResultsName("tableName") + "(" + Group(delimitedList(ddlColumn)).setResultsName("columns") + ")").setResultsName("create") ddlIfNotExists = Optional(Group(ddlWord("IF") + ddlWord("NOT") + ddlWord("EXISTS")).setResultsName("ifNotExists"))
createTable = Group(ddlWord("CREATE") + ddlWord("TABLE") + ddlIfNotExists + ddlName.setResultsName("tableName") + "(" + Group(delimitedList(ddlColumn)).setResultsName("columns") + ")").setResultsName("create")
#ddlString.setDebug(True) #uncomment to debug pyparsing #ddlString.setDebug(True) #uncomment to debug pyparsing
ddl = ZeroOrMore(Suppress(SkipTo(createTable, False)) + createTable) ddl = ZeroOrMore(Suppress(SkipTo(createTable, False)) + createTable)
@ -192,9 +198,12 @@ ddl.ignore(ddlComment)
types = { types = {
'tinyint': 'tinyint', 'tinyint': 'tinyint',
'smallint': 'smallint', 'smallint': 'smallint',
'smallserial': 'smallint', # PostgreSQL
'integer': 'integer', 'integer': 'integer',
'int': 'integer', 'int': 'integer',
'serial': 'integer', # PostgreSQL
'bigint': 'bigint', 'bigint': 'bigint',
'bigserial': 'bigint', # PostgreSQL
'char': 'char_', 'char': 'char_',
'varchar': 'varchar', 'varchar': 'varchar',
'text': 'text', 'text': 'text',
@ -214,7 +223,7 @@ types = {
} }
ddlColumn = Group(Optional(ddlConstraint).setResultsName("isConstraint") + OneOrMore(MatchFirst([ddlNotNull, ddlAutoValue, ddlDefaultValue, ddlFunctionWord("NOW"), ddlTerm, ddlNum, ddlColumnComment, ddlString, ddlArguments]))) ddlColumn = Group(Optional(ddlConstraint).setResultsName("isConstraint") + OneOrMore(MatchFirst([ddlNotNull, ddlAutoValue, ddlDefaultValue, ddlFunctionWord("NOW"), ddlTerm, ddlNum, ddlColumnComment, ddlString, ddlArguments])))
createTable = Group(ddlWord("CREATE") + ddlWord("TABLE") + ddlName.setResultsName("tableName") + "(" + Group(delimitedList(ddlColumn)).setResultsName("columns") + ")").setResultsName("create") createTable = Group(ddlWord("CREATE") + ddlWord("TABLE") + ddlIfNotExists + ddlName.setResultsName("tableName") + "(" + Group(delimitedList(ddlColumn)).setResultsName("columns") + ")").setResultsName("create")
ddlComment = oneOf(["--", "#"]) + restOfLine ddlComment = oneOf(["--", "#"]) + restOfLine
if failOnParse: if failOnParse:

View File

@ -26,6 +26,7 @@
#include "MockDb.h" #include "MockDb.h"
#include "Sample.h" #include "Sample.h"
#include "is_regular.h" #include "is_regular.h"
#include <algorithm>
#include <iostream> #include <iostream>
#include <sqlpp11/alias_provider.h> #include <sqlpp11/alias_provider.h>
#include <sqlpp11/connection.h> #include <sqlpp11/connection.h>
@ -52,6 +53,14 @@ struct to_cerr
} }
}; };
template <typename Row>
void print_row(Row const& row)
{
int64_t a = row.alpha;
const std::string b = row.beta;
std::cout << a << ", " << b << std::endl;
}
int Select(int, char* []) int Select(int, char* [])
{ {
MockDb db = {}; MockDb db = {};
@ -69,6 +78,13 @@ int Select(int, char* [])
std::cout << row.a << std::endl; std::cout << row.a << std::endl;
} }
{
// using stl algorithms
auto rows = db(select(all_of(t)).from(t).unconditionally());
// nicer in C++14
std::for_each(rows.begin(), rows.end(), &print_row<decltype(*rows.begin())>);
}
for (const auto& row : db(select(all_of(t)).from(t).unconditionally())) for (const auto& row : db(select(all_of(t)).from(t).unconditionally()))
{ {
int64_t a = row.alpha; int64_t a = row.alpha;

View File

@ -24,7 +24,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
CREATE TABLE tab_foo CREATE TABLE IF NOT EXISTS tab_foo
( (
delta varchar(255), delta varchar(255),
epsilon bigint, epsilon bigint,