Expand description
SQLite database implementation — Pure Rust via oxisql-sqlite-compat (Limbo engine).
§Architecture: sync/async bridge
The DatabaseConnection trait used in scirs2-io is synchronous, while
oxisql-sqlite-compat (and the underlying Limbo engine) is fully async (tokio).
The bridge function run_sync resolves this impedance mismatch:
- If a tokio runtime is already active (
Handle::try_current()succeeds) it usesblock_in_place+Handle::block_onso that the current thread can block without parking the entire executor. - Otherwise it spins up a fresh single-threaded
Runtimefor the call.
§Limbo 0.0.22 caveats
- ROLLBACK: not implemented by Limbo;
SqliteTransaction::rollback()returns an error. This file does not callrollback()—commit()is the only transaction completion path used here. - Affected-row count: retrieved via
SELECT changes()internally byoxisql-sqlite-compat, adding one round-trip per DML.
Structs§
- SQLite
Connection - SQLite connection wrapper backed by
oxisql-sqlite-compat(Pure Rust / Limbo).