From 6c0d1e2ad8e86cb4c728ae6462b10ef7a06ee5c6 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov
+
@@ -17730,6 +17741,136 @@ class person
19.6 Uuid Library
+
+
+
+
+ 19.6.1 MySQL Database Type Mapping
+ 19.6.2 SQLite Database Type Mapping
+ 19.6.3 PostgreSQL Database Type Mapping
+ 19.6.4 Oracle Database Type Mapping
+ 19.6.5 SQL Server Database Type Mapping posix_time::time_duration
value out of this range will
result in the value_out_of_range
exception.
The uuid
sub-profile provides persistence support for the
+ uuid
type from the Boost uuid
library. To
+ enable only this profile, pass boost/uuid
to the
+ --profile
ODB compiler option.
By default a data member of the uuid
type is mapped to a
+ database column with NULL
enabled and nil uuid
+ instances are stored as NULL
values. However, you can
+ change this behavior by declaring the data member NOT NULL
+ with the not_null
pragma (Section
+ 12.4.6, "null
/not_null
"). In this
+ case, or if the data member is an object id, the implementation
+ will store nil uuid
instances as zero UUID values
+ ({00000000-0000-0000-0000-000000000000}
). For example:
+#pragma db object +class object +{ + ... + + boost::uuids::uuid x_; // Nil values stored as NULL. + + #pragma db not_null + boost::uuids::uuid y_; // Nil values stored as zero. +}; ++ +
The following table summarizes the default mapping between the Boost
+ uuid
type and the MySQL database type.
Boost Type | +MySQL Type | +Default NULL Semantics |
+
---|---|---|
boost::uuids::uuid |
+ BINARY(16) |
+ NULL |
+
The following table summarizes the default mapping between the Boost
+ uuid
type and the SQLite database type.
Boost Type | +SQLite Type | +Default NULL Semantics |
+
---|---|---|
boost::uuids::uuid |
+ BLOB |
+ NULL |
+
The following table summarizes the default mapping between the Boost
+ uuid
type and the PostgreSQL database type.
Boost Type | +PostgreSQL Type | +Default NULL Semantics |
+
---|---|---|
boost::uuids::uuid |
+ UUID |
+ NULL |
+
The following table summarizes the default mapping between the Boost
+ uuid
type and the Oracle database type.
Boost Type | +Oracle Type | +Default NULL Semantics |
+
---|---|---|
boost::uuids::uuid |
+ RAW(16) |
+ NULL |
+
The following table summarizes the default mapping between the Boost
+ uuid
type and the SQL Server database type.
Boost Type | +SQL Server Type | +Default NULL Semantics |
+
---|---|---|
boost::uuids::uuid |
+ UNIQUEIDENTIFIER |
+ NULL |
+