#pragma once // generated by ./scripts/ddl2cpp -with-table-creation-helper tests/core/usage/sample.sql tests/core/usage/Sample test #include #include #include namespace test { template void createTabFoo(Db& db) { db.execute(R"+++(DROP TABLE IF EXISTS tab_foo)+++"); db.execute(R"+++(CREATE TABLE tab_foo ( id bigint AUTO_INCREMENT PRIMARY KEY, text_nn_d varchar(255) NOT NULL DEFAULT "", int_n bigint, double_n double, u_int_n bigint UNSIGNED, blob_n BLOB ))+++"); } namespace TabFoo_ { struct Id { struct _alias_t { static constexpr const char _literal[] = "id"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T id; T& operator()() { return id; } const T& operator()() const { return id; } }; }; using _traits = sqlpp::make_traits; }; struct TextNnD { struct _alias_t { static constexpr const char _literal[] = "text_nn_d"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T textNnD; T& operator()() { return textNnD; } const T& operator()() const { return textNnD; } }; }; using _traits = sqlpp::make_traits; }; struct IntN { struct _alias_t { static constexpr const char _literal[] = "int_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T intN; T& operator()() { return intN; } const T& operator()() const { return intN; } }; }; using _traits = sqlpp::make_traits; }; struct DoubleN { struct _alias_t { static constexpr const char _literal[] = "double_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T doubleN; T& operator()() { return doubleN; } const T& operator()() const { return doubleN; } }; }; using _traits = sqlpp::make_traits; }; struct UIntN { struct _alias_t { static constexpr const char _literal[] = "u_int_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T uIntN; T& operator()() { return uIntN; } const T& operator()() const { return uIntN; } }; }; using _traits = sqlpp::make_traits; }; struct BlobN { struct _alias_t { static constexpr const char _literal[] = "blob_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T blobN; T& operator()() { return blobN; } const T& operator()() const { return blobN; } }; }; using _traits = sqlpp::make_traits; }; } // namespace TabFoo_ struct TabFoo: sqlpp::table_t { struct _alias_t { static constexpr const char _literal[] = "tab_foo"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T tabFoo; T& operator()() { return tabFoo; } const T& operator()() const { return tabFoo; } }; }; }; template void createTabBar(Db& db) { db.execute(R"+++(DROP TABLE IF EXISTS tab_bar)+++"); db.execute(R"+++(CREATE TABLE tab_bar ( id bigint AUTO_INCREMENT PRIMARY KEY, text_n varchar(255) NULL DEFAULT "", bool_nn bool NOT NULL, int_n int ))+++"); } namespace TabBar_ { struct Id { struct _alias_t { static constexpr const char _literal[] = "id"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T id; T& operator()() { return id; } const T& operator()() const { return id; } }; }; using _traits = sqlpp::make_traits; }; struct TextN { struct _alias_t { static constexpr const char _literal[] = "text_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T textN; T& operator()() { return textN; } const T& operator()() const { return textN; } }; }; using _traits = sqlpp::make_traits; }; struct BoolNn { struct _alias_t { static constexpr const char _literal[] = "bool_nn"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T boolNn; T& operator()() { return boolNn; } const T& operator()() const { return boolNn; } }; }; using _traits = sqlpp::make_traits; }; struct IntN { struct _alias_t { static constexpr const char _literal[] = "int_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T intN; T& operator()() { return intN; } const T& operator()() const { return intN; } }; }; using _traits = sqlpp::make_traits; }; } // namespace TabBar_ struct TabBar: sqlpp::table_t { struct _alias_t { static constexpr const char _literal[] = "tab_bar"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T tabBar; T& operator()() { return tabBar; } const T& operator()() const { return tabBar; } }; }; }; template void createTabDateTime(Db& db) { db.execute(R"+++(DROP TABLE IF EXISTS tab_date_time)+++"); db.execute(R"+++(CREATE TABLE tab_date_time ( id bigint AUTO_INCREMENT PRIMARY KEY, day_point_n date, time_point_n datetime, time_of_day_n time ))+++"); } namespace TabDateTime_ { struct Id { struct _alias_t { static constexpr const char _literal[] = "id"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T id; T& operator()() { return id; } const T& operator()() const { return id; } }; }; using _traits = sqlpp::make_traits; }; struct DayPointN { struct _alias_t { static constexpr const char _literal[] = "day_point_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T dayPointN; T& operator()() { return dayPointN; } const T& operator()() const { return dayPointN; } }; }; using _traits = sqlpp::make_traits; }; struct TimePointN { struct _alias_t { static constexpr const char _literal[] = "time_point_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T timePointN; T& operator()() { return timePointN; } const T& operator()() const { return timePointN; } }; }; using _traits = sqlpp::make_traits; }; struct TimeOfDayN { struct _alias_t { static constexpr const char _literal[] = "time_of_day_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T timeOfDayN; T& operator()() { return timeOfDayN; } const T& operator()() const { return timeOfDayN; } }; }; using _traits = sqlpp::make_traits; }; } // namespace TabDateTime_ struct TabDateTime: sqlpp::table_t { struct _alias_t { static constexpr const char _literal[] = "tab_date_time"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T tabDateTime; T& operator()() { return tabDateTime; } const T& operator()() const { return tabDateTime; } }; }; }; } // namespace test