2023-07-25 13:00:05 +08:00
|
|
|
#pragma once
|
2014-07-20 17:14:44 +08:00
|
|
|
|
2024-07-05 15:59:38 +08:00
|
|
|
// generated by ./scripts/ddl2cpp -auto-id tests/core/usage/sample.sql tests/core/usage/Sample test
|
2024-06-15 02:04:08 +08:00
|
|
|
|
2024-07-30 02:28:22 +08:00
|
|
|
#include <sqlpp11/core/basic/table.h>
|
|
|
|
#include <sqlpp11/core/basic/table_columns.h>
|
|
|
|
#include <sqlpp11/core/type_traits.h>
|
2024-09-01 16:57:22 +08:00
|
|
|
#include <sqlpp11/core/name/create_name_tag.h>
|
2024-08-06 12:57:47 +08:00
|
|
|
#include <sqlpp11/core/compat/string_view.h>
|
2014-07-20 17:14:44 +08:00
|
|
|
|
|
|
|
namespace test
|
|
|
|
{
|
2024-07-26 02:13:38 +08:00
|
|
|
struct TabFoo_ : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-07-20 03:01:59 +08:00
|
|
|
struct Id : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(id, id);
|
2024-07-14 19:07:41 +08:00
|
|
|
using value_type = ::sqlpp::integral;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct TextNnD : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(text_nn_d, textNnD);
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::text;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct IntN : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(int_n, intN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::integral>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2024-06-15 02:04:08 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct DoubleN : public ::sqlpp::name_tag_base
|
2024-06-15 02:04:08 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(double_n, doubleN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::floating_point>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct UIntN : public ::sqlpp::name_tag_base
|
2016-05-20 19:09:48 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(u_int_n, uIntN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::unsigned_integral>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2016-06-06 03:35:49 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct BlobN : public ::sqlpp::name_tag_base
|
2017-08-07 01:54:54 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(blob_n, blobN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::blob>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2017-08-07 01:54:54 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct BoolN : public ::sqlpp::name_tag_base
|
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(bool_n, boolN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::boolean>;
|
2024-07-20 03:01:59 +08:00
|
|
|
using has_default = std::true_type;
|
|
|
|
};
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(tab_foo, tabFoo);
|
2024-07-26 02:13:38 +08:00
|
|
|
template<typename T>
|
|
|
|
using _table_columns = sqlpp::table_columns<T,
|
|
|
|
Id,
|
|
|
|
TextNnD,
|
|
|
|
IntN,
|
|
|
|
DoubleN,
|
|
|
|
UIntN,
|
|
|
|
BlobN,
|
|
|
|
BoolN>;
|
|
|
|
using _required_insert_columns = sqlpp::detail::type_set<>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-26 02:13:38 +08:00
|
|
|
using TabFoo = ::sqlpp::table_t<TabFoo_>;
|
|
|
|
|
|
|
|
struct TabBar_ : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-07-20 03:01:59 +08:00
|
|
|
struct Id : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(id, id);
|
2024-07-14 19:07:41 +08:00
|
|
|
using value_type = ::sqlpp::integral;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct TextN : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(text_n, textN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::text>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct BoolNn : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(bool_nn, boolNn);
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::boolean;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::false_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct IntN : public ::sqlpp::name_tag_base
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(int_n, intN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::integral>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(tab_bar, tabBar);
|
2024-07-26 02:13:38 +08:00
|
|
|
template<typename T>
|
|
|
|
using _table_columns = sqlpp::table_columns<T,
|
|
|
|
Id,
|
|
|
|
TextN,
|
|
|
|
BoolNn,
|
|
|
|
IntN>;
|
|
|
|
using _required_insert_columns = sqlpp::detail::type_set<
|
2024-09-01 16:32:13 +08:00
|
|
|
sqlpp::column_t<sqlpp::table_t<TabBar_>, BoolNn>>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-26 02:13:38 +08:00
|
|
|
using TabBar = ::sqlpp::table_t<TabBar_>;
|
|
|
|
|
|
|
|
struct TabDateTime_ : public ::sqlpp::name_tag_base
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
2024-07-20 03:01:59 +08:00
|
|
|
struct Id : public ::sqlpp::name_tag_base
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(id, id);
|
2024-07-14 19:07:41 +08:00
|
|
|
using value_type = ::sqlpp::integral;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2024-06-15 02:04:08 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct DayPointN : public ::sqlpp::name_tag_base
|
2024-06-15 02:04:08 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(day_point_n, dayPointN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::day_point>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct TimePointN : public ::sqlpp::name_tag_base
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(time_point_n, timePointN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::time_point>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-07-20 03:01:59 +08:00
|
|
|
struct TimeOfDayN : public ::sqlpp::name_tag_base
|
2016-05-19 20:53:56 +08:00
|
|
|
{
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(time_of_day_n, timeOfDayN);
|
2024-07-30 02:49:45 +08:00
|
|
|
using value_type = ::sqlpp::optional<::sqlpp::time_of_day>;
|
2024-07-13 19:39:36 +08:00
|
|
|
using has_default = std::true_type;
|
2016-05-19 20:53:56 +08:00
|
|
|
};
|
2024-09-01 16:57:22 +08:00
|
|
|
SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(tab_date_time, tabDateTime);
|
2024-07-26 02:13:38 +08:00
|
|
|
template<typename T>
|
|
|
|
using _table_columns = sqlpp::table_columns<T,
|
|
|
|
Id,
|
|
|
|
DayPointN,
|
|
|
|
TimePointN,
|
|
|
|
TimeOfDayN>;
|
|
|
|
using _required_insert_columns = sqlpp::detail::type_set<>;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-07-26 02:13:38 +08:00
|
|
|
using TabDateTime = ::sqlpp::table_t<TabDateTime_>;
|
|
|
|
|
2024-06-15 02:04:08 +08:00
|
|
|
} // namespace test
|