This project implements a simple in-memory database system in C++. It supports creating tables with primitive and list columns, adding entries, indexing, and filtering.
- Table Structure: Supports dynamic addition of columns (Primitive and List types).
- Indexing: Uses Binary Search Trees (BST) and Hash Tables for efficient indexing and retrieval.
- Filtering: Supports filtering entries based on field values.
- Data Structures: Custom implementation of BST and HashTable.
table.h/tpp: MainTableclass andFilterstruct.entry.h:Entryclass representing a row.basefield.h/tpp: Field definitions (PrimitiveField,ListField).bst.h/tpp: Binary Search Tree implementation.hashtable.h/tpp: Hash Table implementation.hash.h: Hash function.main.cpp: Test cases.
To compile the project, use the provided Makefile:
makeThis will generate an executable named system (on Windows system.exe).
If you prefer to compile manually without make, you can use the following g++ command:
g++ -std=c++11 -g main.cpp -o systemTo run the executable:
./systemYou can input a test case ID (1-18) to run specific tests.
Table table;
table.addListColumn<string>("tags", {});
table.addPrimitiveColumn<string>("time", "No time");
table.addEntry(Entry().addItemToListField<string>("tags", "UwU").setPrimitiveField<string>("time", "2023-10-01"));
cout << table << endl;