2014-09-06 10:18:15 +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-09-06 10:18:15 +08:00
|
|
|
|
|
|
|
namespace test
|
|
|
|
{
|
|
|
|
namespace TabPerson_
|
|
|
|
{
|
|
|
|
struct Id
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "id";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T id;
|
|
|
|
T& operator()() { return id; }
|
|
|
|
const T& operator()() const { return id; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::must_not_insert, sqlpp::tag::must_not_update, sqlpp::tag::can_be_null>;
|
|
|
|
};
|
|
|
|
struct Name
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "name";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T name;
|
|
|
|
T& operator()() { return name; }
|
|
|
|
const T& operator()() const { return name; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar, sqlpp::tag::require_insert>;
|
|
|
|
};
|
|
|
|
struct Feature
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "feature";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T feature;
|
|
|
|
T& operator()() { return feature; }
|
|
|
|
const T& operator()() const { return feature; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::require_insert>;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TabPerson: sqlpp::table_t<TabPerson,
|
|
|
|
TabPerson_::Id,
|
|
|
|
TabPerson_::Name,
|
|
|
|
TabPerson_::Feature>
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "tab_person";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabPerson;
|
|
|
|
T& operator()() { return tabPerson; }
|
|
|
|
const T& operator()() const { return tabPerson; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
namespace TabFeature_
|
|
|
|
{
|
|
|
|
struct Id
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "id";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T id;
|
|
|
|
T& operator()() { return id; }
|
|
|
|
const T& operator()() const { return id; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::must_not_insert, sqlpp::tag::must_not_update, sqlpp::tag::can_be_null>;
|
|
|
|
};
|
|
|
|
struct Name
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "name";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T name;
|
|
|
|
T& operator()() { return name; }
|
|
|
|
const T& operator()() const { return name; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar, sqlpp::tag::can_be_null>;
|
|
|
|
};
|
|
|
|
struct Fatal
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "fatal";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T fatal;
|
|
|
|
T& operator()() { return fatal; }
|
|
|
|
const T& operator()() const { return fatal; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::boolean, sqlpp::tag::require_insert>;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TabFeature: sqlpp::table_t<TabFeature,
|
|
|
|
TabFeature_::Id,
|
|
|
|
TabFeature_::Name,
|
|
|
|
TabFeature_::Fatal>
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-09-06 10:18:15 +08:00
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
static constexpr const char _literal[] = "tab_feature";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2014-09-06 10:18:15 +08:00
|
|
|
template<typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabFeature;
|
|
|
|
T& operator()() { return tabFeature; }
|
|
|
|
const T& operator()() const { return tabFeature; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|