This is a mini database, using B-tree as the index and .db file as presistence, original version(see link below) was writtern in C, this is a re-write version in C++ following the RAII rules, and also using the CMAKE as a building and testing tool
miniDB << "insert 1 user1 [email protected]",
miniDB << "select",
miniDB >> (1 user1 [email protected])
std::vector<std::string> scripts4{
"insert 18 user18 [email protected]",
"insert 1 user1 [email protected]",
"insert 7 user7 [email protected]",
"insert 10 user10 [email protected]",
"insert 29 user29 [email protected]",
.....
"insert 13 user13 [email protected]",
"insert 24 user24 [email protected]",
"insert 25 user25 [email protected]",
"insert 28 user28 [email protected]",
".btree",
....
};
Tree:
- internal (size 3)
- leaf (size 7)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- key 1
- leaf (size 8)
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- key 15
- leaf (size 7)
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- key 22
- leaf (size 8)
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
cd code_path/miniDB/src
mkdir build
cmake ..
make
ctest
./miniDB <nameWhateverYouWant>.db
for insertion:
insert <key> <name> <email>
for selection
select
see the tree
.btree
see configuration
.constants
quit and write to the db
.exit