DEV Community

Cover image for C++ Client SDK v0.6.0 has been released
Alexey Timin for ReductStore

Posted on • Edited on

C++ Client SDK v0.6.0 has been released

Hey everyone!

C++ Client SDK v0.6.0 have been released!
It supports Reduct Storage HTTP v0.6 and introduces some new features:

Data Streaming

Now you can write and read data in chunks:


# Read
std::ofstream file("some.blob");
auto err = bucket->Read("entry", ts, [&file](auto data) {
    file << data;
    return true;
});

# Write
const std::string blob(10'000, 'x');
bucket->Write("entry", ts, blob.size(), [&blob](auto offset, auto size) {
    return std::pair{true, blob.substr(offset, size)};
})l
Enter fullscreen mode Exit fullscreen mode

The storage engine has no limitation for record sizes.
So, you can stream your data of any sizes maximal efficiently.

Get Or Create?

When your application needs to create a bucket in the storage engine before writing there, it caused boilerplate code to check if the bucket already exists.
Now it is way easier with the IClient::GetOrCreateBucket method:

auto [bucket, err] = client->GetOrCreate("bucket");
if (err) {
  std::cerr << "Error: " << err;
  return;
}

std::cout << bucket->GetSettings();
Enter fullscreen mode Exit fullscreen mode

Links

Top comments (0)