0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Adjust sample.sql and ddl2cpp to match Sample.h

This commit is contained in:
rbock 2019-10-05 10:20:15 +02:00
parent 5b2b175b21
commit 268c176d8a
3 changed files with 12 additions and 5 deletions

View File

@ -273,6 +273,7 @@ types = {
'numeric': 'floating_point', # PostgreSQL 'numeric': 'floating_point', # PostgreSQL
'date': 'day_point', 'date': 'day_point',
'datetime': 'time_point', 'datetime': 'time_point',
'time': 'time_of_day',
'time without time zone': 'time_point', # PostgreSQL 'time without time zone': 'time_point', # PostgreSQL
'time with time zone': 'time_point', # PostgreSQL 'time with time zone': 'time_point', # PostgreSQL
'timestamp': 'time_point', 'timestamp': 'time_point',

View File

@ -256,7 +256,6 @@ namespace test
}; };
}; };
}; };
namespace TabDateTime_ namespace TabDateTime_
{ {
struct ColDayPoint struct ColDayPoint
@ -303,7 +302,6 @@ namespace test
}; };
using _traits = sqlpp::make_traits<sqlpp::time_point, sqlpp::tag::can_be_null>; using _traits = sqlpp::make_traits<sqlpp::time_point, sqlpp::tag::can_be_null>;
}; };
struct ColTimeOfDay struct ColTimeOfDay
{ {
struct _alias_t struct _alias_t
@ -333,7 +331,7 @@ namespace test
{ {
struct _alias_t 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<sizeof(_literal), _literal>; using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
template <typename T> template <typename T>
struct _member_t struct _member_t

View File

@ -26,10 +26,11 @@
CREATE TABLE IF NOT EXISTS tab_foo CREATE TABLE IF NOT EXISTS tab_foo
( (
delta varchar(255), delta varchar(255) NOT NULL DEFAULT "",
epsilon bigint, epsilon bigint,
omega double, omega double,
psi bigint UNSIGNED psi bigint UNSIGNED,
book BLOB
); );
CREATE TABLE tab_bar CREATE TABLE tab_bar
@ -40,3 +41,10 @@ CREATE TABLE tab_bar
delta int delta int
); );
CREATE TABLE tab_date_time
(
col_day_point date,
col_time_point datetime,
col_time_of_day time
);