RocksDBWrapper is a C++ library that provides a convenient interface for storing, retrieving, and indexing data using RocksDB. This library supports serialization of complex data structures and indexing for efficient queries.
mkdir build
cd build
cmake .. -DBUILD_TESTS=ON # Add -DBUILD_TESTS=OFF if you do not want to build tests
make
RocksDBWrapper(const std::string &db_path, const std::string &index_path)RocksDBWrapper instance and opens the specified database and index paths.db_path: The path to the main RocksDB database.
index_path: The path to the index RocksDB database.~RocksDBWrapper()template <typename T> void store(const std::string &key, const T &value)key: The key to associate with the value.
value: The value to store.template <typename T> bool get(const std::string &key, T &value)key: The key to retrieve the value for.
value: The variable to store the retrieved value.true if the key was found and the value was retrieved; false otherwise.bool keyExists(const std::string &key)key: The key to check for existence.
true if the key exists; false otherwise.template <typename T> std::vector<std::string> search(const std::string &member_name, const std::string &member_value)member_name: The name of the member to search by.
member_value: The value of the member to search for.template <typename T> void search_text(const std::string &search_value, std::vector<T> &res)search_value: The text to search for.
res: A vector to store the results.template <typename T> void search_conditional(std::vector<T> &res, std::function<bool(const T &)> condition)res: A vector to store the results.
condition: A function to define the search condition.This README.md provides a comprehensive overview of the RocksDBWrapper library, including installation instructions, usage examples, and documentation of public methods.