How nandinideshmukh/minisql works
miniSQL is a local C SQL database. The current workflow is CLI input → parsing → executor dispatch, with V2 operations using a B+ tree index, heap pages, a buffer pool and WAL; V2 data and logs persist in files. The README also documents a V1 flat-file engine and V2 recovery-related code exists. V1’s runtime wiring and recovery invocation are not established by the sampled excerpts, so those links are omitted or marked unverified.
Main entry points: executor.c Command Executor · cli.c CLI / REPL · buffer.c Buffer Pool · btree.c B+ Tree Index
Components 14
SQL Interface
- Program Entry
cfiles/src/main.c - CLI / REPL
cfiles/src/cli/cli.c - SQL Parser
cfiles/src/parser/parser.c
Query Execution
- Command Executor
cfiles/src/executor/executor.c
V2 Storage Engine
- B+ Tree Index
cfiles/src/btree/btree.c - Heap Pages
cfiles/src/page/page.c - Buffer Pool
cfiles/src/buffer/buffer.c - Write-Ahead Log
cfiles/src/wal/wal.c - WAL Recovery
cfiles/src/wal/recovery.c - V2 Database File
- WAL Log File
V1 Flat-File Engine
- Flat-File Storage
cfiles/src/storage/storage.c - V1 Database File
Other components
- SQL User
Connections 15
- SQL User → CLI / REPL: enters SQL
README.md - Program Entry → CLI / REPL: runs
cfiles/src/main.c - CLI / REPL → SQL Parser: parses input
README.md - CLI / REPL → Command Executor: dispatches commands
README.md - Command Executor → B+ Tree Index: index operations
cfiles/src/executor/executor.c - Command Executor → Heap Pages: row operations
cfiles/src/executor/executor.c - Command Executor → Buffer Pool: fetches pages
cfiles/src/executor/executor.c - Command Executor → Write-Ahead Log: writes transactions
cfiles/src/executor/executor.c - B+ Tree Index → Heap Pages: stores row IDs
README.md - B+ Tree Index → Buffer Pool: uses page cache
README.md - Heap Pages → Buffer Pool: uses page cache
README.md - Buffer Pool → V2 Database File: reads and flushes
README.md - Write-Ahead Log → WAL Log File: records log
README.md - Write-Ahead Log → WAL Recovery
- Flat-File Storage → V1 Database File: reads and writes
README.md