How comictor2ro/nexdb works
NexDB is a lightweight relational database with SQL access through a TCP server and an interactive GUI. The main workflow is a client submitting SQL, which is tokenized, parsed into a statement, and handled by the engine; table data and catalog metadata are persisted, with WAL recovery for interrupted changes. The README also describes authentication, rate limiting, indexing, and GUI browsing/results. Some internal call paths are not shown in the excerpts, so those links are marked unverified rather than inferred as certain.
Main entry points: Engine.cpp Query Engine · PageManager.cpp Page Manager · Table.cpp Table Operations · Parser.cpp Parser
Components 16
SQL Processing
- Lexer
Frontend/Lexer/Lexer.cpp - Parser
Frontend/Parser/Parser.cpp - SQL Statements
AST
Database Engine
- Query Engine
Engine/Engine.cpp - Catalog
Catalog/Catalog.cpp - Table Operations
Table/Table.cpp - B+ Tree Index
Indexing/BPlusTree/BPlusTree.cpp
Persistence
- Storage Files
Storage/StorageFile/StorageFile.cpp - Page Manager
Storage/PageManager/PageManager.cpp - Page Data
Storage/Page/Page.cpp - LRU Cache
Storage/LRUCache/LRUCache.cpp - Write-Ahead Log
WALManager/WALManager.cpp
Client Interfaces
- TCP Server
Networking/NetworkServer.cpp - Interactive GUI
GUI/GUI.cpp - Configuration
Config/Config.cpp
Other components
- SQL Client
Connections 18
- SQL Client → TCP Server: sends SQL
- TCP Server → Query Engine: submits queries
- Interactive GUI → Query Engine: runs queries
- Query Engine → Lexer: tokenizes SQL
- Lexer → Parser: provides tokens
- Parser → SQL Statements: builds statements
- Query Engine → Parser: parses queries
- Query Engine → SQL Statements: executes statements
- Query Engine → Catalog: uses metadata
- Query Engine → Table Operations: runs table operations
- Table Operations → B+ Tree Index: uses index
- Query Engine → Write-Ahead Log: coordinates recovery
- Write-Ahead Log → Query Engine: replays statements
WALManager/WALManager.cpp - Table Operations → Page Manager: uses pages
- Page Manager → Storage Files: reads and writes
- Page Manager → Page Data: manages pages
- Page Manager → LRU Cache: caches pages
- Interactive GUI → Configuration: loads settings