I built a SQL-like relational database engine in C++ from scratch
Hey r/cpp,
I’ve been learning systems programming and database internals, so I started building **Ark** — a SQL-like relational database engine written entirely from scratch in C++.
Current features include:
* Handwritten tokenizer ( lexer )
* Recursive descent parser
* CRUD operations
* INNER / LEFT / RIGHT / FULL joins
* Aggregate functions
* `ALTER TABLE` support
* File persistence
* Custom diagnostics system
Everything is implemented manually:
* no parser generators
* no embedded SQL engines
* no external dependencies
One of the most challenging parts so far has been handling joins, schema evolution, and persistence consistency cleanly.
GitHub:
[https://github.com/kashyap-devansh/Ark](https://github.com/kashyap-devansh/Ark)
I’d especially appreciate feedback around architecture, parser design, query execution, or persistence design.
https://redd.it/1tkrhxq
@r_cpp
Post #25253
13