From c1877f84f3596f67245abe6658b08c050bd1e686 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Sep 2012 11:22:07 +0200 Subject: NULL handling improvements Add support for specifying NULL-ness for types with built-in mapping. Handle Oracle [N]VARCHAR2 and SQLite FLOAT oddities using this mechanism instead of overriding it at the schema generation level. Also use the is_null argument that is passed to value_traits::init_image() to indicate whether the value can be NULL. --- doc/manual.xhtml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/manual.xhtml b/doc/manual.xhtml index ab0ab65..a1e0360 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -13878,13 +13878,13 @@ class object float REAL - NOT NULL + NULL double REAL - NOT NULL + NULL @@ -13894,6 +13894,14 @@ class object +

SQLite represents NaN FLOAT values + as NULL values. As a result, columns of the + float and double types are by default + declared as NULL. However, you can override this by + explicitly declaring them as NOT NULL with the + db not_null pragma (Section + 12.4.6, "null/not_null").

+

The SQLite ODB runtime library also provides support for mapping the std::vector<char>, std::vector<unsigned char>, @@ -15344,13 +15352,13 @@ class object

In Oracle empty VARCHAR2 and NVARCHAR2 strings are represented as NULL values. As a result, - in the generated schema, columns of these types are declared as - NULL even if explicitly declared as - NOT NULL with the db not_null pragma - (Section 12.4.6, "null/not_null"), - except for primary key columns. This also means that for object ids - that are mapped to these Oracle types, an empty string is an invalid - value.

+ columns of the std::string type are by default declared + as NULL except for primary key columns. However, you + can override this by explicitly declaring them as NOT NULL + with the db not_null pragma (Section + 12.4.6, "null/not_null"). This also means that for + object ids that are mapped to these Oracle types, an empty string is + an invalid value.

The Oracle ODB runtime library also provides support for mapping the std::string type to the Oracle CHAR, -- cgit v1.1