This repository is used to maintain the official documentation and the complete test suite. The actual assignments are completed through Qlass.
BlueBase is a Python-based DBMS designed for educational purposes. It was developed with reference to Stanford's RedBase.
By implementing each component of BlueBase, the goal is to build a DBMS from scratch.
Created by: @theeluwin
For the sake of future students and their enjoyment of learning, please refrain from sharing solution code.
For more information, see the official documentation.
uv is used to manage the Python environment.
uv syncTo use Docker:
docker build -t bluebase .Tests are run using PyTest.
The default test configuration (pytest.ini) also measures source code coverage. After running the tests, open the generated htmlcov/index.html file to view the detailed coverage report.
uv run pytestFor example, to test the PF component:
uv run pytest bluebase/pfTo test the manager of the PF component:
uv run pytest bluebase/pf/tests/test_manager.pyExperiments require additional dependencies:
uv sync --group expsThen run an experiment as a module:
uv run -m exps.pf.replacerAlternatively, Docker includes all additional dependencies. For example, the exps/ix/basic.py experiment requires graphviz.
docker build -t bluebase .
docker run --rm -v ./debug:/workdir/debug bluebase -m exps.ix.basicBuilding the documentation requires additional dependencies:
uv sync --group docsThen build the documentation using Sphinx:
make docsAfter the build completes, open docs.build/index.html to view the generated documentation.
uv run bluebase test.dbpip install -e .Or, depending on the environment:
python -m pip install -e .bluebase test.dbfrom pathlib import Path
from bluebase import BlueBase
bb = BlueBase(Path("test.db"))
result = bb.execute("SELECT * FROM table_cat;")
for row in result:
print(row)