项目作者: samarthtambad

项目描述 :
A miniature relational database with order
高级语言: Python
项目地址: git://github.com/samarthtambad/mini-db.git
创建时间: 2019-11-15T12:26:51Z
项目社区:https://github.com/samarthtambad/mini-db

开源协议:

下载


minidb

A miniature relational database with order that performs basic operations of relational
algebra such as selection, projection, join, group by, and aggregates (count, sum and avg).

Folder Structure

  1. mini-db (container folder)
  2. ├── data
  3. ├── queries
  4. ├── sales1 (data)
  5. ├── sales2 (data)
  6. ├── docs
  7. ├── usage.md (sample commands)
  8. ├── minidb
  9. ├── __init.py
  10. ├── __main__.py (takes command and displays output)
  11. ├── argparser.py (class for handling parsing of input text)
  12. ├── database.py (class, maintains list of tables & operations bw tables)
  13. ├── index.py (class, create and return Hash/Btree index)
  14. ├── join.py (class, logic for joins (eq vs non-eq))
  15. ├── table.py (class, operations on tables)
  16. ├── utils.py (static utility functions)
  17. ├── tests
  18. ├── mindb_test.py (pytest, tests to check implementation)
  19. ├── README.md
  20. ├── input_file (commands to run)
  21. ├── requirements.txt (dependencies to install)

Steps to run

  1. Make sure dependencies are installed as described in the next section
  2. Navigate inside mini-db folder
  3. To run it to take commands one-by-one (like any database), run:\
    python3 -m minidb\
    This will show minidb>> after which commands can be entered.\
    OR\
    python3 -m minidb < path_to_input_file\
    This will run all the commands in your input file (for example input_file.txt).
    The path_to_input_file must be relative to the mini-db folder.
    Sample commands can be found under docs/usage.md

Dependencies

  1. Python3
  2. BTree package\
    pip install BTrees\
    More info about this package can be found at: https://pypi.org/project/BTrees. \
    If there is an issue with permission, try with pip install --user BTrees

  3. Numpy\
    pip install numpy

Alternatively, navigate inside mini-db folder and run:\
pip install -r requirements.txt

Team

  1. Samarth Tambad
  2. Katherine Pully