diff --git a/scripts/ddl2cpp b/scripts/ddl2cpp index f4762a83..b7f7f84b 100755 --- a/scripts/ddl2cpp +++ b/scripts/ddl2cpp @@ -273,6 +273,7 @@ types = { 'numeric': 'floating_point', # PostgreSQL 'date': 'day_point', 'datetime': 'time_point', + 'time': 'time_of_day', 'time without time zone': 'time_point', # PostgreSQL 'time with time zone': 'time_point', # PostgreSQL 'timestamp': 'time_point', diff --git a/tests/Sample.h b/tests/Sample.h index cbb738fa..d0119149 100644 --- a/tests/Sample.h +++ b/tests/Sample.h @@ -256,7 +256,6 @@ namespace test }; }; }; - namespace TabDateTime_ { struct ColDayPoint @@ -303,7 +302,6 @@ namespace test }; using _traits = sqlpp::make_traits; }; - struct ColTimeOfDay { struct _alias_t @@ -333,7 +331,7 @@ namespace test { struct _alias_t { - static constexpr const char _literal[] = "tab_time_point"; + static constexpr const char _literal[] = "tab_date_time"; using _name_t = sqlpp::make_char_sequence; template struct _member_t diff --git a/tests/sample.sql b/tests/sample.sql index f46f7dd7..5cdacab2 100644 --- a/tests/sample.sql +++ b/tests/sample.sql @@ -26,10 +26,11 @@ CREATE TABLE IF NOT EXISTS tab_foo ( - delta varchar(255), + delta varchar(255) NOT NULL DEFAULT "", epsilon bigint, omega double, - psi bigint UNSIGNED + psi bigint UNSIGNED, + book BLOB ); CREATE TABLE tab_bar @@ -40,3 +41,10 @@ CREATE TABLE tab_bar delta int ); +CREATE TABLE tab_date_time +( + col_day_point date, + col_time_point datetime, + col_time_of_day time +); +