This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Alexey Timin
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!
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Alexey Timin
Alexey Timin | Sciencx (2022-10-09T00:37:27+00:00) Reduct Storage Client SDK for C++ 1.0.0 was released. Retrieved from https://www.scien.cx/2022/10/09/reduct-storage-client-sdk-for-c-1-0-0-was-released/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.