Storage classes

Each value stored in a QDB database (or manipulated by the database engine) has one of the following storage classes:

Any column in a database except an INTEGER PRIMARY KEY may be used to store any type of value. The exception to this rule is described under "Other Affinity Modes" as strict affinity mode.

All values supplied to QDB, whether as literals embedded in SQL statements or values bound to precompiled SQL statements are assigned a storage class before the SQL statement is executed. Under the circumstances described below, the database engine may convert values between numeric storage classes (INTEGER and REAL) and TEXT during query execution.

Storage classes are initially assigned as follows:

The storage class of a value that is the result of an SQL scalar operator depends on the outermost operator of the expression.