2014-07-20 17:14:44 +08:00
|
|
|
#ifndef TEST_SAMPLE_H
|
|
|
|
#define TEST_SAMPLE_H
|
|
|
|
|
|
|
|
#include <sqlpp11/table.h>
|
|
|
|
#include <sqlpp11/column_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_
|
|
|
|
{
|
|
|
|
struct Delta
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[6] = "delta";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T delta;
|
|
|
|
T& operator()() { return delta; }
|
|
|
|
const T& operator()() const { return delta; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar, sqlpp::tag::can_be_null>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
struct Epsilon
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[8] = "epsilon";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T epsilon;
|
|
|
|
T& operator()() { return epsilon; }
|
|
|
|
const T& operator()() const { return epsilon; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::bigint, sqlpp::tag::can_be_null>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
struct Omega
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[6] = "omega";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T omega;
|
|
|
|
T& operator()() { return omega; }
|
|
|
|
const T& operator()() const { return omega; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::floating_point, sqlpp::tag::can_be_null>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TabFoo: sqlpp::table_t<TabFoo,
|
|
|
|
TabFoo_::Delta,
|
|
|
|
TabFoo_::Epsilon,
|
|
|
|
TabFoo_::Omega>
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[8] = "tab_foo";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabFoo;
|
|
|
|
T& operator()() { return tabFoo; }
|
|
|
|
const T& operator()() const { return tabFoo; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
namespace TabBar_
|
|
|
|
{
|
|
|
|
struct Alpha
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[6] = "alpha";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T alpha;
|
|
|
|
T& operator()() { return alpha; }
|
|
|
|
const T& operator()() const { return alpha; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::bigint, sqlpp::tag::must_not_insert, sqlpp::tag::must_not_update, sqlpp::tag::can_be_null>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
struct Beta
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[5] = "beta";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T beta;
|
|
|
|
T& operator()() { return beta; }
|
|
|
|
const T& operator()() const { return beta; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar, sqlpp::tag::can_be_null>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
struct Gamma
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[6] = "gamma";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T gamma;
|
|
|
|
T& operator()() { return gamma; }
|
|
|
|
const T& operator()() const { return gamma; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::boolean, sqlpp::tag::require_insert>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
struct Delta
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[6] = "delta";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T delta;
|
|
|
|
T& operator()() { return delta; }
|
|
|
|
const T& operator()() const { return delta; }
|
|
|
|
};
|
|
|
|
};
|
2014-07-24 00:06:33 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::can_be_null>;
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TabBar: sqlpp::table_t<TabBar,
|
|
|
|
TabBar_::Alpha,
|
|
|
|
TabBar_::Beta,
|
|
|
|
TabBar_::Gamma,
|
|
|
|
TabBar_::Delta>
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-05-30 02:06:21 +08:00
|
|
|
static constexpr const char _literal[8] = "tab_bar";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-07-20 17:14:44 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabBar;
|
|
|
|
T& operator()() { return tabBar; }
|
|
|
|
const T& operator()() const { return tabBar; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|