LowDB is a lightweight C++ library for simple key-value storage with support for different storage adapters. It provides an easy-to-use interface for storing, retrieving, updating, and removing data. It is a C++ port of typicode/lowdb javascript library.
- Simple key-value storage.
- Easy-to-use interface for interacting with the data.
- Supports default and custom-made storage adapters (e.g. in-memory adapter).
To use LowDB in your C++ project, you can either link against the static library or include the source files directly in your project.
-
Clone the repository:
git clone https://github.com/henryhale/lowdb.git
-
Compile the library:
cd lowdb/build chmod +x start.sh ./start.sh
-
Include the header files located in the
include/lowdb
directory in your project. -
Link against the static library (
liblowdb.a
) located in thebuild
directory.
You can also include the source files directly in your project. Simply copy the source code files into your project directory and compile them along with your project.
A complete example illustrating how to use LowDB can be found in the example sub folder.
#include "path/to/lowdb.hpp"
#include <cstdlib>
#include <iostream>
int main(void) {
lowdb::Store db = lowdb::createInMemoryDatabase();
db.set("key", "value");
std::cout << db.get("key") << std::endl;
return EXIT_SUCCESS;
}
Contributions to LowDB are welcome! To contribute, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new pull request.
This project is licensed under the MIT License
Copyright © 2024-present, Henry Hale