SQLite C API improvements
The SQLite C API in the limbo_sqlite3 crate is very basic. Let's improve it to cover enough to run some basic applications.
I'd like to take on this task, but just to clarify, what would be considered not basic?
@misterclayt0n, nice! I think things like backup API, user defined functions, and things like that are probably best tackled later. What we need is basics like sqlite3_prepare(), sqlite_bind_*(), sqlite_column_*(), and others like that to get most apps going.
Add sqlite3_bind_int64 implementation
Hello, @penberg!
I've just implemented sqlite3_bind_int64. The approach I took was:
- I introduced a
HashMapinsideStatementinstead of storing Value<'a> directly. - The HashMap stores
OwnedValuefor each parameter (index → value) so we don't run into lifetime issues.
I'd like to confirm if this HashMap + OwnedValue approach for parameter binding aligns with your vision—this seemed logical to avoid 'a complexity and to store parameter values persistently. What do you think?
I quickly looked into this, and, to have a fully functional Java JDBC driver based on the SQLite3 C compatibility layer there are a few missing APIs:
- [x] sqlite3_changes64
- [x] sqlite3_column_table_name
- [x] sqlite3_table_column_metadata
- [ ] sqlite3_result_int
- [ ] sqlite3_value_int
- [ ] sqlite3_busy_handler
- [ ] sqlite3_update_hook
- [ ] sqlite3_commit_hook
- [ ] sqlite3_rollback_hook
Seems like the sqlite3 subfolder went a little outdated, and I couldn't find automatic tests in CI. The next step would be to figure out how to handle the callbacks, is there any example I can refer to?