https://github.com/henryhale/lowdb
⚪ A C++ implementation of typicode/lowdb js library
https://github.com/henryhale/lowdb
bash cpp lowdb
Last synced: about 1 month ago
JSON representation
⚪ A C++ implementation of typicode/lowdb js library
- Host: GitHub
- URL: https://github.com/henryhale/lowdb
- Owner: henryhale
- License: mit
- Created: 2024-03-15T22:17:43.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T06:29:26.000Z (about 2 years ago)
- Last Synced: 2025-01-08T13:38:49.553Z (over 1 year ago)
- Topics: bash, cpp, lowdb
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LowDB
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](https://github.com/typicode/lowdb) javascript library.
## Features
- 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).
## Installation
To use LowDB in your C++ project, you can either link against the static library or include the source files directly in your project.
### Static Library
1. Clone the repository:
```bash
git clone https://github.com/henryhale/lowdb.git
```
2. Compile the library:
```bash
cd lowdb/build
chmod +x start.sh
./start.sh
```
3. Include the header files located in the `include/lowdb` directory in your project.
4. Link against the static library (`liblowdb.a`) located in the `build` directory.
### Source Files
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.
## Usage
A complete example illustrating how to use LowDB can be found in the [example](./example/) sub folder.
```cpp
#include "path/to/lowdb.hpp"
#include
#include
int main(void) {
lowdb::Store db = lowdb::createInMemoryDatabase();
db.set("key", "value");
std::cout << db.get("key") << std::endl;
return EXIT_SUCCESS;
}
```
## Contributing
Contributions to LowDB are welcome! To contribute, follow these steps:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature/your-feature`).
3. Make your changes.
4. Commit your changes (`git commit -am 'Add new feature'`).
5. Push to the branch (`git push origin feature/your-feature`).
6. Create a new pull request.
## License
This project is licensed under the [MIT License](./LICENSE.md)
Copyright © 2024-present, [Henry Hale](https://github.com/henryhale)