PSOrvia Base
An embedded SQL database in Rust. One file, no server, crash-safe.
Your program opens a single file and runs standard SQL against it. Base keeps the data safe through crashes and power loss, lets several processes share a file, and comes with an importer for SQLite files. Programs that use SQLite today run with Base without changes. The core uses only the Rust standard library and the code is open source under the Apache-2.0 license.
Status
Pre-release. The file format 1.0 is frozen, but there is no released version yet, and interfaces may change until 1.0. All numbers on these pages are preliminary.
What it is
-
One file
The whole database is a single file. Copy it to back it up. No server, no configuration, no write-ahead log next to it.
-
Crash-safe
Copy-on-write trees and checksummed pages. Tested at every write and sync point of long workloads under simulated power loss, reordered writes and bit flips.
-
Several processes
Readers never wait. One writer works at a time, across processes, on the same file.
-
SQL that behaves
A sqlite mode reproduces SQLite's behaviour and is checked against the reference; a strict standard mode is for new programs.
-
Full-text search
fts5-compatible full-text search: unicode61, porter, ascii and trigram tokenizers, rank/bm25, highlight and snippet, from SQL.
-
Small and open
No third-party code in the library, an open and frozen file format, Apache-2.0.
Quick start
Build once, then use it from Rust, C, C++, Python, Go, PHP, JavaScript, C#, Java, Ruby or Dart. The guides show small programs for each language.
Command line
tools/setup.sh
cargo build --release
target/release/psob --create sql notes.db "CREATE TABLE notes(id INTEGER PRIMARY KEY, title TEXT)"
target/release/psob sql notes.db "INSERT INTO notes(title) VALUES ('first')"
target/release/psob sql notes.db "SELECT * FROM notes"
Where to go next
-
Documentation
-
Examples
-
Comparison with SQLite
-
Languages
Independent implementation
PSOrvia Base is written from specifications, standards and papers. No code from other database projects was copied.
The source code repository will be linked here at release.