Hey everyone, I just released the Reduct Storage SDK for C++ v1.0.0. Now it supports Reduct Storage v1.0.0.
Because it is a major release, I refactored the Bucket.Write
and Bucket.Read
methods and made the more similar to Bucket.Query
See #41.
Now to read a record from the storage engine, we use a callback with a proxy object:
auto client = IClient::Build("https://play.reduct-storage.dev");
// Create a bucket
auto [bucket, create_err] = client->GetOrCreateBucket("bucket");
if (create_err) {
std::cerr << "Error: " << create_err;
return -1;
}
auto ts = IBucket::Time::clock::now();
auto read_err = bucket->Read("entry-1", ts, [](auto rec) {
std::cout << "Read blob: " << rec->ReadAll() << std::endl;
});
and the same for writing:
auto write_err = bucket->Write("entry-1", ts, [](auto rec) {
rec->WriteAll("some_data1");
});
You also can easily use the same proxy objects to write or read records via chunks.
Have fun!
Top comments (0)