https://github.com/mhhollomon/memorandum
toy embedded in-memory database
https://github.com/mhhollomon/memorandum
cpp20 database header-only
Last synced: 3 months ago
JSON representation
toy embedded in-memory database
- Host: GitHub
- URL: https://github.com/mhhollomon/memorandum
- Owner: mhhollomon
- License: mit
- Created: 2024-12-19T16:01:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-25T18:09:55.000Z (over 1 year ago)
- Last Synced: 2025-04-10T05:49:57.507Z (about 1 year ago)
- Topics: cpp20, database, header-only
- Language: C++
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# memorandum
Embedded, in-memory database.
Being written for the needs of the [kbDaw](https://github.com/mhhollomon/kbdaw)
project.
Requires C++20.
MIT license.
## Overview
The idea is that - unlike most databases - the rows are directly stored as C++
structures (or classes). Doing so would keep from having to have code that continuously
marshalled and unmarshalled the separate fields into the database.
The drawback, is of course, that joins and projections are not possible.
So, if you want to call this a key-value store rather than a database, that would
make sense.
## Concurrency
This is not concurrency safe without additional locking.
The methods can be called without problems from different threads. However,
two threads may not call methods at the same time - unless they are both reads.
Caveat Scriptor
## Interface
See [DB API](docs/api.md)
## Using in a project
### Direct copy
This is a header only project. All that would be needed is to copy the contents
of the `src` directory along with its subdirectories to some suitable place
and point your compiler there as an include directory.
### using CMake and CPM
An easier way, if you use cmake, is to use [CPM](https://github.com/cpm-cmake/CPM.cmake).
Something like the following :
```cmake
include(CPM)
...
CPMAddPackage("gh:mhhollomon/memorandum@0.2.0")
target_link_libraries(my_project PRIVATE memorandum)
```
You can control the creation of the tests by setting
`MEMORANDUM_BUILD_TESTS`. it is on by default.
## Technology
- [Catch2](https://github.com/catchorg/Catch2) for testing framework.
- [CPM](https://github.com/cpm-cmake/CPM.cmake) for managing dependencies.