From 8e27cd1598a7faff94713498828c0d8f583da8bf Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 5 Apr 2011 01:45:11 -0400 Subject: Add SQLite section to Boost profile docs --- doc/manual.xhtml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/doc/manual.xhtml b/doc/manual.xhtml index caee645..f2d9204 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -513,6 +513,7 @@ for consistency. 13.3Date Time Library +
13.3.1MySQL Database Type Mapping
13.3.2SQLite Database Type Mapping
@@ -7793,13 +7794,86 @@ class employee

Some valid Boost date-time values cannot be stored in a MySQL database. - Attempting to persist any Boost date-time special value other than + An attempt to persist any Boost date-time special value other than date_time::not_a_date_time will result in the - special_value exception. Attempting to persist a Boost + special_value exception. An attempt to persist a Boost date-time value that is out of the MySQL type range will result in the out_of_range exception. Refer to the MySQL documentation for more information on the MySQL data type ranges.

+

13.3.2 SQLite Database Type Mapping

+ +

The following table summarizes the default mapping between the currently + supported Boost date_time types and the SQLite database + types.

+ + + + + + + + + + + + + + + + + + + + + + +
Boost date_time typeSQLite type
gregorian::dateTEXT
posix_time::ptimeTEXT
posix_time::time_durationTEXT
+ +

The Boost special value date_time::not_a_date_time is stored + as a NULL value in an SQLite database.

+ +

The date-time sub-profile implementation also provides + support for mapping gregorian::date and + posix_time::ptime to the INTEGER SQLite type, + with the integer value representing the UNIX time. Similarly, an + alternative mapping for posix_time::time_duration to the + INTEGER type represents the duration as a number of + seconds. These mappings have to be explicitly requested using the + db type pragma (Section 9.3.3, + "type"), as shown in the following example:

+ +
+#pragma db object
+class employee
+{
+  ...
+  #pragma db type("INTEGER")
+  boost::gregorian::date born_;
+};
+
+ + + +

Some valid Boost date-time values cannot be stored in an SQLite database. + An attempt to persist any Boost date-time special value other than + date_time::not_a_date_time will result in the + special_value exception. An attempt to persist a negative + posix_time::time_duration value as SQLite TEXT + will result in the out_of_range exception.

+ -- cgit v1.1