I'm trying to reimplement a subset of SQLx's compile-time query type validation on top of rusqlite. The types were fairly easy as I could use the Statement::columns method, but AFAIK there's currently no way to get the nullability of columns.
It would be possible to do this with the raw ffi api through the sqlite3_column_origin_name and sqlite_column_origin_table calls combined with a pragma_table_info, as mentioned in #494 (comment), but there's no way to get a *mut sqlite3_stmt from a Statement on the main branch.
Would you be open for a PR that adds the two methods to Statement?:
fn column_origin_table(&self, col: usize) -> Option<String>
fn column_origin_name(&self, col: usize) -> Option<String>
(Or alternatively, a handle() method to Statement would also work)
I'm trying to reimplement a subset of SQLx's compile-time query type validation on top of rusqlite. The types were fairly easy as I could use the
Statement::columnsmethod, but AFAIK there's currently no way to get the nullability of columns.It would be possible to do this with the raw ffi api through the
sqlite3_column_origin_nameandsqlite_column_origin_tablecalls combined with a pragma_table_info, as mentioned in #494 (comment), but there's no way to get a*mut sqlite3_stmtfrom aStatementon the main branch.Would you be open for a PR that adds the two methods to Statement?:
(Or alternatively, a
handle()method toStatementwould also work)