#pragma once // generated by ./scripts/ddl2cpp -auto-id -with-table-creation-helper tests/mysql/usage/Tables.sql tests/mysql/usage/Tables test #include #include #include namespace test { template void createTabSample(Db& db) { db.execute(R"+++(DROP TABLE IF EXISTS tab_sample)+++"); db.execute(R"+++(CREATE TABLE tab_sample ( id bigint(20) AUTO_INCREMENT PRIMARY KEY, int_n bigint(20) DEFAULT NULL, text_n varchar(255) DEFAULT NULL, bool_n bool DEFAULT NULL ))+++"); } namespace TabSample_ { 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 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 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 BoolN { struct _alias_t { static constexpr const char _literal[] = "bool_n"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T boolN; T& operator()() { return boolN; } const T& operator()() const { return boolN; } }; }; using _traits = sqlpp::make_traits; }; } // namespace TabSample_ struct TabSample: sqlpp::table_t { struct _alias_t { static constexpr const char _literal[] = "tab_sample"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T tabSample; T& operator()() { return tabSample; } const T& operator()() const { return tabSample; } }; }; }; 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(20) AUTO_INCREMENT PRIMARY KEY, day_point_n date, time_point_n datetime(3), date_time_point_n_d datetime DEFAULT CURRENT_TIMESTAMP, time_of_day_n time(3) ))+++"); } 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 DateTimePointND { struct _alias_t { static constexpr const char _literal[] = "date_time_point_n_d"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T dateTimePointND; T& operator()() { return dateTimePointND; } const T& operator()() const { return dateTimePointND; } }; }; 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; } }; }; }; template void createTabFoo(Db& db) { db.execute(R"+++(DROP TABLE IF EXISTS tab_foo)+++"); db.execute(R"+++(CREATE TABLE tab_foo ( id bigint(20) AUTO_INCREMENT PRIMARY KEY, int_n bigint(20) DEFAULT NULL ))+++"); } 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 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 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 createTabJson(Db& db) { db.execute(R"+++(DROP TABLE IF EXISTS tab_json)+++"); db.execute(R"+++(CREATE TABLE tab_json ( id bigint(20) AUTO_INCREMENT PRIMARY KEY, data JSON NOT NULL ))+++"); } namespace TabJson_ { 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 Data { struct _alias_t { static constexpr const char _literal[] = "data"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T data; T& operator()() { return data; } const T& operator()() const { return data; } }; }; using _traits = sqlpp::make_traits; }; } // namespace TabJson_ struct TabJson: sqlpp::table_t { struct _alias_t { static constexpr const char _literal[] = "tab_json"; using _name_t = sqlpp::make_char_sequence; template struct _member_t { T tabJson; T& operator()() { return tabJson; } const T& operator()() const { return tabJson; } }; }; }; } // namespace test