No, this is not the only way. Alternatively, you can also get a single row, iterate over it, and check individual Python column objects and types. If the value is not None (in this case, the SQL field is NULL), this should give you a fairly accurate idea of the type of database column.
sqlite3 uses only sqlite3_column_decltypeand sqlite3_column_typein one place, each, and none of them are available for a Python application, so they are not the "direct" way that you may have been looking for.
source
share