sqlite3/README.md
This directory contains a Rust implementation of the SQLite3 C API. The implementation serves as a compatibility layer between SQLite's C API and Turso's native Rust database implementation.
This implementation provides SQLite3 API compatibility for Turso, allowing existing applications that use SQLite to work with Turso without modification. The code:
We employ a dual-testing approach to ensure complete compatibility with SQLite:
Before running tests, you need to set up a test database:
# Create testing directory
mkdir -p ../../testing
# Create and initialize test database
sqlite3 ../../testing/testing.db ".databases"
This creates an empty SQLite database that both test suites will use.
/tests)To run C tests against official SQLite:
cd tests
make clean
make LIBS="-lsqlite3"
./sqlite3-tests
To run C tests against our implementation:
cd tests
make clean
make LIBS="-L../../target/debug -lturso_sqlite3"
LD_LIBRARY_PATH=../../target/debug ./sqlite3-tests
src/lib.rs)To run Rust tests:
cargo test
Missing Test Database
SQLITE_CANTOPEN (14) in testsWrong Database Path
../../testing/testing.dbPermission Issues
#[no_mangle] and follow SQLite's C API naming conventionunsafe blocks for C API compatibilityWhen adding new features or fixing bugs:
This is an ongoing implementation. Some functions are marked with stub!() macro, indicating they're not yet implemented. Check individual function documentation for implementation status.