2014-07-20 11:14:44 +02:00
|
|
|
#ifndef TEST_SAMPLE_H
|
|
|
|
#define TEST_SAMPLE_H
|
|
|
|
|
|
|
|
#include <sqlpp11/table.h>
|
2015-10-29 22:21:46 +01:00
|
|
|
#include <sqlpp11/data_types.h>
|
2014-11-30 19:40:34 +01:00
|
|
|
#include <sqlpp11/char_sequence.h>
|
2014-07-20 11:14:44 +02:00
|
|
|
|
|
|
|
namespace test
|
|
|
|
{
|
|
|
|
namespace TabFoo_
|
|
|
|
{
|
|
|
|
struct Delta
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "delta";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T delta;
|
|
|
|
T& operator()()
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2016-03-11 09:25:36 +01:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar>;
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
|
|
|
struct Epsilon
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "epsilon";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T epsilon;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return epsilon;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return epsilon;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2014-07-23 18:06:33 +02:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::bigint, sqlpp::tag::can_be_null>;
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
|
|
|
struct Omega
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "omega";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T omega;
|
|
|
|
T& operator()()
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return omega;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return omega;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2014-07-23 18:06:33 +02:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::floating_point, sqlpp::tag::can_be_null>;
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2016-05-20 07:09:48 -04:00
|
|
|
struct Psi
|
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
|
|
|
static constexpr const char _literal[] = "psi";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T psi;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return psi;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return psi;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::bigint_unsigned, sqlpp::tag::can_be_null>;
|
2016-06-05 21:35:49 +02:00
|
|
|
};
|
2017-08-06 19:54:54 +02:00
|
|
|
struct Book
|
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
|
|
|
static constexpr const char _literal[] = "book";
|
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T book;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return book;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return book;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using _traits = sqlpp::make_traits<sqlpp::blob, sqlpp::tag::can_be_null>;
|
|
|
|
};
|
2018-06-01 09:53:39 +02:00
|
|
|
} // namespace TabFoo_
|
2014-07-20 11:14:44 +02:00
|
|
|
|
2017-08-06 19:54:54 +02:00
|
|
|
struct TabFoo : sqlpp::table_t<TabFoo, TabFoo_::Delta, TabFoo_::Epsilon, TabFoo_::Omega, TabFoo_::Psi, TabFoo_::Book>
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "tab_foo";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabFoo;
|
2015-09-13 21:33:19 +02:00
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return tabFoo;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return tabFoo;
|
|
|
|
}
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
namespace TabBar_
|
|
|
|
{
|
|
|
|
struct Alpha
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "alpha";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T alpha;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return alpha;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return alpha;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2015-09-13 21:33:19 +02: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 11:14:44 +02:00
|
|
|
};
|
|
|
|
struct Beta
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "beta";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T beta;
|
|
|
|
T& operator()()
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return beta;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return beta;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2014-07-23 18:06:33 +02:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::varchar, sqlpp::tag::can_be_null>;
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
|
|
|
struct Gamma
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "gamma";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T gamma;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return gamma;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return gamma;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2014-07-23 18:06:33 +02:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::boolean, sqlpp::tag::require_insert>;
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
|
|
|
struct Delta
|
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "delta";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
2015-09-13 21:33:19 +02:00
|
|
|
{
|
|
|
|
T delta;
|
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
return delta;
|
|
|
|
}
|
|
|
|
};
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2014-07-23 18:06:33 +02:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::integer, sqlpp::tag::can_be_null>;
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
2018-06-01 09:53:39 +02:00
|
|
|
} // namespace TabBar_
|
2014-07-20 11:14:44 +02:00
|
|
|
|
2015-09-13 21:33:19 +02:00
|
|
|
struct TabBar : sqlpp::table_t<TabBar, TabBar_::Alpha, TabBar_::Beta, TabBar_::Gamma, TabBar_::Delta>
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2014-11-30 19:40:34 +01:00
|
|
|
struct _alias_t
|
2014-07-20 11:14:44 +02:00
|
|
|
{
|
2015-09-13 21:33:19 +02:00
|
|
|
static constexpr const char _literal[] = "tab_bar";
|
2014-11-30 19:40:34 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
2015-09-13 21:33:19 +02:00
|
|
|
template <typename T>
|
2014-07-20 11:14:44 +02:00
|
|
|
struct _member_t
|
|
|
|
{
|
|
|
|
T tabBar;
|
2015-09-13 21:33:19 +02:00
|
|
|
T& operator()()
|
|
|
|
{
|
|
|
|
return tabBar;
|
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
|
|
|
return tabBar;
|
|
|
|
}
|
2014-07-20 11:14:44 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-10-28 20:52:43 +01:00
|
|
|
namespace TabDateTime_
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
struct ColDayPoint
|
2015-10-28 20:52:43 +01:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
static constexpr const char _literal[] = "col_day_point";
|
2015-10-28 20:52:43 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
T colDayPoint;
|
2015-10-28 20:52:43 +01:00
|
|
|
T& operator()()
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
return colDayPoint;
|
2015-10-28 20:52:43 +01:00
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
return colDayPoint;
|
2015-10-28 20:52:43 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2015-10-29 16:41:45 +01:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::day_point, sqlpp::tag::can_be_null>;
|
2015-10-28 20:52:43 +01:00
|
|
|
};
|
2015-10-29 16:41:45 +01:00
|
|
|
struct ColTimePoint
|
2015-10-28 20:52:43 +01:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
static constexpr const char _literal[] = "col_time_point";
|
2015-10-28 20:52:43 +01:00
|
|
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
|
|
|
template <typename T>
|
|
|
|
struct _member_t
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
T colTimePoint;
|
2015-10-28 20:52:43 +01:00
|
|
|
T& operator()()
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
return colTimePoint;
|
2015-10-28 20:52:43 +01:00
|
|
|
}
|
|
|
|
const T& operator()() const
|
|
|
|
{
|
2015-10-29 16:41:45 +01:00
|
|
|
return colTimePoint;
|
2015-10-28 20:52:43 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2015-10-29 16:41:45 +01:00
|
|
|
using _traits = sqlpp::make_traits<sqlpp::time_point, sqlpp::tag::can_be_null>;
|
2015-10-28 20:52:43 +01:00
|
|
|
};
|
2016-05-19 08:53:56 -04: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>;
|
|
|
|
};
|
2018-06-01 09:53:39 +02:00
|
|
|
} // namespace TabDateTime_
|
2015-10-28 20:52:43 +01:00
|
|
|
|
2016-06-05 21:35:49 +02:00
|
|
|
struct TabDateTime
|
|
|
|
: sqlpp::table_t<TabDateTime, TabDateTime_::ColDayPoint, TabDateTime_::ColTimePoint, TabDateTime_::ColTimeOfDay>
|
2015-10-28 20:52:43 +01:00
|
|
|
{
|
|
|
|
struct _alias_t
|
|
|
|
{
|
2019-10-05 10:20:15 +02:00
|
|
|
static constexpr const char _literal[] = "tab_date_time";
|
2015-10-28 20:52:43 +01: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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2018-06-01 09:53:39 +02:00
|
|
|
} // namespace test
|
2014-07-20 11:14:44 +02:00
|
|
|
#endif
|