Skip to content

Commit e29aa06

Browse files
committed
fixed windows ci executable path
updated README.md
1 parent ae13cfb commit e29aa06

2 files changed

Lines changed: 70 additions & 5 deletions

File tree

.github/workflows/windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
cmake --build build
2828
- name: Run tests
2929
run: |
30-
./build/kvdb-cpp_tests --success
30+
.\build\Debug\kvdb-cpp_tests.exe --success

README.md

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=for-the-badge&logo=c%2B%2B&logoColor=white) kvdb-cpp
22

33
[![linux](https://github.com/BestITUserEUW/kvdb-cpp/actions/workflows/linux.yaml/badge.svg)](https://github.com/BestITUserEUW/kvdb-cpp/actions/workflows/linux.yaml)
4-
[![linux](https://github.com/BestITUserEUW/kvdb-cpp/actions/workflows/windows.yaml/badge.svg)](https://github.com/BestITUserEUW/kvdb-cpp/actions/workflows/windows.yaml)
4+
[![windows](https://github.com/BestITUserEUW/kvdb-cpp/actions/workflows/windows.yaml/badge.svg)](https://github.com/BestITUserEUW/kvdb-cpp/actions/workflows/windows.yaml)
55

66
Orm Key Value Database
77

@@ -17,13 +17,14 @@ The following table lists the libraries in use:
1717

1818
## Supported for Types
1919

20-
kvdb-cpp supports the following types:
20+
kvdb-cpp natively supports the following types:
2121

2222
- `std::string`
2323
- `bool`
2424
- `integral types`
2525
- `floating types`
26-
- `any that reflect cpp can serialize beyond that`
26+
27+
Anything beyond that will be forwarded to reflect-cpp json serialization and deserialization which supports structs and whole bunch of other stuff check out their: [C++ Standart Support](https://github.com/getml/reflect-cpp?tab=readme-ov-file#support-for-containers)
2728

2829
## Build locally
2930

@@ -37,6 +38,70 @@ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug -Bbuild -H.
3738
cmake --build build -j32
3839
```
3940

41+
## Ready to run Example
42+
43+
```cpp
44+
#include <iostream>
45+
#include <cassert>
46+
47+
#include <oryx/key_value_database.hpp>
48+
49+
auto main() -> int {
50+
oryx::KeyValueDatabase db{};
51+
52+
auto status = db.Open("./database.ldb");
53+
if (!status.ok()) {
54+
std::cout << "Failed to open db with error: " << status.ToString() << "\n";
55+
return -1;
56+
}
57+
58+
std::string input{"SuperImportantValue"};
59+
status = db.Put("my_key", input);
60+
if (!status.ok()) {
61+
std::cout << "DB put failed" << "\n";
62+
return -1;
63+
}
64+
65+
std::string value;
66+
status = db.Get("my_key", value);
67+
if (!status.ok()) {
68+
std::cout << "DB get failed" << "\n";
69+
return -1;
70+
}
71+
72+
assert(input == value && "This should not happen!");
73+
return 0;
74+
}
75+
```
76+
77+
## Cmake Integration
78+
79+
Package is being made available through the oryx namespace use this if you have it installed in your system:
80+
81+
```cmake
82+
find_package(kvdb-cpp REQUIRED)
83+
84+
target_link_libraries(your_exe oryx::kvdb-cpp)
85+
```
86+
87+
Or with FetchContent API:
88+
89+
```cmake
90+
include(FetchContent)
91+
FetchContent_Declare(
92+
kvdb-cpp
93+
GIT_REPOSITORY https://github.com/BestITUserEUW/kvdb-cpp.git
94+
GIT_TAG main
95+
OVERRIDE_FIND_PACKAGE
96+
EXCLUDE_FROM_ALL
97+
)
98+
FetchContent_MakeAvailable(kvdb-cpp)
99+
target_link_libraries(your_exe kvdb-cpp)
100+
```
101+
102+
Alternatively if you already have leveldb and reflect-cpp linking to your project you can just drop in `include/key_value_database.hpp` into your project.
103+
40104
## Todo
41105

42-
- Fix install for reflect-cpp
106+
- Replace std::to_string() for floating point types
107+
- Add performance benchmarks

0 commit comments

Comments
 (0)