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

fixes & changes to ppgen

This commit is contained in:
niXman 2015-05-19 13:42:22 +03:00
parent 0e86a5a666
commit 93830d600a
20 changed files with 66 additions and 31 deletions

View File

@ -48,9 +48,9 @@ SQLPP_DECLARE_TABLE(
SQLPP_DECLARE_TABLE( SQLPP_DECLARE_TABLE(
(tab_person) (tab_person)
, ,
(id , int , SQLPP_AUTO_INCREMENT) (id , int , SQLPP_PRIMARY_KEY)
(name , varchar(255), SQLPP_NOT_NULL ) (name , varchar(255), SQLPP_NOT_NULL )
(feature, int , SQLPP_NOT_NULL ) (feature, int , SQLPP_NOT_NULL )
) )
SQLPP_DECLARE_TABLE( SQLPP_DECLARE_TABLE(

View File

@ -30,6 +30,6 @@
#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_update ::sqlpp::tag::must_not_update
#endif // _sqlpp__ppgen__colops__auto_increment_h #endif // _sqlpp__ppgen__colops__auto_increment_h

View File

@ -30,21 +30,21 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob \
PROC_tinyblob PROC_tinyblob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyblob(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyblob(...) \
sqlpp::blob ::sqlpp::blob
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_blob \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_blob \
PROC_blob PROC_blob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_blob(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_blob(...) \
sqlpp::blob ::sqlpp::blob
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_mediumblob \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_mediumblob \
PROC_mediumblob PROC_mediumblob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_mediumblob(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_mediumblob(...) \
sqlpp::blob ::sqlpp::blob
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_longblob \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_longblob \
PROC_longblob PROC_longblob
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_longblob(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_longblob(...) \
sqlpp::blob ::sqlpp::blob
#endif // _sqlpp__ppgen__colops__blob_h #endif // _sqlpp__ppgen__colops__blob_h

View File

@ -30,6 +30,6 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool \
PROC_bool PROC_bool
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) \
sqlpp::boolean ::sqlpp::boolean
#endif // _sqlpp__ppgen__colops__bool_h #endif // _sqlpp__ppgen__colops__bool_h

View File

@ -27,7 +27,7 @@
#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(str) \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT \
PROC_SQLPP_COMMENT PROC_SQLPP_COMMENT
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \
[COMMENT is not implemented] [COMMENT is not implemented]

View File

@ -27,7 +27,7 @@
#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(value) \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT \
PROC_SQLPP_DEFAULT PROC_SQLPP_DEFAULT
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \
[DEFAULT is not implemented] [DEFAULT is not implemented]

View File

@ -30,11 +30,11 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float \
PROC_float PROC_float
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_float(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_float(...) \
sqlpp::floating_point ::sqlpp::floating_point
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_double \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_double \
PROC_double PROC_double
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_double(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_double(...) \
sqlpp::floating_point ::sqlpp::floating_point
#endif // _sqlpp__ppgen__colops__floating_point_h #endif // _sqlpp__ppgen__colops__floating_point_h

View File

@ -27,9 +27,9 @@
#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(name) \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX \
PROC_SQLPP_INDEX PROC_SQLPP_INDEX
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(name) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(indexname, ...) \
[INDEX is not implemented] [INDEX is not implemented]
#endif // _sqlpp__ppgen__colops__index_h #endif // _sqlpp__ppgen__colops__index_h

View File

@ -30,21 +30,21 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyint \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyint \
PROC_tinyint PROC_tinyint
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyint(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_tinyint(...) \
sqlpp::tinyint ::sqlpp::tinyint
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_smallint \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_smallint \
PROC_smallint PROC_smallint
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_smallint(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_smallint(...) \
sqlpp::smallint ::sqlpp::smallint
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_int \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_int \
PROC_int PROC_int
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_int(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_int(...) \
sqlpp::integer ::sqlpp::integer
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bigint \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bigint \
PROC_bigint PROC_bigint
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bigint(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bigint(...) \
sqlpp::bigint ::sqlpp::bigint
#endif // _sqlpp__ppgen__colops__integer_h #endif // _sqlpp__ppgen__colops__integer_h

View File

@ -27,7 +27,7 @@
#ifndef _sqlpp__ppgen__colops__key_h #ifndef _sqlpp__ppgen__colops__key_h
#define _sqlpp__ppgen__colops__key_h #define _sqlpp__ppgen__colops__key_h
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_KEY(name) \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_KEY \
PROC_SQLPP_KEY PROC_SQLPP_KEY
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_KEY(name) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_KEY(name) \
[KEY is not implemented] [KEY is not implemented]

View File

@ -30,6 +30,6 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL \
PROC_SQLPP_NOT_NULL PROC_SQLPP_NOT_NULL
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) \
sqlpp::tag::require_insert ::sqlpp::require_insert
#endif // _sqlpp__ppgen__colops__not_null_h #endif // _sqlpp__ppgen__colops__not_null_h

View File

@ -30,6 +30,6 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL \
PROC_SQLPP_NULL PROC_SQLPP_NULL
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) \
sqlpp::tag::can_be_null ::sqlpp::can_be_null
#endif // _sqlpp__ppgen__colops__null_h #endif // _sqlpp__ppgen__colops__null_h

View File

@ -30,6 +30,6 @@
#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(...) \
[PRIMARY_KEY is not implemented] ::sqlpp::must_not_insert, ::sqlpp::must_not_update
#endif // _sqlpp__ppgen__colops__primary_key_h #endif // _sqlpp__ppgen__colops__primary_key_h

View File

@ -30,6 +30,6 @@
#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text \
PROC_text PROC_text
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) \
sqlpp::text ::sqlpp::text
#endif // _sqlpp__ppgen__colops__text_h #endif // _sqlpp__ppgen__colops__text_h

View File

@ -0,0 +1,35 @@
/*
* Copyright (c) 2014-2015, niXman (i dot nixman dog gmail dot com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _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_GEN_TRAITS_PROC_SQLPP_UNIQUE_INDEX(indexname, ...) \
[UNIQUE INDEX is not implemented]
#endif // _sqlpp__ppgen__colops__unique_index_h

View File

@ -27,9 +27,9 @@
#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) \ #define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_varchar\
PROC_varchar PROC_varchar
#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(str) \ #define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(...) \
sqlpp::varchar ::sqlpp::varchar
#endif // _sqlpp__ppgen__colops__varchar_h #endif // _sqlpp__ppgen__colops__varchar_h

View File

@ -27,7 +27,7 @@
#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(str) \ #define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET \
PROC_SQLPP_CHARACTER_SET PROC_SQLPP_CHARACTER_SET
#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) \ #define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) \
[CHARACTER_SET is not implemented] [CHARACTER_SET is not implemented]

View File

@ -27,7 +27,7 @@
#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(str) \ #define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_COMMENT \
PROC_SQLPP_COMMENT PROC_SQLPP_COMMENT
#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ #define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \
[COMMENT is not implemented] [COMMENT is not implemented]

View File

@ -27,7 +27,7 @@
#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(value) \ #define SQLPP_DECLARE_TABLE_GET_TRAITS_LAZY_SQLPP_DEFAULT \
PROC_SQLPP_DEFAULT PROC_SQLPP_DEFAULT
#define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ #define SQLPP_DECLARE_TABLE_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \
[DEFAULT is not implemented] [DEFAULT is not implemented]

View File

@ -27,7 +27,7 @@
#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(str) \ #define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE \
PROC_SQLPP_ENGINE PROC_SQLPP_ENGINE
#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) \ #define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) \
[ENGINE is not implemented] [ENGINE is not implemented]