An Interest In:
Web News this Week
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
Some of Our Sources
View All Sources
October 9, 2022 12:37 am GMT
Original Link: https://dev.to/reduct-storage/reduct-storage-client-sdk-for-c-100-was-released-2kp
Reduct Storage Client SDK for C 1.0.0 was released
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!
Original Link: https://dev.to/reduct-storage/reduct-storage-client-sdk-for-c-100-was-released-2kp
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To