Overview
Stoolap is an embedded SQL database with MVCC transactions, written entirely in Rust. It supports both in-memory and persistent storage modes with full ACID compliance.
Installation
# Add to Cargo.toml [dependencies] stoolap = " 0.1 "
Or build from source:
git clone https://github.com/stoolap/stoolap.git cd stoolap cargo build --release
Quick Start
As a Library
use stoolap :: Database ; fn main ( ) -> Result < ( ) , Box < dyn std :: error :: Error > > { let db = Database :: open_in_memory ( ) ? ; db . execute ( "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)" , ( ) ) ? ; db . execute ( "INSERT INTO users VALUES (1, 'Alice')" , ( ) ) ? ; for row in db . query ( "SELECT * FROM users" , ( ) ) ? { let row = row? ; println ! ( "{}: {}" , row . get :: < i64 > ( 0 ) ? , row . get :: < String > ( 1 ) ? ) ; } Ok ( ( ) ) }
Command Line
... continue reading