I am working on an iOS application that uses a SQLite database.
In the next release of my product, i would like to migrate a table column from TEXT to BLOB.
I plan to do a DROP TABLE followed by a CREATE TABLE (we can afford to lose the data, it is not an issue here)
My problem is : how can I check simply from Objective-C if a table’s column type is TEXT or BLOB ?
SQLite is “typeless”. This means that you can store any kind of data you want in any column of any table, regardless of the declared data type of that column. You can find more info here.
But, if you want to get the info about the declared data type of a column, you can do that by using the pragma table_info(table_name).
eg.
Then , you can iterate through the returned resultset and check for the data type you want to check.