From 54623632d6ed922d1dd41a8b9581cfd7f2235166 Mon Sep 17 00:00:00 2001 From: Victor Adossi Date: Fri, 28 Jun 2024 23:04:35 +0900 Subject: [PATCH] fix: lookup in replica returned data Signed-off-by: Victor Adossi --- wit/couchbase/subdocument.wit | 16 ++++++++++++++-- wit/deps.lock | 4 ++-- wit/deps/couchbase/subdocument.wit | 16 ++++++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/wit/couchbase/subdocument.wit b/wit/couchbase/subdocument.wit index 53605a3..dd51385 100644 --- a/wit/couchbase/subdocument.wit +++ b/wit/couchbase/subdocument.wit @@ -46,6 +46,18 @@ interface subdocument-lookup { parent-span: option, } + /// Documents that are returned from lookup-in operations on replicas + record lookup-in-replica-document { + /// CAS revision of the document + cas: u64, + + /// Whether this document came from a replica server + is-replica: bool, + + /// Value that was retrieved + document: document, + } + /// Errors that occur during lookup for an individual subdocument path variant subdocument-lookup-error { /// The provided path does not exist in the document @@ -70,14 +82,14 @@ interface subdocument-lookup { id: document-id, operations: list, options: lookup-options, - ) -> result>, lookup-error>; + ) -> result>, lookup-error>; /// Perform a lookup on a particular document from all replica servers lookup-in-all-replicas: func( id: document-id, operations: list, options: lookup-options, - ) -> result>, lookup-error>; + ) -> result>>, lookup-error>; } /// Perform sub-document mutation operations on Documents stored in a Couchbase cluster diff --git a/wit/deps.lock b/wit/deps.lock index ce60eb5..4967e7f 100644 --- a/wit/deps.lock +++ b/wit/deps.lock @@ -1,7 +1,7 @@ [couchbase] path = "couchbase" -sha256 = "b9d4d7505b29d03f4952cf4845195f728070af4de248e8c6a01807879165dd32" -sha512 = "24b8d81c71a4da20f3881a4a5d10a323dfbe73484b471f89514aa05596022bfb3624c05c2eb11600d976fa58d47f7872daaf9f913d74c13dbad272255603304f" +sha256 = "a8948b95226fe1294d0188e16a61e676364bfe0ea1efe3876b3c7b697bc32e62" +sha512 = "ef4aeeb2c5d8ac75e252f6040a42cc2fc9a73ff784bd5c9f0a98b66e6b633e0aabc64bd6f5547a5fdadd074eb2e2b91ae6744cec72a82809b993126382c16860" [keyvalue] path = "keyvalue" diff --git a/wit/deps/couchbase/subdocument.wit b/wit/deps/couchbase/subdocument.wit index 53605a3..dd51385 100644 --- a/wit/deps/couchbase/subdocument.wit +++ b/wit/deps/couchbase/subdocument.wit @@ -46,6 +46,18 @@ interface subdocument-lookup { parent-span: option, } + /// Documents that are returned from lookup-in operations on replicas + record lookup-in-replica-document { + /// CAS revision of the document + cas: u64, + + /// Whether this document came from a replica server + is-replica: bool, + + /// Value that was retrieved + document: document, + } + /// Errors that occur during lookup for an individual subdocument path variant subdocument-lookup-error { /// The provided path does not exist in the document @@ -70,14 +82,14 @@ interface subdocument-lookup { id: document-id, operations: list, options: lookup-options, - ) -> result>, lookup-error>; + ) -> result>, lookup-error>; /// Perform a lookup on a particular document from all replica servers lookup-in-all-replicas: func( id: document-id, operations: list, options: lookup-options, - ) -> result>, lookup-error>; + ) -> result>>, lookup-error>; } /// Perform sub-document mutation operations on Documents stored in a Couchbase cluster