diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-07-23 14:42:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-07-23 14:42:52 +0200 |
commit | 30d797ffff4a8e2492500aea2135567f91b15aa0 (patch) | |
tree | 53fa570844ab3876026ec6621b40c74547e1db24 /odb/mysql/context.hxx | |
parent | cea6fb57ac8c9a893c0f404fef6c1469f0b6222b (diff) |
Add generation of the image class definition
Diffstat (limited to 'odb/mysql/context.hxx')
-rw-r--r-- | odb/mysql/context.hxx | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/odb/mysql/context.hxx b/odb/mysql/context.hxx index 7c075b2..bf01719 100644 --- a/odb/mysql/context.hxx +++ b/odb/mysql/context.hxx @@ -14,12 +14,64 @@ namespace mysql { struct sql_type { - sql_type () : unsign (false), bounds (false) {} + // Keep the order in each block of types. + // + enum core_type + { + // Integral types. + // + TINYINT, + SMALLINT, + MEDIUMINT, + INT, + BIGINT, + + // Float types. + // + FLOAT, + DOUBLE, + DECIMAL, + + // Data-time types. + // + DATE, + TIME, + DATETIME, + TIMESTAMP, + YEAR, + + // String and binary types. + // + CHAR, + BINARY, + VARCHAR, + VARBINARY, + TINYBLOB, + TINYTEXT, + BLOB, + TEXT, + MEDIUMBLOB, + MEDIUMTEXT, + LONGBLOB, + LONGTEXT, + + // Other types. + // + BIT, + ENUM, + SET, + + // Invalid type. + // + invalid + }; + + sql_type () : type (invalid), unsign (false), range (false) {} - std::string type; + core_type type; bool unsign; - bool bounds; - unsigned int bounds_value; // MySQL max value is 2^32 - 1 (LONGBLOG/TEXT). + bool range; + unsigned int range_value; // MySQL max value is 2^32 - 1 (LONGBLOG/TEXT). }; class context: public ::context |