This is an in progress implmentation of a transactional Key-Value store implementation from scratch. Currently we only use few standard library functions such as strings, io and unordered maps as the stores. This is purely educational, where I wanted to implement as much of the functionality from scratch, such as creating my own Stack and in the future a hashmap implementation.
- Building from sratch
This requires a g++ compiler, that is also able to compile c++ 11
make
This creates the executable in the build directory
You'll then be presented with the following prompt
>
This 'mini-shell' environment will serve as your interface into the key-value store
** Note, keys are case sensitive, but the operations are not.
> GET KEY
> SET KEY VALUE
** In this case the value can be anything, the interpreter will assume that all input after the given KEY is the value. This does include space seperated data.
For Ex.
> SET full-name John Smith II
> PUT KEY VALUE
** SET can also be used as a PUT, it will overwrite the key's value
> DELETE KEY
Since this is a transactional key-value store implementation, we need the ability to create, end, rollback and commit transactions. Transactions are handled using a Stack, where the top of the stack represents the active transaction.
> BEGIN
> END
> ROLLBACK
> ROLLBACK
> CLEAR
> EXIT
> PRINT
You can customise the prompt token, by changing the constructor value in the Main.cpp file
int main() {
// Interface into key-value store
Shell s("❯");
s.init();
return 0;
}