I know that importing from CSV into SQLite treats all fields as text. According to How to import csv file to sqlite with correct data types, one can use
UPDATE MyTable SET MyColumn = CAST(MyColumn AS INTEGER)
to update whole colum type. That seems to work, however that doesn't seem to be reflected in the output of
TYPEOF() nor in
sqlite> CREATE TABLE testtb (a TEXT, b TEXT); sqlite> INSERT INTO testtb VALUES ('1', '2'); sqlite> UPDATE testtb SET b = CAST(b AS INTEGER); sqlite> SELECT TYPEOF(b) FROM testtb; text sqlite> PRAGMA table_info(testtb); 0|a|TEXT|0||0 1|b|TEXT|0||0
So how can I make the changes actually show up when querying table's meta information (I'm lacking a proper phrasing here, but hopefully this makes sense) ?