Skip to main content

Module sqlite

Module sqlite 

Source
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 uses block_in_place + Handle::block_on so that the current thread can block without parking the entire executor.
  • Otherwise it spins up a fresh single-threaded Runtime for the call.

§Limbo 0.0.22 caveats

  • ROLLBACK: not implemented by Limbo; SqliteTransaction::rollback() returns an error. This file does not call rollback()commit() is the only transaction completion path used here.
  • Affected-row count: retrieved via SELECT changes() internally by oxisql-sqlite-compat, adding one round-trip per DML.

Structs§

SQLiteConnection
SQLite connection wrapper backed by oxisql-sqlite-compat (Pure Rust / Limbo).