Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Aqua Data Studio / nhilam |
Follow
824
|
SQLite uses a general dynamic type system. In SQLite, the datatype of a value is associated with the value itself, not with its container. The dynamic type system of SQLite is backwards compatible with the more common static type systems of other database engines in the sense that SQL statement that work on statically typed databases should work the same way in SQLite. However, the dynamic typing in SQLite allows it to do things which are not possible in traditional rigidly typed databases.
Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes:
NULL. The value is a NULL value.
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.
REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.
TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).
BLOB. The value is a blob of data, stored exactly as it was input.
In order to maximize compatibility between SQLite and other database engines, SQLite supports the concept of "type affinity" on columns. The type affinity of a column is the recommended type for data stored in that column. The important idea here is that the type is recommended, not required. Any column can still store any type of data. It is just that some columns, given the choice, will prefer to use one storage class over another. The preferred storage class for a column is called its "affinity".
Each column in an SQLite 3 database is assigned one of the following type affinities:
The affinity of a column is determined by the declared type of the column, according to the following rules in the order shown:
If the declared type contains the string "INT" then it is assigned INTEGER affinity.
If the declared type of the column contains any of the strings "CHAR", "CLOB", or "TEXT" then that column has TEXT affinity. Notice that the type VARCHAR contains the string "CHAR" and is thus assigned TEXT affinity.
If the declared type for a column contains the string "BLOB" or if no type is specified then the column has affinity NONE.
If the declared type for a column contains any of the strings "REAL", "FLOA", or "DOUB" then the column has REAL affinity.
Otherwise, the affinity is NUMERIC.
The table describes the SQLite datatypes and resulting affinity
Data Type Name | Resulting Affinity |
Rule used to determine Affinity |
Length (Range) |
Precision (Range) |
Scale (Range) |
Description |
NUMERIC DATA TYPES | ||||||
INT | INTEGER | 1 | X | X | X | |
INTEGER | INTEGER | 1 | X | X | X | |
TINYINT | INTEGER | 1 | X | X | X | |
SMALLINT | INTEGER | 1 | X | X | X | |
MEDIUMINT | INTEGER | 1 | X | X | X | |
BIGINT | INTEGER | 1 | X | X | X | |
UNSIGNED BIG INT | INTEGER | 1 | X | X | X | |
INT2 | INTEGER | 1 | X | X | X | |
INT8 | INTEGER | 1 | X | X | X | |
DECIMAL | NUMERIC | 5 | 10 | 5 | X | |
NUMERIC | NUMERIC | 5 | X | X | X | |
REAL | REAL | 4 | X | X | X | |
FLOAT | REAL | 4 | X | X | X | |
DOUBLE | REAL | 4 | X | X | X | |
DOUBLE PRECISION | REAL | 4 | X | X | X | |
BOOLEAN | NUMERIC | 5 | X | X | X | |
CHARACTER DATA TYPES | ||||||
CHARACTER | TEXT | 2 | X | X | X | |
VARCHAR | TEXT | 2 | X | X | X | |
VARYING CHARACTER | TEXT | 2 | X | X | X | |
NCHAR | TEXT | 2 | X | X | X | |
NVARCHAR | TEXT | 2 | X | X | X | |
TEXT | TEXT | 2 | X | X | X | |
CLOB | TEXT | 2 | X | X | X | |
DATE & TIME DATA TYPES | ||||||
DATE | NUMERIC | 5 | X | X | X | |
DATETIME | NUMERIC | 5 | X | X | X | |
NO DATATYPE SPECIFIED | ||||||
BLOB | NONE | 3 |
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017