Repository navigation
Releases
Releases · DakshSingh-GitHub/TinyDB
TinyDB v0.1.0
TinyDB is a standalone, embedded, transactional SQL database engine written from scratch in C++23 with zero external runtime dependencies.
Highlights
-
Standalone CLI & Interactive REPL (
tinydb)- Dynamic prompt showing the active database and transaction state:
tinydb (<db>) >/tinydb (<db>)* > - Raw-TTY multi-line SQL editor with cross-line Backspace, arrow-key navigation,
Ctrl+A/Ctrl+E,Ctrl+C, andCtrl+D - Automatic cleanup of newly opened empty databases (
.db+.wal) on exit or/connect - Unified
.help//help(/?) command menu, Unicode box-drawn tables, andtable/csv/jsonoutput formatting - Non-interactive
--exec "<sql>"mode and piped.sqlscript execution
- Dynamic prompt showing the active database and transaction state:
-
REPL Commands
- Dot-commands:
.tables,.schema [table],.checkpoint,.stats,.help,.exit/.quit - Slash-commands:
/clear,/connect <path>,/desc <table>,/indexes [table],/count [table],/explain <sql>,/dump [table] [file.sql],/format <table|csv|json>,/timing [on|off],/wal,/history [clear],/run <file>,/export <file.csv> <sql>,/help,/exit//quit
- Dot-commands:
-
Storage, Indexing & Recovery Engine
- 4KB Slotted-Page Storage with in-place updates, tombstone deletes, forwarding pointers (
mark_forwarded) preserving B+ TreeRIDs across page relocations, andSlotID-preserving compaction - Buffer Pool Manager with
ReadPageGuard/WritePageGuardRAII latches, Clock eviction, and WAL write-ahead enforcement - ARIES-Style WAL & Crash Recovery (
BEGIN,INSERT,UPDATE,DELETE,COMMIT,ABORT,CLR,CHECKPOINT) resilient to torn WAL tails - Disk-Backed B+ Tree Indexes (
INT64,DOUBLE,VARCHAR) with unique/non-unique keys, range scans, and automaticIndexScan/SeqScanselection in a pull-based Volcano SQL engine
- 4KB Slotted-Page Storage with in-place updates, tombstone deletes, forwarding pointers (
Quick Start (macOS Apple Silicon arm64)
- Download the
tinydbbinary from the release assets. - Make it executable and (if downloaded via browser) clear macOS quarantine:
chmod +x tinydb xattr -d com.apple.quarantine tinydb # only if blocked by Gatekeeper - Launch the REPL or run a one-shot query:
./tinydb --db mydata.db ./tinydb --db mydata.db --exec "SELECT 1 + 2;"
(See USAGE.md for the full CLI, dot-command, slash-command, and SQL reference.)
Build from Source
cmake -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build build/release --target tinydb -j
cmake --install build/release --prefix ~/.localVerified with 24/24 unit, integration, and crash-recovery tests passing via ctest.