From f01bc7a5db83aebb91853ba0669a9eaf9598a8e3 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov VARCHAR(255) NOT NULL
MySQL type. Otherwise,
it is mapped to TEXT NOT NULL
.
Additionally, by default, C++ enumerations are automatically
+ mapped to a suitable MySQL type. Contiguous enumerations with
+ the zero first enumerator are mapped to the MySQL ENUM NOT
+ NULL
type. All other enumerations are mapped to INT
+ NOT NULL
or INT UNSIGNED NOT NULL
. For example:
+enum color {red, green, blue}; +enum taste +{ + bitter = 1, // Non-zero first enumerator. + sweet, + sour = 4, // Non-contiguous. + salty +}; + +#pragma object +class object +{ + ... + + color color_; // Mapped to ENUM ('red', 'green', 'blue') NOT NULL. + taste taste_; // Mapped to INT UNSIGNED NOT NULL. +}; ++
The MySQL database
class has the following
@@ -7082,7 +7108,10 @@ namespace odb
-
Note that SQLite only operates with signed integers and the largest +
Additionally, by default, C++ enumerations are automatically mapped to
+ the SQLite INTEGER NOT NULL
type.
Note also that SQLite only operates with signed integers and the largest
value that an SQLite database can store is a signed 64-bit integer. As
a result, greater unsigned long long
values will be
represented in the database as negative values.