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 t…


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Reduct Storage Client SDK for C++ 1.0.0 was released." Alexey Timin | Sciencx - Sunday October 9, 2022, https://www.scien.cx/2022/10/09/reduct-storage-client-sdk-for-c-1-0-0-was-released/
HARVARD
Alexey Timin | Sciencx Sunday October 9, 2022 » Reduct Storage Client SDK for C++ 1.0.0 was released., viewed ,<https://www.scien.cx/2022/10/09/reduct-storage-client-sdk-for-c-1-0-0-was-released/>
VANCOUVER
Alexey Timin | Sciencx - » Reduct Storage Client SDK for C++ 1.0.0 was released. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/10/09/reduct-storage-client-sdk-for-c-1-0-0-was-released/
CHICAGO
" » Reduct Storage Client SDK for C++ 1.0.0 was released." Alexey Timin | Sciencx - Accessed . https://www.scien.cx/2022/10/09/reduct-storage-client-sdk-for-c-1-0-0-was-released/
IEEE
" » Reduct Storage Client SDK for C++ 1.0.0 was released." Alexey Timin | Sciencx [Online]. Available: https://www.scien.cx/2022/10/09/reduct-storage-client-sdk-for-c-1-0-0-was-released/. [Accessed: ]
rf:citation
» Reduct Storage Client SDK for C++ 1.0.0 was released | Alexey Timin | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.