通过从头开始实现数据库来了解其内部原理。
What I Cannot Create, I Do Not Understand -Richard Feynman
In the spirit of Feynman's immortal words, the goal of this project is to better understand the internals of databases by implementing a relational database management system (RDBMS) (sqlite clone) from scratch.
This project was motivated by a desire to: 1) understand databases more deeply and 2) work on a fun project. These dual goals led to a:
This makes the learndb codebase great for tinkering with. But the product has some key limitations that means it shouldn't be used as an actual storage solution.
Learndb supports the following:
select, from, where, group by, having, limit, order by larkselect * ...learndb first start with tutorial.md. reference.md.
This is essentially a complete reference manual directed at a user of the system. This outlines the operations and
capabilities of the system. It also describes what is (un)supported and undefined behavior. fcntl to get exclusive read access on database filecd python3 -m venv venv source venv/bin/activatepython -m pip install -r requirements.txtLearndb in edit mode: python3 -m pip install -e .source venv/bin/activate
python run_learndb.py repl
Run all tests:
python -m pytest tests/*.py
Run btree tests:
-python -m pytest -s tests/btree_tests.py # stdout
python -m pytest tests/btree_tests.py # suppressed out
Run end-to-end tests:
python -m pytest -s tests/e2e_tests.py
Run end-to-end tests (employees):
python -m pytest -s tests/e2e_tests_employees.py
python -m pytest -s tests/e2e_tests_employees.py -k test_equality_select
Run serde tests:
... serde_tests.py
Run language parser tests:
... lang_tests.py
Run specific test:
python -m pytest tests.py -k test_name
Clear pytest cache
python -m pytest --cache-clear
tasks.mddocs/future-work.md[^1]: When evaluating the difference between two floats, e.g. 3.2 > 4.2, I consider the condition True if the
difference between the two is some fixed delta. The accepted epsilon should scale with the magnitude of the number
暂无开放 Issues,或尚未同步最近议题。