-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
At present with go-sqlite3, there doesn't seem to be a way of retrieving the data type of a result set per row.
This is a problem when the data in a result set has different types in a column than declared by the table definition.
eg if a table says a column is of type (say) integer, and instead one of the rows has a (say) string, then retrieving the row barfs.
I think it's due to using sqlite3_column_decltype() in the DeclTypes() function, which only returns the table level declared column types.
At present I'm using gwenn's SQLite driver, as that has a per row (of the result set) function to retrieve the appropriate types:
@gwenn's focus these days is on Rust instead of Go, so it's probably a good idea (from my PoV) to see if this can be added in your driver which is much more widely used.
Note, I opened an issue ages ago with some background info for this on @gwenn's repo, if that helps: gwenn/gosqlite#5.
The use case is when working with user generated SQLite databases, for example:
https://dbhub.io/justinclift/DB4S%20download%20stats.sqlite
Thoughts? 😄