This adds an interrupt() method to Statement that allows apps to
interrupt a running statement. Please note that this is different from
`sqlite3_interrupt()` which interrupts all ongoing operations in a
database. Although we want to support that too, per statement interrupt
is much more useful to apps.
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>
Closes#512
This adds an interrupt() method to Statement that allows apps to
interrupt a running statement. Please note that this is different from
`sqlite3_interrupt()` which interrupts all ongoing operations in a
database. Although we want to support that too, per statement interrupt
is much more useful to apps.
This includes an inner struct in Page wrapped with Unsafe cell to access
it. This is done intentionally because concurrency control of pages is
handled by pages and not by the page itself.
Turns out the new cbindgen version generates slightly different
sqlite3.h so commit that to the tree. The version in Cargo.lock also
changed so let's check in that too.
Add enough stubs to be able to link CPython build against Limbo's SQLite
compatibility API:
```
export LIBSQLITE3_LIBS=../limbo/target/debug/liblimbo_sqlite3.a
./configure
make -j8
[snip]
gcc -shared Modules/_sqlite/blob.o Modules/_sqlite/connection.o Modules/_sqlite/cursor.o Modules/_sqlite/microprotocols.o Modules/_sqlite/module.o Modules/_sqlite/prepare_protocol.o Modules/_sqlite/row.o Modules/_sqlite/statement.o Modules/_sqlite/util.o ../limbo/target/debug/liblimbo_sqlite3.a -o Modules/_sqlite3.cpython-314-x86_64-linux-gnu.so
thread '<unnamed>' panicked at sqlite3/src/lib.rs:751:5:
not yet implemented
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
make: *** [Makefile:1511: checksharedmods] Aborted (core dumped)
```
All that's left is to actually implement all of this...
This adds initial SQLite C ABI compatibility to Limbo to make sure we
drive the Rust API in the right way that allows us to implement SQLite
semantics.