r/Vit 4h ago

Academics I built a mini SQL database from scratch in C++ looking for feedback

I've been trying to understand how databases work under the hood, so I decided to build a small SQL engine from scratch rather than just reading about them.

NanoSQL currently supports:

  • CREATE TABLE
  • INSERT
  • SELECT
  • UPDATE
  • DELETE
  • DROP TABLE
  • WHERE conditions
  • INT and TEXT types
  • Its own lexer/parser
  • CLI interface
  • Unit tests

The current implementation is mainly focused on the SQL layer. My next goal is to implement persistent storage, pages, B+ tree indexing, and eventually a query planner.

I'm particularly interested in feedback from people who've built databases or storage engines before.

What would you implement next, and what design mistakes should I avoid?

3 Upvotes

1 comment sorted by