This should be an easy question I figure, but I hadn't found this answered else where surprisingly, so I'm posting it here.
I've inherited a Sqlite driven database which contains boolean columns in it, declared like this:
CREATE TABLE example (
ex_col BOOLEAN NOT NULL DEFAULT 0,
);
This table is trying to be accessed via the sqlite3 C API calls sqlite_column_*
functions, now given that sqlite doesn't actually support boolean types, what is the expected behavior here?
It appears sqlite_column_int()
always return 0 or false, I assume this is because all columns in sqlite are really text columns...
And what is the proper way to maintain this - fetching as text and then string compare to true? I really don't want to modify the database and all of the other code attached to it.