0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 12:51:13 +08:00
sqlpp11/tests/core/usage/Sample.h

344 lines
10 KiB
C
Raw Normal View History

#pragma once
2024-07-05 15:59:38 +08:00
// generated by ./scripts/ddl2cpp -auto-id tests/core/usage/sample.sql tests/core/usage/Sample test
#include <sqlpp11/table.h>
#include <sqlpp11/table_columns.h>
#include <sqlpp11/type_traits.h>
#include <sqlpp11/char_sequence.h>
namespace test
{
struct TabFoo_ : public ::sqlpp::name_tag_base
{
2024-07-20 03:01:59 +08:00
struct Id : public ::sqlpp::name_tag_base
{
struct _alias_t
{
static constexpr const char _literal[] = "id";
2024-07-05 15:59:38 +08:00
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template<typename T>
struct _member_t
{
T id;
T& operator()() { return id; }
const T& operator()() const { return id; }
};
};
using value_type = ::sqlpp::integral;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct TextNnD : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T textNnD;
T& operator()() { return textNnD; }
const T& operator()() const { return textNnD; }
};
};
2024-07-05 15:59:38 +08:00
using value_type = ::sqlpp::text;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct IntN : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T intN;
T& operator()() { return intN; }
const T& operator()() const { return intN; }
};
};
using value_type = ::sqlpp::compat::optional<::sqlpp::integral>;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct DoubleN : public ::sqlpp::name_tag_base
{
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>;
template<typename T>
struct _member_t
{
T doubleN;
T& operator()() { return doubleN; }
const T& operator()() const { return doubleN; }
};
};
2024-07-05 15:59:38 +08:00
using value_type = ::sqlpp::compat::optional<::sqlpp::floating_point>;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct UIntN : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T uIntN;
T& operator()() { return uIntN; }
const T& operator()() const { return uIntN; }
};
};
using value_type = ::sqlpp::compat::optional<::sqlpp::integral>;
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
{
struct _alias_t
{
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>;
template<typename T>
2017-08-07 01:54:54 +08:00
struct _member_t
{
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>;
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
{
struct _alias_t
{
static constexpr const char _literal[] = "bool_n";
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template<typename T>
struct _member_t
{
T boolN;
T& operator()() { return boolN; }
const T& operator()() const { return boolN; }
};
};
using value_type = ::sqlpp::compat::optional<::sqlpp::boolean>;
using has_default = std::true_type;
};
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T tabFoo;
T& operator()() { return tabFoo; }
const T& operator()() const { return tabFoo; }
};
};
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<>;
};
using TabFoo = ::sqlpp::table_t<TabFoo_>;
struct TabBar_ : public ::sqlpp::name_tag_base
{
2024-07-20 03:01:59 +08:00
struct Id : public ::sqlpp::name_tag_base
{
struct _alias_t
{
static constexpr const char _literal[] = "id";
2024-07-05 15:59:38 +08:00
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template<typename T>
struct _member_t
{
T id;
T& operator()() { return id; }
const T& operator()() const { return id; }
};
};
using value_type = ::sqlpp::integral;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct TextN : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T textN;
T& operator()() { return textN; }
const T& operator()() const { return textN; }
};
};
2024-07-05 15:59:38 +08:00
using value_type = ::sqlpp::compat::optional<::sqlpp::text>;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct BoolNn : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T boolNn;
T& operator()() { return boolNn; }
const T& operator()() const { return boolNn; }
};
};
2024-07-05 15:59:38 +08:00
using value_type = ::sqlpp::boolean;
using has_default = std::false_type;
};
2024-07-20 03:01:59 +08:00
struct IntN : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T intN;
T& operator()() { return intN; }
const T& operator()() const { return intN; }
};
};
using value_type = ::sqlpp::compat::optional<::sqlpp::integral>;
using has_default = std::true_type;
};
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T tabBar;
T& operator()() { return tabBar; }
const T& operator()() const { return tabBar; }
};
};
template<typename T>
using _table_columns = sqlpp::table_columns<T,
Id,
TextN,
BoolNn,
IntN>;
using _required_insert_columns = sqlpp::detail::type_set<
sqlpp::column_t<TabBar_, BoolNn>>;
};
using TabBar = ::sqlpp::table_t<TabBar_>;
struct TabDateTime_ : public ::sqlpp::name_tag_base
{
2024-07-20 03:01:59 +08:00
struct Id : public ::sqlpp::name_tag_base
{
struct _alias_t
{
static constexpr const char _literal[] = "id";
2024-07-05 15:59:38 +08:00
using _name_t = ::sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template<typename T>
struct _member_t
{
T id;
T& operator()() { return id; }
const T& operator()() const { return id; }
};
};
using value_type = ::sqlpp::integral;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct DayPointN : public ::sqlpp::name_tag_base
{
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>;
template<typename T>
struct _member_t
{
T dayPointN;
T& operator()() { return dayPointN; }
const T& operator()() const { return dayPointN; }
};
};
2024-07-05 15:59:38 +08:00
using value_type = ::sqlpp::compat::optional<::sqlpp::day_point>;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct TimePointN : public ::sqlpp::name_tag_base
{
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T timePointN;
T& operator()() { return timePointN; }
const T& operator()() const { return timePointN; }
};
};
2024-07-05 15:59:38 +08:00
using value_type = ::sqlpp::compat::optional<::sqlpp::time_point>;
using has_default = std::true_type;
};
2024-07-20 03:01:59 +08:00
struct TimeOfDayN : public ::sqlpp::name_tag_base
2016-05-19 20:53:56 +08:00
{
struct _alias_t
{
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>;
template<typename T>
2016-05-19 20:53:56 +08:00
struct _member_t
{
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>;
using has_default = std::true_type;
2016-05-19 20:53:56 +08:00
};
struct _alias_t
{
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>;
template<typename T>
struct _member_t
{
T tabDateTime;
T& operator()() { return tabDateTime; }
const T& operator()() const { return tabDateTime; }
};
};
template<typename T>
using _table_columns = sqlpp::table_columns<T,
Id,
DayPointN,
TimePointN,
TimeOfDayN>;
using _required_insert_columns = sqlpp::detail::type_set<>;
};
using TabDateTime = ::sqlpp::table_t<TabDateTime_>;
} // namespace test