typeof()
A SQLite function that returns the storage class of a value: integer, real, text, blob or null.
In more detail
It is the quickest way to see what SQLite actually stored, which can differ from the column's declared type in a table that is not STRICT. Asking for the type of an empty cell returns null, which is a storage class of its own.
Example
SELECT n, typeof(n) FROM loose;Related terms
- storage class — In SQLite, the actual kind of a stored value: NULL, INTEGER, REAL, TEXT or BLOB.
- type affinity — SQLite's rule that a column's declared type is only a preference: values are converted when sensible and otherwise stored as they are.
Taught in
- Data Types And What To Choose — PostgreSQL, Indexing & Relational Data Modeling