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
|
|
|
|
2014-07-20 17:14:44 +08:00
|
|
|
#include <sqlpp11/table.h>
|
2015-10-30 05:21:46 +08:00
|
|
|
#include <sqlpp11/data_types.h>
|
2014-12-01 02:40:34 +08:00
|
|
|
#include <sqlpp11/char_sequence.h>
|
2014-07-20 17:14:44 +08:00
|
|
|
|
|
|
|
namespace test
|
|
|
|
{
|
|
|
|
namespace TabFoo_
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
struct Id
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "id";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T id;
|
|
|
|
T& operator()() { return id; }
|
|
|
|
const T& operator()() const { return id; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::integer;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct TextNnD
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "text_nn_d";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T textNnD;
|
|
|
|
T& operator()() { return textNnD; }
|
|
|
|
const T& operator()() const { return textNnD; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::text;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct IntN
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "int_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T intN;
|
|
|
|
T& operator()() { return intN; }
|
|
|
|
const T& operator()() const { return intN; }
|
|
|
|
};
|
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::integer>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2024-06-15 02:04:08 +08:00
|
|
|
};
|
|
|
|
struct DoubleN
|
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
|
|
|
static constexpr const char _literal[] = "double_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T doubleN;
|
|
|
|
T& operator()() { return doubleN; }
|
|
|
|
const T& operator()() const { return doubleN; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::floating_point>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct UIntN
|
2016-05-20 19:09:48 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "u_int_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2016-05-20 19:09:48 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T uIntN;
|
|
|
|
T& operator()() { return uIntN; }
|
|
|
|
const T& operator()() const { return uIntN; }
|
|
|
|
};
|
2016-05-20 19:09:48 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::integer_unsigned>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2016-06-06 03:35:49 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct BlobN
|
2017-08-07 01:54:54 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "blob_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2017-08-07 01:54:54 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T blobN;
|
|
|
|
T& operator()() { return blobN; }
|
|
|
|
const T& operator()() const { return blobN; }
|
|
|
|
};
|
2017-08-07 01:54:54 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::blob>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2017-08-07 01:54:54 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
} // namespace TabFoo_
|
2014-07-20 17:14:44 +08:00
|
|
|
|
2024-07-05 15:59:38 +08:00
|
|
|
struct TabFoo: ::sqlpp::table_t<TabFoo,
|
2024-06-15 02:04:08 +08:00
|
|
|
TabFoo_::Id,
|
|
|
|
TabFoo_::TextNnD,
|
|
|
|
TabFoo_::IntN,
|
|
|
|
TabFoo_::DoubleN,
|
|
|
|
TabFoo_::UIntN,
|
|
|
|
TabFoo_::BlobN>
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "tab_foo";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabFoo;
|
2024-06-15 02:04:08 +08:00
|
|
|
T& operator()() { return tabFoo; }
|
|
|
|
const T& operator()() const { return tabFoo; }
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
namespace TabBar_
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
struct Id
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "id";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T id;
|
|
|
|
T& operator()() { return id; }
|
|
|
|
const T& operator()() const { return id; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::integer;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct TextN
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "text_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T textN;
|
|
|
|
T& operator()() { return textN; }
|
|
|
|
const T& operator()() const { return textN; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::text>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct BoolNn
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "bool_nn";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T boolNn;
|
|
|
|
T& operator()() { return boolNn; }
|
|
|
|
const T& operator()() const { return boolNn; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::boolean;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::false_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct IntN
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "int_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T intN;
|
|
|
|
T& operator()() { return intN; }
|
|
|
|
const T& operator()() const { return intN; }
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::integer>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
} // namespace TabBar_
|
2014-07-20 17:14:44 +08:00
|
|
|
|
2024-07-05 15:59:38 +08:00
|
|
|
struct TabBar: ::sqlpp::table_t<TabBar,
|
2024-06-15 02:04:08 +08:00
|
|
|
TabBar_::Id,
|
|
|
|
TabBar_::TextN,
|
|
|
|
TabBar_::BoolNn,
|
|
|
|
TabBar_::IntN>
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "tab_bar";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabBar;
|
2024-06-15 02:04:08 +08:00
|
|
|
T& operator()() { return tabBar; }
|
|
|
|
const T& operator()() const { return tabBar; }
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-10-29 03:52:43 +08:00
|
|
|
namespace TabDateTime_
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
struct Id
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "id";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2015-10-29 03:52:43 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T id;
|
|
|
|
T& operator()() { return id; }
|
|
|
|
const T& operator()() const { return id; }
|
|
|
|
};
|
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::integer;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2024-06-15 02:04:08 +08:00
|
|
|
};
|
|
|
|
struct DayPointN
|
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
|
|
|
static constexpr const char _literal[] = "day_point_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T dayPointN;
|
|
|
|
T& operator()() { return dayPointN; }
|
|
|
|
const T& operator()() const { return dayPointN; }
|
|
|
|
};
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::day_point>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct TimePointN
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "time_point_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2015-10-29 03:52:43 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T timePointN;
|
|
|
|
T& operator()() { return timePointN; }
|
|
|
|
const T& operator()() const { return timePointN; }
|
|
|
|
};
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::time_point>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
struct TimeOfDayN
|
2016-05-19 20:53:56 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "time_of_day_n";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2016-05-19 20:53:56 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
T timeOfDayN;
|
|
|
|
T& operator()() { return timeOfDayN; }
|
|
|
|
const T& operator()() const { return timeOfDayN; }
|
|
|
|
};
|
2016-05-19 20:53:56 +08:00
|
|
|
};
|
2024-07-05 15:59:38 +08:00
|
|
|
using value_type = ::sqlpp::compat::optional<::sqlpp::time_of_day>;
|
2024-07-09 14:08:53 +08:00
|
|
|
using has_default_value = std::true_type;
|
2016-05-19 20:53:56 +08:00
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
} // namespace TabDateTime_
|
2015-10-29 03:52:43 +08:00
|
|
|
|
2024-07-05 15:59:38 +08:00
|
|
|
struct TabDateTime: ::sqlpp::table_t<TabDateTime,
|
2024-06-15 02:04:08 +08:00
|
|
|
TabDateTime_::Id,
|
|
|
|
TabDateTime_::DayPointN,
|
|
|
|
TabDateTime_::TimePointN,
|
|
|
|
TabDateTime_::TimeOfDayN>
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2024-06-15 02:04:08 +08:00
|
|
|
static constexpr const char _literal[] = "tab_date_time";
|
2024-07-05 15:59:38 +08:00
|
|
|
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2024-06-15 02:04:08 +08:00
|
|
|
template<typename T>
|
2015-10-29 03:52:43 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabDateTime;
|
2024-06-15 02:04:08 +08:00
|
|
|
T& operator()() { return tabDateTime; }
|
|
|
|
const T& operator()() const { return tabDateTime; }
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-06-15 02:04:08 +08:00
|
|
|
} // namespace test
|