The project doesn't have any name so let it be database
for now.
compatibility/
- folder containsSQL
scripts to run functional tests through the running system. It has namecompatibility
because it was intended to emphasize compatibility testing withPostgreSQL
, but now it is more suite ofSQL
queries that database should support. Strict testing must be automated and probably test suite will be written in another programming language (#65)proof-of-concept/
- there are a couple of sub projects/modules to play with concepts before starting development of database. It could become a play ground of different PoC.src/kernel/
- core concept of the system. All modules (exceptprotocol
) depends on it. It should provide conceptual abstraction for other modules. Good examples areSystemResult
andSystemError
. Other part of system uses them to handle errors that are not local for a module but more system wide.src/node/
- database node (member, server, instance) code. Handles network communication with clients and process management of incoming queries. It also contains concretetrait
implementations fromsrc/protocol/
module.src/protocol/
- server-side (backend) API of PostgreSQL Wire Protocol The goal is to provide high leveltrait
s andstruct
s to help otherrust
database implementations bePostgreSQL
compatible. Must not depend on any modules of the system and has as small as possible dependencies on other crates because it is intended to move out of the project into completely separate crate. Right now it is in the project because of ease of testing, prototyping and development.src/sql_engine/
- module to execute incomingSQL
queries. That is it.src/sql_types/
- module contains code to support differentSQL
types and incoming data validationsrc/storage/
- module to persist and retrieve execution results ofSQL
queries. It is split into two major parts:FrontendStorage
andBackendStorage
.FrontendStorage
is responsible to provide high levelrelational
API likeCREATE SCHEMA
,CREAT TABLE
andCREATE INDEX
.BackendStorage
is responsible to hide actual on-disk storage implementation and provide low level API forFrontendStorage
like create a namespace, create an object, read/write data in binary format from/to disk.
For now, it is local and manual - that means some software has to be installed on a local machine and queries result has to be checked visually.
- Install
psql
(PostgreSQL client)- Often it comes with
PostgreSQL
binaries. On macOS, you can install it withbrew
executing the following command:
brew install postgresql
- Often it comes with
- Start the
database
instance with the command:cargo run
- Start
psql
with the following command:psql -h 127.0.0.1 -W
- enter any password
- Run
sql
scripts fromcompatibility
folder
We use PyTest for functional tests. To run tests locally you need to set up
python
environment with the following commands:
- If you use linux or macos it is most probably you have
python
installed. For windows, you can easily installpython
from official site. - Install
python
dependencies withpip
requirements executing the following command:pip install -r tests/functional/requirements.txt
- or with
pip3
:pip3 install -r tests/functional/requirements.txt
- After that you can run all tests with:
pytest -v tests/functional/*
- or tests in specified file with:
pytest -v tests/functional/<test_file>.py
pip3
and python3
OR pip
and python
- depends on your system and your
preferences.
For system with both python
2 and 3 - use python3
and pip3
to run tests
with the 3rd version of python
.