Chapter 17. Database file format

Table of Contents

17.1. SQL data types
17.2. SQL table usage
17.3. SQL table names
17.4. SQL NULL entries
17.5. Storage of container objects

The following discussion assumes you know SQL database concepts. If you do not, please consult a source such as wikipedia.org before reading this section.

17.1. SQL data types

Integers, floating point values, strings, std::tm objects, and binary data (also known as blobs) are treated by the library as "native SQL types", meaning that each type corresponds to a specific SQL type in any column of a database table. For example, integers (char, short, int, long, long long and the unsigned variants) are all mapped to the SQL INTEGER type. Similarly, floating point values are mapped to the SQL REAL type, strings are mapped to the SQL TEXT type, std::tm objects are mapped to the SQL DATETIME type, and blobs are mapped to the SQL BINARY/BLOB type. All other object types are handled as "non native SQL types" and result in separate tables being created to store each different object type.

See the "Serializing binary data" section for a list of what the library considers to be a blob "out of the box". As well, clients can also define their own blob types - see the section "Serializing binary data" below for information on how to do this.