For this implementation, we will be using redis cloud. This makes it usable across Linux and Windows. This can be implemented locally on a Linux system
Note: Redis is not supported by windows 10. To run on windows, you need to install Linux subsystem for windows and run it from there.
Logging will need to be removed from all try/catch blocks
Assumption:
COMPACT works for only variables intialized in the session. Any already existing data/variables won't be used.
Meaning, COMPACT lines generated will only consist of newly used variables in the current session.
Future:
MULTI functionality will require a validate fucntion that will validate all the lines before it starts running them. In current setting it will stop the program where it breaks
Note:
- Story 5 doesn't seem to be applicable for on cloud database.
| Command Name | Function | Input | Output | |||
|---|---|---|---|---|---|---|
| SET | sets/replaces/creates a key/value pair | SET key value | True(Success) | |||
| GET | gets value if exists | GET key | Value | |||
| INCR | increments the value by 1 | INCR key | Value (after increment) | |||
| INCRBY | increments the value by amount specified | INCRBY key amount | Value (after increment) | |||
| MULTI | Starts storing the commands to be executed later | MULTI | None | |||
| EXEC | Executes all commands since MULTI | EXEC | None | |||
| DISCARD | Deletes all stored commands | DISCARD | None | |||
| DEL | Deletes key and value | DEL key value | True | |||
| COMPACT | Converts all commands in session into set operation (limitations discussed above) | COMPACT | List of commands |
python -m venv myenv
.\myenv\Scripts\activate
pip install -r requirements.txt
pip freeze > requirements.txt
cd key_value_db
python .\main.py
coverage run -m pytest test/
# To generate html report
coverage html
/key_value_db
Python modules
/test
/htmlcov
/myenv
README.md
requirementx.txt
.gitignore