changeset 6121:d6b3379795a5 attach-custom-data

ListKeyValues in protobuf
author Alain Mazy <am@orthanc.team>
date Tue, 20 May 2025 16:39:04 +0200
parents 756983d498bb
children 0ff96222e461
files OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp OrthancServer/Plugins/Include/orthanc/OrthancDatabasePlugin.proto
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp	Tue May 20 16:24:56 2025 +0200
+++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp	Tue May 20 16:39:04 2025 +0200
@@ -1929,15 +1929,16 @@
     virtual void ListKeysValues(std::list<std::string>& keys,
                                 std::list<std::string>& values,
                                 const std::string& storeId,
-                                bool first,
-                                const std::string& from,
+                                bool fromFirst,
+                                const std::string& fromKey,
                                 uint64_t limit) ORTHANC_OVERRIDE
     {
       if (database_.GetDatabaseCapabilities().HasKeyValueStoresSupport())
       {
         DatabasePluginMessages::TransactionRequest request;
         request.mutable_list_key_values()->set_store_id(storeId);
-        // request.mutable_list_key_values()->set_since(since);  // TODO_ATTACH_CUSTOM_DATA
+        request.mutable_list_key_values()->set_from_first(fromFirst);
+        request.mutable_list_key_values()->set_from_key(fromKey);
         request.mutable_list_key_values()->set_limit(limit);
 
         DatabasePluginMessages::TransactionResponse response;
@@ -1946,7 +1947,7 @@
         for (int i = 0; i < response.list_key_values().key_values_size(); ++i)
         {
           keys.push_back(response.list_key_values().key_values(i).key());
-          // values .push_back(response.list_key_value().key_values(i)); // TODO_ATTACH_CUSTOM_DATA
+          values .push_back(response.list_key_values().key_values(i).value());
         }
       }
       else
--- a/OrthancServer/Plugins/Include/orthanc/OrthancDatabasePlugin.proto	Tue May 20 16:24:56 2025 +0200
+++ b/OrthancServer/Plugins/Include/orthanc/OrthancDatabasePlugin.proto	Tue May 20 16:39:04 2025 +0200
@@ -1033,8 +1033,9 @@
 message ListKeyValues {
   message Request {
     string store_id = 1;
-    uint64 since = 2;
-    uint64 limit = 3;
+    bool from_first = 2;
+    string from_key = 3;
+    uint64 limit = 4;
   }
 
   message Response {