---json { "page_id": "95t055gq46bqxkrthchtz" } --- ====== SQLite Data Type Support ====== ===== About ===== SQLite has a permissive type system. ===== Properties ===== ==== Affinities ==== The type of value is called an [[https://www.sqlite.org/datatype3.html|affinity]] An affinity: * has 6 possible values * text * numeric * integer * real * blob * null * is stored at the cell level (row/column) as seen by the citation below.
The datatype of a value is associated with the value itself, not with its container. [[https://www.sqlite.org/datatype3.html|datatype3]]==== Type declaration ==== In a ''create table'' statement, SQLite preserves the original type name even if an affinity is applied. Therefore, you can use any name for instance ''json'' for a ''text'' ===== Text default ===== Due to the data type affinity system, it's possible to have no data type definition on a column. If this is the case, the data type of the column is empty and we set it to be by default a string (''text''). In this demo, we show you how the data type may be empty with the [[https://www.sqlite.org/pragma.html#pragma_table_info|table_info pragma]]
tabul data cat sqlite/empty_type_demo.sql@howto
tabul data print '(sqlite/empty_type_demo.sql@howto)'@sqlite
* The result, where you can see an empty value in the ''type'' column.