Skip to content

Releases

TinyDB v0.1.0

Choose a tag to compare

@DakshSingh-GitHub DakshSingh-GitHub released this 01 Dec 07:19

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, and Ctrl+D
    • Automatic cleanup of newly opened empty databases (.db + .wal) on exit or /connect
    • Unified .help / /help (/?) command menu, Unicode box-drawn tables, and table / csv / json output formatting
    • Non-interactive --exec "<sql>" mode and piped .sql script execution
  • 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
  • Storage, Indexing & Recovery Engine

    • 4KB Slotted-Page Storage with in-place updates, tombstone deletes, forwarding pointers (mark_forwarded) preserving B+ Tree RIDs across page relocations, and SlotID-preserving compaction
    • Buffer Pool Manager with ReadPageGuard / WritePageGuard RAII 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 automatic IndexScan / SeqScan selection in a pull-based Volcano SQL engine

Quick Start (macOS Apple Silicon arm64)

  1. Download the tinydb binary from the release assets.
  2. 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
  3. 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 ~/.local

Verified with 24/24 unit, integration, and crash-recovery tests passing via ctest.