Let’s start by implementing a very simple database system with the absolute basic functionality.
Our first database will support a basic CREATE TABLE
with integers and strings, plus INSERT
and a SELECT * FROM table
.
Given that we will be keeping a separate branch for each version, you can find all the related code of our first attempt in the basic
branch of our repository.
Architecture
At this stage - our basic version - our architecture will be very simple and naive:
We will have a SQL parser, to be honest this won’t be the focus of our work, so this will be as basic as possible to make everything work
We will have an execution engine. The first version will be trivial, but as time goes by this will evolve to something sophisticated
Speculating about the future
While I don’t know how the final architecture will look like, it will probably be something a bit more complex like:
For now do not worry with the other components of our database, I just want to impress the notion that our basic version will be really… basic
Implementation details and dependencies
We will have two types of dependencies: general Python software development stuff and database related libraries.
General dependencies
This are best practice libraries, frameworks and applications:
uv - Our package and project manager
mypy - For static typing. I would expect this to be replaced later with ty when it become production quality
ruff - For linting
Pydantic - Data validation
Typer - Command line interfacing
Python. Yes, shocking. We will require 3.13. In future versions this might increase
Database related support
Libraries that will be useful to our database project, specifically related to… erm… database stuff.
At this stage we will be concerned with outsoursing parsing as, quite honestly, it’s not a main consideration for our work.
sqlparse - Parsing SQL statements