From 256060c2d700892c640e0727d8f58dd34a72b222 Mon Sep 17 00:00:00 2001 From: niXman Date: Wed, 28 Jan 2015 22:54:57 +0200 Subject: [PATCH] The first working implementation --- examples/CMakeLists.txt | 1 + examples/ppgen.cpp | 93 +++++++++++ include/sqlpp11/ppgen.h | 206 +++++++++++++++++++++++++ include/sqlpp11/ppgen/auto_increment.h | 35 +++++ include/sqlpp11/ppgen/blob.h | 50 ++++++ include/sqlpp11/ppgen/bool.h | 35 +++++ include/sqlpp11/ppgen/character_set.h | 35 +++++ include/sqlpp11/ppgen/comment.h | 35 +++++ include/sqlpp11/ppgen/datetime.h | 35 +++++ include/sqlpp11/ppgen/default.h | 35 +++++ include/sqlpp11/ppgen/engine.h | 35 +++++ include/sqlpp11/ppgen/floating_point.h | 40 +++++ include/sqlpp11/ppgen/index.h | 35 +++++ include/sqlpp11/ppgen/integer.h | 50 ++++++ include/sqlpp11/ppgen/key.h | 35 +++++ include/sqlpp11/ppgen/not_null.h | 35 +++++ include/sqlpp11/ppgen/null.h | 35 +++++ include/sqlpp11/ppgen/primary_key.h | 35 +++++ include/sqlpp11/ppgen/text.h | 35 +++++ include/sqlpp11/ppgen/timestamp.h | 35 +++++ include/sqlpp11/ppgen/unique.h | 35 +++++ include/sqlpp11/ppgen/varchar.h | 35 +++++ include/sqlpp11/ppgen/wrap_seq.h | 38 +++++ 23 files changed, 1038 insertions(+) create mode 100644 examples/ppgen.cpp create mode 100644 include/sqlpp11/ppgen.h create mode 100644 include/sqlpp11/ppgen/auto_increment.h create mode 100644 include/sqlpp11/ppgen/blob.h create mode 100644 include/sqlpp11/ppgen/bool.h create mode 100644 include/sqlpp11/ppgen/character_set.h create mode 100644 include/sqlpp11/ppgen/comment.h create mode 100644 include/sqlpp11/ppgen/datetime.h create mode 100644 include/sqlpp11/ppgen/default.h create mode 100644 include/sqlpp11/ppgen/engine.h create mode 100644 include/sqlpp11/ppgen/floating_point.h create mode 100644 include/sqlpp11/ppgen/index.h create mode 100644 include/sqlpp11/ppgen/integer.h create mode 100644 include/sqlpp11/ppgen/key.h create mode 100644 include/sqlpp11/ppgen/not_null.h create mode 100644 include/sqlpp11/ppgen/null.h create mode 100644 include/sqlpp11/ppgen/primary_key.h create mode 100644 include/sqlpp11/ppgen/text.h create mode 100644 include/sqlpp11/ppgen/timestamp.h create mode 100644 include/sqlpp11/ppgen/unique.h create mode 100644 include/sqlpp11/ppgen/varchar.h create mode 100644 include/sqlpp11/ppgen/wrap_seq.h diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1ab2fd65..60fdd051 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,6 +11,7 @@ build(insert) build(update) build(remove) build(select) +build(ppgen) #find_package(PythonInterp REQUIRED) diff --git a/examples/ppgen.cpp b/examples/ppgen.cpp new file mode 100644 index 00000000..4c4d01a5 --- /dev/null +++ b/examples/ppgen.cpp @@ -0,0 +1,93 @@ +/* + * 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. + */ + +#if 0 // syntax example +SQLPP_DECLARE_TABLE( + (table, DROP_IF_EXISTS, CREATE_IF_NOT_EXISTS, ENGINE("InnoDB"), CHARACTER_SET("utf-8"), COMMENT("table comments")) + , + (id, int, NOT_NULL, PRIMARY_KEY, AUTO_INCREMENT) + (name, varchar(64), NOT_NULL, INDEX("name_index"), DEFAULT("any name")) + (age, int, NOT_NULL, INDEX("age_index"), UNIQUE, COMMENT("some comments")) +) +#endif + +#include +#include + +#include "MockDb.h" + +SQLPP_DECLARE_TABLE( + (tab_person) + , + (id , int , SQLPP_AUTO_INCREMENT) + (name , varchar(255), SQLPP_NOT_NULL ) + (feature, int , SQLPP_NOT_NULL ) +) + +SQLPP_DECLARE_TABLE( + (tab_feature) + , + (id , int , SQLPP_AUTO_INCREMENT) + (name , varchar(255), SQLPP_NULL ) + (fatal, bool , SQLPP_NOT_NULL ) +) + +int main() { + MockDb db; + tab_person::tab_person p; + tab_feature::tab_feature f; + + db(insert_into(f).set(f.name = "loves c++", f.fatal = false)); + + //db(insert_into(f).set(f.nahme = "loves c++", f.fatal = false)); + + //db(insert_into(f).set(f.name == "loves c++", f.fatal = false)); + + //db(insert_into(f).set(f.name = "loves c++", f.fatal = "false")); + + //db(insert_into(p).set(f.name = "loves c++", f.fatal = false)); + + //db(insert_into(f).set(f.name = "loves c++", p.feature = 7)); + + //db(insert_into(f).set(f.id = 42, f.name = "loves c++", f.fatal = false)); + + //db(insert_into(f).set(f.name = "loves c++")); + + + db(insert_into(f).default_values()); + + auto i = insert_into(p).columns(p.name, p.feature); + i.values.add(p.name = "Roland", p.feature = 1); + i.values.add(p.name = "Zaphod", p.feature = sqlpp::default_value); + db(i); + + + auto pi = db.prepare(insert_into(p).set(p.name = parameter(f.name), p.feature = parameter(p.feature))); + pi.params.name = "likes java"; + pi.params.feature = true; + + db(pi); +} diff --git a/include/sqlpp11/ppgen.h b/include/sqlpp11/ppgen.h new file mode 100644 index 00000000..a05a80f7 --- /dev/null +++ b/include/sqlpp11/ppgen.h @@ -0,0 +1,206 @@ +/* + * 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_h +#define _sqlpp__ppgen_h + +#include + +// enable the Clang support +#if defined(__clang__) && !BOOST_PP_VARIADICS +# undef BOOST_PP_VARIADICS +# define BOOST_PP_VARIADICS 1 +#endif // defined(__clang__) + +// tools +#include + +// table props +#include +#include + +// col props +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// boost.preprocessor +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/***************************************************************************/ +// tools + +#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) \ + 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_TABLE_ENUM_COLUMNS(unused, table, elem) \ + ,table::SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) + +/***************************************************************************/ +// columns + +#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_COMMA_IF(BOOST_PP_LESS(BOOST_PP_ADD(idx, 1), size)) + +#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) \ + ) + +#define SQLPP_DECLARE_COLUMN(unused, data, elem) \ + struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) { \ + struct _alias_t { \ + static constexpr const char _literal[] = \ + BOOST_PP_STRINGIZE(SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem)); \ + using _name_t = sqlpp::make_char_sequence; \ + \ + template \ + struct _member_t { \ + T SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); \ + \ + T& operator()() { return SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); } \ + const T& operator()() const { return SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem); } \ + }; /* struct _member_t */ \ + }; /* struct _alias_t */ \ + \ + using _traits = sqlpp::make_traits< \ + SQLPP_DECLARE_COLUMN_GEN_TRAITS(BOOST_PP_TUPLE_POP_FRONT(elem)) \ + >; \ + \ + }; /* struct SQLPP_DECLARE_COLUMN_GET_COLUMN_NAME(elem) */ + +/***************************************************************************/ +// table props + +#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) + +#define SQLPP_DECLARE_TABLE_GEN_PROPS(table) \ + BOOST_PP_SEQ_FOR_EACH( \ + SQLPP_DECLARE_TABLE_GEN_PROPS_AUX \ + ,~ \ + ,BOOST_PP_TUPLE_TO_SEQ(BOOST_PP_TUPLE_POP_FRONT(table)) \ + ) + +/***************************************************************************/ +// main + +#define SQLPP_DECLARE_TABLE_IMPL(table, cols) \ + namespace 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 \ + ) \ + } /* namespace BOOST_PP_CAT(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table), _) */ \ + \ + struct SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table) \ + : 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 \ + ) \ + > \ + { \ + BOOST_PP_IF( \ + BOOST_PP_LESS(BOOST_PP_TUPLE_SIZE(table), 2) \ + ,BOOST_PP_TUPLE_EAT() \ + ,SQLPP_DECLARE_TABLE_GEN_PROPS \ + )(BOOST_PP_EXPAND table) \ + \ + struct _alias_t { \ + static constexpr const char _literal[] = \ + BOOST_PP_STRINGIZE(SQLPP_DECLARE_TABLE_GET_TABLE_NAME(table)); \ + using _name_t = sqlpp::make_char_sequence; \ + \ + template \ + struct _member_t { \ + T 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) \ + SQLPP_DECLARE_TABLE_IMPL( \ + BOOST_PP_CAT(SQLPP_WRAP_SEQUENCE_X table, 0) \ + ,BOOST_PP_CAT(SQLPP_WRAP_SEQUENCE_X cols, 0) \ + ) + +/***************************************************************************/ + +#endif // _sqlpp__ppgen_h diff --git a/include/sqlpp11/ppgen/auto_increment.h b/include/sqlpp11/ppgen/auto_increment.h new file mode 100644 index 00000000..2ecc2cda --- /dev/null +++ b/include/sqlpp11/ppgen/auto_increment.h @@ -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__auto_increment_h +#define _sqlpp__ppgen__auto_increment_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_AUTO_INCREMENT \ + PROC_SQLPP_AUTO_INCREMENT +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_AUTO_INCREMENT(...) \ + sqlpp::tag::must_not_update + +#endif // _sqlpp__ppgen__auto_increment_h diff --git a/include/sqlpp11/ppgen/blob.h b/include/sqlpp11/ppgen/blob.h new file mode 100644 index 00000000..d8994fc2 --- /dev/null +++ b/include/sqlpp11/ppgen/blob.h @@ -0,0 +1,50 @@ +/* + * 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__blob_h +#define _sqlpp__ppgen__blob_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_tinyblob \ + 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_GEN_TRAITS_PROC_blob(...) \ + sqlpp::blob + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_mediumblob \ + 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_GEN_TRAITS_PROC_longblob(...) \ + sqlpp::blob + +#endif // _sqlpp__ppgen__blob_h diff --git a/include/sqlpp11/ppgen/bool.h b/include/sqlpp11/ppgen/bool.h new file mode 100644 index 00000000..62ae4bfc --- /dev/null +++ b/include/sqlpp11/ppgen/bool.h @@ -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__bool_h +#define _sqlpp__ppgen__bool_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_bool \ + PROC_bool +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_bool(...) \ + sqlpp::boolean + +#endif // _sqlpp__ppgen__bool_h diff --git a/include/sqlpp11/ppgen/character_set.h b/include/sqlpp11/ppgen/character_set.h new file mode 100644 index 00000000..de02ee91 --- /dev/null +++ b/include/sqlpp11/ppgen/character_set.h @@ -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__character_set_h +#define _sqlpp__ppgen__character_set_h + +#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_CHARACTER_SET(str) \ + PROC_SQLPP_CHARACTER_SET +#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_CHARACTER_SET(str) \ + [CHARACTER_SET is not implemented] + +#endif // _sqlpp__ppgen__character_set_h diff --git a/include/sqlpp11/ppgen/comment.h b/include/sqlpp11/ppgen/comment.h new file mode 100644 index 00000000..55161c0f --- /dev/null +++ b/include/sqlpp11/ppgen/comment.h @@ -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__comment_h +#define _sqlpp__ppgen__comment_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_COMMENT(str) \ + PROC_SQLPP_COMMENT +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_COMMENT(str) \ + [COMMENT is not implemented] + +#endif // _sqlpp__ppgen__comment_h diff --git a/include/sqlpp11/ppgen/datetime.h b/include/sqlpp11/ppgen/datetime.h new file mode 100644 index 00000000..c1cc6e73 --- /dev/null +++ b/include/sqlpp11/ppgen/datetime.h @@ -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__datetime_h +#define _sqlpp__ppgen__datetime_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_datetime \ + PROC_datetime +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_datetime(...) \ + [datetime is not implemented] + +#endif // _sqlpp__ppgen__datetime_h diff --git a/include/sqlpp11/ppgen/default.h b/include/sqlpp11/ppgen/default.h new file mode 100644 index 00000000..8bc60f70 --- /dev/null +++ b/include/sqlpp11/ppgen/default.h @@ -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__default_h +#define _sqlpp__ppgen__default_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_DEFAULT(value) \ + PROC_SQLPP_DEFAULT +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_DEFAULT(...) \ + [DEFAULT is not implemented] + +#endif // _sqlpp__ppgen__default_h diff --git a/include/sqlpp11/ppgen/engine.h b/include/sqlpp11/ppgen/engine.h new file mode 100644 index 00000000..5b40e881 --- /dev/null +++ b/include/sqlpp11/ppgen/engine.h @@ -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__engine_h +#define _sqlpp__ppgen__engine_h + +#define SQLPP_DECLARE_TABLE_GET_PROC_LAZY_SQLPP_ENGINE(str) \ + PROC_SQLPP_ENGINE +#define SQLPP_DECLARE_TABLE_GEN_PROC_SQLPP_ENGINE(str) \ + [ENGINE is not implemented] + +#endif // _sqlpp__ppgen__engine_h diff --git a/include/sqlpp11/ppgen/floating_point.h b/include/sqlpp11/ppgen/floating_point.h new file mode 100644 index 00000000..77ab121e --- /dev/null +++ b/include/sqlpp11/ppgen/floating_point.h @@ -0,0 +1,40 @@ +/* + * 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__floating_point_h +#define _sqlpp__ppgen__floating_point_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_float \ + 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_GEN_TRAITS_PROC_double(...) \ + sqlpp::floating_point + +#endif // _sqlpp__ppgen__floating_point_h diff --git a/include/sqlpp11/ppgen/index.h b/include/sqlpp11/ppgen/index.h new file mode 100644 index 00000000..97a886d3 --- /dev/null +++ b/include/sqlpp11/ppgen/index.h @@ -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__index_h +#define _sqlpp__ppgen__index_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_INDEX(name) \ + PROC_SQLPP_INDEX +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_INDEX(name) \ + [INDEX is not implemented] + +#endif // _sqlpp__ppgen__index_h diff --git a/include/sqlpp11/ppgen/integer.h b/include/sqlpp11/ppgen/integer.h new file mode 100644 index 00000000..934930d0 --- /dev/null +++ b/include/sqlpp11/ppgen/integer.h @@ -0,0 +1,50 @@ +/* + * 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__integer_h +#define _sqlpp__ppgen__integer_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_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_GEN_TRAITS_PROC_smallint(...) \ + sqlpp::smallint + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_int \ + 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_GEN_TRAITS_PROC_bigint(...) \ + sqlpp::bigint + +#endif // _sqlpp__ppgen__integer_h diff --git a/include/sqlpp11/ppgen/key.h b/include/sqlpp11/ppgen/key.h new file mode 100644 index 00000000..7192b1d9 --- /dev/null +++ b/include/sqlpp11/ppgen/key.h @@ -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__key_h +#define _sqlpp__ppgen__key_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_KEY(name) \ + PROC_SQLPP_KEY +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_KEY(name) \ + [KEY is not implemented] + +#endif // _sqlpp__ppgen__key_h diff --git a/include/sqlpp11/ppgen/not_null.h b/include/sqlpp11/ppgen/not_null.h new file mode 100644 index 00000000..fadff0db --- /dev/null +++ b/include/sqlpp11/ppgen/not_null.h @@ -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__not_null_h +#define _sqlpp__ppgen__not_null_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NOT_NULL \ + PROC_SQLPP_NOT_NULL +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NOT_NULL(...) \ + sqlpp::tag::require_insert + +#endif // _sqlpp__ppgen__not_null_h diff --git a/include/sqlpp11/ppgen/null.h b/include/sqlpp11/ppgen/null.h new file mode 100644 index 00000000..94269b01 --- /dev/null +++ b/include/sqlpp11/ppgen/null.h @@ -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__null_h +#define _sqlpp__ppgen__null_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_NULL \ + PROC_SQLPP_NULL +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_NULL(...) \ + sqlpp::tag::can_be_null + +#endif // _sqlpp__ppgen__null_h diff --git a/include/sqlpp11/ppgen/primary_key.h b/include/sqlpp11/ppgen/primary_key.h new file mode 100644 index 00000000..2bf82e05 --- /dev/null +++ b/include/sqlpp11/ppgen/primary_key.h @@ -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__primary_key_h +#define _sqlpp__ppgen__primary_key_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_PRIMARY_KEY \ + PROC_SQLPP_PRIMARY_KEY +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_PRIMARY_KEY(...) \ + [PRIMARY_KEY is not implemented] + +#endif // _sqlpp__ppgen__primary_key_h diff --git a/include/sqlpp11/ppgen/text.h b/include/sqlpp11/ppgen/text.h new file mode 100644 index 00000000..2880a602 --- /dev/null +++ b/include/sqlpp11/ppgen/text.h @@ -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__text_h +#define _sqlpp__ppgen__text_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_text \ + PROC_text +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_text(...) \ + sqlpp::text + +#endif // _sqlpp__ppgen__text_h diff --git a/include/sqlpp11/ppgen/timestamp.h b/include/sqlpp11/ppgen/timestamp.h new file mode 100644 index 00000000..6592b88b --- /dev/null +++ b/include/sqlpp11/ppgen/timestamp.h @@ -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__timestamp_h +#define _sqlpp__ppgen__timestamp_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_timestamp \ + PROC_timestamp +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_timestamp(...) \ + [timestamp is not implemented] + +#endif // _sqlpp__ppgen__timestamp_h diff --git a/include/sqlpp11/ppgen/unique.h b/include/sqlpp11/ppgen/unique.h new file mode 100644 index 00000000..56f83102 --- /dev/null +++ b/include/sqlpp11/ppgen/unique.h @@ -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__unique_h +#define _sqlpp__ppgen__unique_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_SQLPP_UNIQUE \ + PROC_SQLPP_UNIQUE +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_SQLPP_UNIQUE(...) \ + [UNIQUE is not implemented] + +#endif // _sqlpp__ppgen__unique_h diff --git a/include/sqlpp11/ppgen/varchar.h b/include/sqlpp11/ppgen/varchar.h new file mode 100644 index 00000000..6561c27d --- /dev/null +++ b/include/sqlpp11/ppgen/varchar.h @@ -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__varchar_h +#define _sqlpp__ppgen__varchar_h + +#define SQLPP_DECLARE_COLUMN_GET_TRAITS_LAZY_varchar(str) \ + PROC_varchar +#define SQLPP_DECLARE_COLUMN_GEN_TRAITS_PROC_varchar(str) \ + sqlpp::varchar + +#endif // _sqlpp__ppgen__varchar_h diff --git a/include/sqlpp11/ppgen/wrap_seq.h b/include/sqlpp11/ppgen/wrap_seq.h new file mode 100644 index 00000000..741e9a62 --- /dev/null +++ b/include/sqlpp11/ppgen/wrap_seq.h @@ -0,0 +1,38 @@ +/* + * 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__wrap_seq_h +#define _sqlpp__ppgen__wrap_seq_h + +#define SQLPP_WRAP_SEQUENCE_X(...) \ + ((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_Y +#define SQLPP_WRAP_SEQUENCE_Y(...) \ + ((__VA_ARGS__)) SQLPP_WRAP_SEQUENCE_X + +#define SQLPP_WRAP_SEQUENCE_X0 +#define SQLPP_WRAP_SEQUENCE_Y0 + +#endif // _sqlpp__ppgen__wrap_seq_h