2014-07-20 17:14:44 +08:00
|
|
|
#ifndef TEST_SAMPLE_H
|
|
|
|
#define TEST_SAMPLE_H
|
|
|
|
|
|
|
|
#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_
|
|
|
|
{
|
|
|
|
struct Delta
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "delta";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T delta;
|
|
|
|
T& operator()()
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2016-03-11 16:25:36 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar>;
|
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-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "epsilon";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T epsilon;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return epsilon;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return epsilon;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
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-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "omega";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T omega;
|
|
|
|
T& operator()()
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return omega;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return omega;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
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
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-09-14 03:33:19 +08:00
|
|
|
struct TabFoo : sqlpp::table_t<TabFoo, TabFoo_::Delta, TabFoo_::Epsilon, TabFoo_::Omega>
|
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
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "tab_foo";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabFoo;
|
2015-09-14 03:33:19 +08:00
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return tabFoo;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return tabFoo;
|
|
|
|
}
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
namespace TabBar_
|
|
|
|
{
|
|
|
|
struct Alpha
|
|
|
|
{
|
2014-12-01 02:40:34 +08:00
|
|
|
struct _alias_t
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "alpha";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T alpha;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return alpha;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return alpha;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
2015-09-14 03:33:19 +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-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "beta";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T beta;
|
|
|
|
T& operator()()
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return beta;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return beta;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
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-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "gamma";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T gamma;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return gamma;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return gamma;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
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-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "delta";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
2015-09-14 03:33:19 +08:00
|
|
|
{
|
|
|
|
T delta;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 17:14:44 +08:00
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
};
|
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
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-09-14 03:33:19 +08:00
|
|
|
struct TabBar : sqlpp::table_t<TabBar, TabBar_::Alpha, TabBar_::Beta, TabBar_::Gamma, TabBar_::Delta>
|
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
|
|
|
{
|
2015-09-14 03:33:19 +08:00
|
|
|
static constexpr const char _literal[] = "tab_bar";
|
2014-12-01 02:40:34 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-14 03:33:19 +08:00
|
|
|
template <typename T>
|
2014-07-20 17:14:44 +08:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabBar;
|
2015-09-14 03:33:19 +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_
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
struct ColDayPoint
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
static constexpr const char _literal[] = "col_day_point";
|
2015-10-29 03:52:43 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
T colDayPoint;
|
2015-10-29 03:52:43 +08:00
|
|
|
T& operator()()
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
return colDayPoint;
|
2015-10-29 03:52:43 +08:00
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
return colDayPoint;
|
2015-10-29 03:52:43 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2015-10-29 23:41:45 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::day_point, sqlpp::tag::can_be_null>;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2015-10-29 23:41:45 +08:00
|
|
|
struct ColTimePoint
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
static constexpr const char _literal[] = "col_time_point";
|
2015-10-29 03:52:43 +08:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
T colTimePoint;
|
2015-10-29 03:52:43 +08:00
|
|
|
T& operator()()
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
return colTimePoint;
|
2015-10-29 03:52:43 +08:00
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
return colTimePoint;
|
2015-10-29 03:52:43 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2015-10-29 23:41:45 +08:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::time_point, sqlpp::tag::can_be_null>;
|
2015-10-29 03:52:43 +08:00
|
|
|
};
|
2016-05-19 20:53:56 +08:00
|
|
|
|
|
|
|
struct ColTimeOfDay
|
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
|
|
|
static constexpr const char _literal[] = "col_time_of_day";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T colTimeOfDay;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return colTimeOfDay;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return colTimeOfDay;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::time_of_day, sqlpp::tag::can_be_null>;
|
|
|
|
};
|
2015-10-29 03:52:43 +08:00
|
|
|
}
|
|
|
|
|
2016-05-19 20:53:56 +08:00
|
|
|
struct TabDateTime : sqlpp::table_t<TabDateTime, TabDateTime_::ColDayPoint, TabDateTime_::ColTimePoint, TabDateTime_::ColTimeOfDay>
|
2015-10-29 03:52:43 +08:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2015-10-29 23:41:45 +08:00
|
|
|
static constexpr const char _literal[] = "tab_time_point";
|
2015-10-29 03:52:43 +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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2014-07-20 17:14:44 +08:00
|
|
|
}
|
|
|
|
#endif
|