From 7658d9946cca973cf5f4e875b5386afa6e0821b9 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov TEXT
.
The MySQL ODB runtime library also provides support for mapping the
- std::vector<char>
,
+ std::string
type to the MySQL CHAR
,
+ NCHAR
, and NVARCHAR
types, as well as for
+ mapping the std::vector<char>
,
std::vector<unsigned char>
,
char[N]
, and unsigned char[N]
types
- to the MySQL BLOB types. However, this mapping is not enabled by
+ to the MySQL BLOB types. However, these mappings are not enabled by
default (in particular, by default, std::vector
will
- be treated as a container). To enable the BLOB mapping for these
+ be treated as a container). To enable the alternative mapping for these
types we need to specify the database type explicitly using the
db type
pragma (Section
12.4.3, "type
"), for example:
The PostgreSQL ODB runtime library also provides support for mapping the +
The PostgreSQL ODB runtime library also provides support for mapping
+ the std::string
type to the PostgreSQL CHAR
+ and VARCHAR
types, as well as for mapping the
std::vector<char>
,
std::vector<unsigned char>
,
char[N]
, and unsigned char[N]
types to
- the PostgreSQL BYTEA
type. However, this mapping is not
+ the PostgreSQL BYTEA
type. However, these mappings are not
enabled by default (in particular, by default, std::vector
- will be treated as a container). To enable the BYTEA
- mapping for these types we need to specify the database type explicitly
+ will be treated as a container). To enable the alternative mappings for
+ these types we need to specify the database type explicitly
using the db type
pragma (Section
12.4.3, "type
"), for example:
BLOB
and RAW
types. However, these
mappings are not enabled by default (in particular, by default,
std::vector
will be treated as a container). To enable the
- these alternative mappings for these types we need to specify the
+ alternative mappings for these types we need to specify the
database type explicitly using the db type
pragma
(Section 12.4.3, "type
"), for
example:
@@ -13740,6 +13750,25 @@ class Person
to the VARCHAR(255)
MySQL type. Otherwise,
it is mapped to TEXT
.
+ The basic
sub-profile also provides support
+ for mapping QString
to the CHAR
,
+ NCHAR
, and NVARCHAR
MySQL types.
+ However, these altenative mappings have to be explicitly
+ requested using the db type
pragma
+ (Section 12.4.3, "type"), as show in
+ the following example:
+#pragma db object +class Person +{ + ... + + #pragma db type("CHAR(2)") not_null + QString licenseState_; +}; ++
isNull()
member
function returns true
.
+ The basic
sub-profile also provides support
+ for mapping QString
to the CHAR
,
+ and VARCHAR
PostgreSQL types.
+ However, these altenative mappings have to be explicitly
+ requested using the db type
pragma
+ (Section 12.4.3, "type"), as show in
+ the following example:
+#pragma db object +class Person +{ + ... + + #pragma db type("CHAR(2)") not_null + QString licenseState_; +}; ++
The following table summarizes the default mapping between the currently -- cgit v1.1