A lightweight, file-based SQL engine built from scratch using C++. Supports core relational database operations including JOINs, conditional filters, indexing, and persistence.
CREATE TABLE name (col TYPE [PRIMARY KEY], ...)INSERT INTO name VALUES (...)SELECT * FROM nameDELETE FROM name WHERE col = valUPDATE name SET col = val WHERE col = valDROP TABLE nameEXPORT TABLE nameSHOW TABLESSHOW COLUMNS FROM nameTRUNCATE TABLE nameCREATE INDEX ON name colFIND FROM name WHERE col = val(uses index)JOIN t1 AND t2 ON t1.col = t2.colJOIN ... WHERE t2.col = valEXPORT JOINED TO filename.tableEXITwith unsaved export remindertransaction.logreplay support
- All tables are stored as
.tablefiles (CSV-style) - Each command is parsed using C++
stringstream - Primary key constraints and type checking are enforced
- JOIN results are stored in-memory and exportable
- On startup, all
.tablefiles are auto-loaded and transactions are replayed
With g++:
g++ src/main.cpp src/Table.cpp -o dbms
./dbms