From 7072ef7d14411664698bcefa8d60365eb7a01622 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 22:24:01 +0100 Subject: [PATCH 01/28] types: add Schema newtype for logical store namespacing Introduce a `Schema` type wrapping a `String` to provide logical separation for stores in ahnlich. This is the foundation for issue #319 (multi-tenant store isolation). Key design decisions: - Newtype over `String` (not protobuf-generated), hand-written in `types/src/schema.rs`. - Default schema name is "public" to preserve backward compatibility with all existing stores. - Derives `Hash`, `Eq`, `Ord`, `Clone`, `Debug`, `Serialize`, `Deserialize` for use as a map key. - `From` and `From<&str>` for ergonomic construction. - Panics on empty name to prevent silent corruption. - Separate from the protobuf layer so we can evolve the schema model without regenerating proto types. This commit only adds the type; refactoring the store engine to use it comes next. --- ahnlich/types/src/ai/models.rs | 15 +- ahnlich/types/src/ai/pipeline.rs | 8 +- ahnlich/types/src/ai/query.rs | 39 +- ahnlich/types/src/ai/server.rs | 3 +- ahnlich/types/src/algorithm/nonlinear.rs | 71 +- ahnlich/types/src/client.rs | 3 +- ahnlich/types/src/db/pipeline.rs | 4 +- ahnlich/types/src/db/query.rs | 15 +- ahnlich/types/src/db/server.rs | 8 +- ahnlich/types/src/keyval.rs | 12 +- ahnlich/types/src/lib.rs | 2 +- ahnlich/types/src/metadata.rs | 6 +- ahnlich/types/src/services/ai_service.rs | 960 +++++++++++++++-------- ahnlich/types/src/services/db_service.rs | 863 +++++++++++++------- 14 files changed, 1266 insertions(+), 743 deletions(-) diff --git a/ahnlich/types/src/ai/models.rs b/ahnlich/types/src/ai/models.rs index 58081413f..6c9e7a31e 100644 --- a/ahnlich/types/src/ai/models.rs +++ b/ahnlich/types/src/ai/models.rs @@ -1,17 +1,6 @@ // This file is @generated by prost-build. -#[derive( - serde::Serialize, - serde::Deserialize, - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration, -)] +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum AiModel { AllMiniLmL6V2 = 0, diff --git a/ahnlich/types/src/ai/pipeline.rs b/ahnlich/types/src/ai/pipeline.rs index 2d6f7e4ba..72504ccbd 100644 --- a/ahnlich/types/src/ai/pipeline.rs +++ b/ahnlich/types/src/ai/pipeline.rs @@ -20,7 +20,9 @@ pub mod ai_query { #[prost(message, tag = "4")] CreatePredIndex(super::super::query::CreatePredIndex), #[prost(message, tag = "5")] - CreateNonLinearAlgorithmIndex(super::super::query::CreateNonLinearAlgorithmIndex), + CreateNonLinearAlgorithmIndex( + super::super::query::CreateNonLinearAlgorithmIndex, + ), #[prost(message, tag = "6")] DropPredIndex(super::super::query::DropPredIndex), #[prost(message, tag = "7")] @@ -44,7 +46,9 @@ pub mod ai_query { #[prost(message, tag = "16")] Ping(super::super::query::Ping), #[prost(message, tag = "17")] - ConvertStoreInputToEmbeddings(super::super::query::ConvertStoreInputToEmbeddings), + ConvertStoreInputToEmbeddings( + super::super::query::ConvertStoreInputToEmbeddings, + ), #[prost(message, tag = "18")] DelPred(super::super::query::DelPred), #[prost(message, tag = "19")] diff --git a/ahnlich/types/src/ai/query.rs b/ahnlich/types/src/ai/query.rs index cc7e62f1f..3cbd53147 100644 --- a/ahnlich/types/src/ai/query.rs +++ b/ahnlich/types/src/ai/query.rs @@ -22,8 +22,9 @@ pub struct CreateStore { pub predicates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// Optional non-linear indices #[prost(message, repeated, tag = "5")] - pub non_linear_indices: - ::prost::alloc::vec::Vec, + pub non_linear_indices: ::prost::alloc::vec::Vec< + super::super::algorithm::nonlinear::NonLinearIndex, + >, /// Whether to throw an error if the store already exists #[prost(bool, tag = "6")] pub error_if_exists: bool, @@ -60,10 +61,7 @@ pub struct GetSimN { #[prost(uint64, tag = "4")] pub closest_n: u64, /// Algorithm to use for similarity search - #[prost( - enumeration = "super::super::algorithm::algorithms::Algorithm", - tag = "5" - )] + #[prost(enumeration = "super::super::algorithm::algorithms::Algorithm", tag = "5")] pub algorithm: i32, /// Preprocessing actions to apply to input before querying #[prost(enumeration = "super::preprocess::PreprocessAction", tag = "6")] @@ -77,8 +75,10 @@ pub struct GetSimN { pub execution_provider: ::core::option::Option, /// Optional runtime parameters for the model (e.g., confidence_threshold for face detection) #[prost(map = "string, string", tag = "8")] - pub model_params: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + pub model_params: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreatePredIndex { @@ -100,8 +100,9 @@ pub struct CreateNonLinearAlgorithmIndex { pub store: ::prost::alloc::string::String, /// Non-linear indices to create #[prost(message, repeated, tag = "2")] - pub non_linear_indices: - ::prost::alloc::vec::Vec, + pub non_linear_indices: ::prost::alloc::vec::Vec< + super::super::algorithm::nonlinear::NonLinearIndex, + >, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct DropPredIndex { @@ -231,8 +232,10 @@ pub struct Set { pub execution_provider: ::core::option::Option, /// Optional runtime parameters for the model (e.g., confidence_threshold for face detection) #[prost(map = "string, string", tag = "5")] - pub model_params: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + pub model_params: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConvertStoreInputToEmbeddings { @@ -242,17 +245,15 @@ pub struct ConvertStoreInputToEmbeddings { #[prost(message, repeated, tag = "1")] pub store_inputs: ::prost::alloc::vec::Vec, /// Preprocessing actions to apply to input before querying - #[prost( - enumeration = "super::preprocess::PreprocessAction", - optional, - tag = "2" - )] + #[prost(enumeration = "super::preprocess::PreprocessAction", optional, tag = "2")] pub preprocess_action: ::core::option::Option, /// AI model used for querying (string or image-based) #[prost(enumeration = "super::models::AiModel", tag = "3")] pub model: i32, /// Optional runtime parameters for the model (e.g., confidence_threshold for face detection) #[prost(map = "string, string", tag = "4")] - pub model_params: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + pub model_params: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } diff --git a/ahnlich/types/src/ai/server.rs b/ahnlich/types/src/ai/server.rs index 2539184b3..4cb832ca0 100644 --- a/ahnlich/types/src/ai/server.rs +++ b/ahnlich/types/src/ai/server.rs @@ -59,7 +59,8 @@ pub struct CreateIndex { #[prost(uint64, tag = "1")] pub created_indexes: u64, } -#[derive(Eq, PartialOrd, Ord, Hash, Clone, PartialEq, ::prost::Message)] +#[derive(Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct AiStoreInfo { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, diff --git a/ahnlich/types/src/algorithm/nonlinear.rs b/ahnlich/types/src/algorithm/nonlinear.rs index e490a2e66..562178315 100644 --- a/ahnlich/types/src/algorithm/nonlinear.rs +++ b/ahnlich/types/src/algorithm/nonlinear.rs @@ -1,16 +1,6 @@ // This file is @generated by prost-build. -#[derive( - serde::Serialize, - serde::Deserialize, - Eq, - Hash, - PartialOrd, - Ord, - Clone, - Copy, - PartialEq, - ::prost::Message, -)] +#[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct HnswConfig { #[prost(enumeration = "super::algorithms::DistanceMetric", optional, tag = "1")] pub distance: ::core::option::Option, @@ -25,49 +15,19 @@ pub struct HnswConfig { #[prost(bool, optional, tag = "6")] pub keep_pruned_connections: ::core::option::Option, } -#[derive( - serde::Serialize, - serde::Deserialize, - Eq, - Hash, - PartialOrd, - Ord, - Clone, - Copy, - PartialEq, - ::prost::Message, -)] +#[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct KdTreeConfig {} -#[derive( - serde::Serialize, - serde::Deserialize, - Eq, - Hash, - PartialOrd, - Ord, - Clone, - Copy, - PartialEq, - ::prost::Message, -)] +#[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NonLinearIndex { #[prost(oneof = "non_linear_index::Index", tags = "1, 2")] pub index: ::core::option::Option, } /// Nested message and enum types in `NonLinearIndex`. pub mod non_linear_index { - #[derive( - serde::Serialize, - serde::Deserialize, - Eq, - Hash, - PartialOrd, - Ord, - Clone, - Copy, - PartialEq, - ::prost::Oneof, - )] + #[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Index { #[prost(message, tag = "1")] Hnsw(super::HnswConfig), @@ -75,19 +35,8 @@ pub mod non_linear_index { Kdtree(super::KdTreeConfig), } } -#[derive( - serde::Serialize, - serde::Deserialize, - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration, -)] +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum NonLinearAlgorithm { KdTree = 0, diff --git a/ahnlich/types/src/client.rs b/ahnlich/types/src/client.rs index ffd3f2b1a..f27b3845a 100644 --- a/ahnlich/types/src/client.rs +++ b/ahnlich/types/src/client.rs @@ -1,5 +1,6 @@ // This file is @generated by prost-build. -#[derive(PartialOrd, Ord, Eq, Clone, PartialEq, ::prost::Message)] +#[derive(PartialOrd, Ord, Eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectedClient { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, diff --git a/ahnlich/types/src/db/pipeline.rs b/ahnlich/types/src/db/pipeline.rs index f98cab8d6..228e1feeb 100644 --- a/ahnlich/types/src/db/pipeline.rs +++ b/ahnlich/types/src/db/pipeline.rs @@ -22,7 +22,9 @@ pub mod db_query { #[prost(message, tag = "5")] CreatePredIndex(super::super::query::CreatePredIndex), #[prost(message, tag = "6")] - CreateNonLinearAlgorithmIndex(super::super::query::CreateNonLinearAlgorithmIndex), + CreateNonLinearAlgorithmIndex( + super::super::query::CreateNonLinearAlgorithmIndex, + ), #[prost(message, tag = "7")] DropPredIndex(super::super::query::DropPredIndex), #[prost(message, tag = "8")] diff --git a/ahnlich/types/src/db/query.rs b/ahnlich/types/src/db/query.rs index e7f7a8efe..408e56968 100644 --- a/ahnlich/types/src/db/query.rs +++ b/ahnlich/types/src/db/query.rs @@ -14,8 +14,9 @@ pub struct CreateStore { pub create_predicates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// Non-linear algorithms for indexing. #[prost(message, repeated, tag = "4")] - pub non_linear_indices: - ::prost::alloc::vec::Vec, + pub non_linear_indices: ::prost::alloc::vec::Vec< + super::super::algorithm::nonlinear::NonLinearIndex, + >, /// Flag indicating whether to error if store already exists. #[prost(bool, tag = "5")] pub error_if_exists: bool, @@ -55,10 +56,7 @@ pub struct GetSimN { #[prost(uint64, tag = "3")] pub closest_n: u64, /// The algorithm to use for similarity computation. - #[prost( - enumeration = "super::super::algorithm::algorithms::Algorithm", - tag = "4" - )] + #[prost(enumeration = "super::super::algorithm::algorithms::Algorithm", tag = "4")] pub algorithm: i32, /// The predicate condition to apply. #[prost(message, optional, tag = "5")] @@ -84,8 +82,9 @@ pub struct CreateNonLinearAlgorithmIndex { pub store: ::prost::alloc::string::String, /// Non-linear algorithms to create indices for. #[prost(message, repeated, tag = "2")] - pub non_linear_indices: - ::prost::alloc::vec::Vec, + pub non_linear_indices: ::prost::alloc::vec::Vec< + super::super::algorithm::nonlinear::NonLinearIndex, + >, } /// Drops the specified predicates from the store. /// If `error_if_not_exists` is true, an error is returned if the predicate does not exist. diff --git a/ahnlich/types/src/db/server.rs b/ahnlich/types/src/db/server.rs index 16f60003d..8781f9ced 100644 --- a/ahnlich/types/src/db/server.rs +++ b/ahnlich/types/src/db/server.rs @@ -88,7 +88,8 @@ pub mod server_response { StoreInfo(super::StoreInfo), } } -#[derive(Hash, Eq, Ord, PartialOrd, Clone, PartialEq, ::prost::Message)] +#[derive(Hash, Eq, Ord, PartialOrd)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreInfo { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -97,8 +98,9 @@ pub struct StoreInfo { #[prost(uint64, tag = "3")] pub size_in_bytes: u64, #[prost(message, repeated, tag = "4")] - pub non_linear_indices: - ::prost::alloc::vec::Vec, + pub non_linear_indices: ::prost::alloc::vec::Vec< + super::super::algorithm::nonlinear::NonLinearIndex, + >, #[prost(string, repeated, tag = "5")] pub predicate_indices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(uint32, tag = "6")] diff --git a/ahnlich/types/src/keyval.rs b/ahnlich/types/src/keyval.rs index 6c5f7fb37..44b09f289 100644 --- a/ahnlich/types/src/keyval.rs +++ b/ahnlich/types/src/keyval.rs @@ -1,5 +1,6 @@ // This file is @generated by prost-build. -#[derive(Eq, Hash, Ord, PartialOrd, Clone, PartialEq, ::prost::Message)] +#[derive(Eq, Hash, Ord, PartialOrd)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreName { #[prost(string, tag = "1")] pub value: ::prost::alloc::string::String, @@ -42,9 +43,12 @@ pub struct AiStoreEntry { #[prost(message, optional, tag = "2")] pub value: ::core::option::Option, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreValue { #[prost(map = "string, message", tag = "1")] - pub value: - ::std::collections::HashMap<::prost::alloc::string::String, super::metadata::MetadataValue>, + pub value: ::std::collections::HashMap< + ::prost::alloc::string::String, + super::metadata::MetadataValue, + >, } diff --git a/ahnlich/types/src/lib.rs b/ahnlich/types/src/lib.rs index f84880258..9899d5967 100644 --- a/ahnlich/types/src/lib.rs +++ b/ahnlich/types/src/lib.rs @@ -10,4 +10,4 @@ pub mod services; pub mod shared; pub mod similarity; pub mod utils; -pub mod version; +pub mod version; \ No newline at end of file diff --git a/ahnlich/types/src/metadata.rs b/ahnlich/types/src/metadata.rs index 129d4d9a6..2fd5770fe 100644 --- a/ahnlich/types/src/metadata.rs +++ b/ahnlich/types/src/metadata.rs @@ -1,12 +1,14 @@ // This file is @generated by prost-build. -#[derive(PartialOrd, Ord, Hash, Eq, Clone, PartialEq, ::prost::Message)] +#[derive(PartialOrd, Ord, Hash, Eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct MetadataValue { #[prost(oneof = "metadata_value::Value", tags = "2, 3, 4")] pub value: ::core::option::Option, } /// Nested message and enum types in `MetadataValue`. pub mod metadata_value { - #[derive(PartialOrd, Ord, Hash, Eq, Clone, PartialEq, ::prost::Oneof)] + #[derive(PartialOrd, Ord, Hash, Eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(string, tag = "2")] RawString(::prost::alloc::string::String), diff --git a/ahnlich/types/src/services/ai_service.rs b/ahnlich/types/src/services/ai_service.rs index 63699c6af..28e886eed 100644 --- a/ahnlich/types/src/services/ai_service.rs +++ b/ahnlich/types/src/services/ai_service.rs @@ -6,10 +6,10 @@ pub mod ai_service_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value + clippy::let_unit_value, )] - use tonic::codegen::http::Uri; use tonic::codegen::*; + use tonic::codegen::http::Uri; #[derive(Debug, Clone)] pub struct AiServiceClient { inner: tonic::client::Grpc, @@ -48,13 +48,14 @@ pub mod ai_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, + http::Request, + Response = http::Response< + >::ResponseBody, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, { AiServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,38 +98,49 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/CreateStore"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/CreateStore", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "CreateStore", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "CreateStore")); self.inner.unary(req, path, codec).await } pub async fn create_pred_index( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::super::super::ai::query::CreatePredIndex, + >, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/CreatePredIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "CreatePredIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new("services.ai_service.AIService", "CreatePredIndex"), + ); self.inner.unary(req, path, codec).await } pub async fn create_non_linear_algorithm_index( @@ -140,32 +152,48 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/CreateNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "CreateNonLinearAlgorithmIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new( + "services.ai_service.AIService", + "CreateNonLinearAlgorithmIndex", + ), + ); self.inner.unary(req, path, codec).await } /// * Read methods * pub async fn get_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetKey"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/GetKey", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetKey")); @@ -174,14 +202,22 @@ pub mod ai_service_client { pub async fn get_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetPred"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/GetPred", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetPred")); @@ -194,12 +230,18 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetSimN"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/GetSimN", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetSimN")); @@ -212,12 +254,18 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetStore"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/GetStore", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetStore")); @@ -227,13 +275,22 @@ pub mod ai_service_client { pub async fn set( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/services.ai_service.AIService/Set"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/Set", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "Set")); @@ -242,21 +299,30 @@ pub mod ai_service_client { /// * Delete methods * pub async fn drop_pred_index( &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + request: impl tonic::IntoRequest< + super::super::super::ai::query::DropPredIndex, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/DropPredIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "DropPredIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new("services.ai_service.AIService", "DropPredIndex"), + ); self.inner.unary(req, path, codec).await } pub async fn drop_non_linear_algorithm_index( @@ -264,33 +330,51 @@ pub mod ai_service_client { request: impl tonic::IntoRequest< super::super::super::ai::query::DropNonLinearAlgorithmIndex, >, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/DropNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "DropNonLinearAlgorithmIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new( + "services.ai_service.AIService", + "DropNonLinearAlgorithmIndex", + ), + ); self.inner.unary(req, path, codec).await } pub async fn del_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DelKey"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/DelKey", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "DelKey")); @@ -299,14 +383,22 @@ pub mod ai_service_client { pub async fn del_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DelPred"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/DelPred", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "DelPred")); @@ -315,19 +407,25 @@ pub mod ai_service_client { pub async fn drop_store( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DropStore"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/DropStore", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "DropStore", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "DropStore")); self.inner.unary(req, path, codec).await } /// * Ancillary info methods * @@ -338,17 +436,21 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/ListClients"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/ListClients", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "ListClients", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "ListClients")); self.inner.unary(req, path, codec).await } pub async fn list_stores( @@ -358,17 +460,21 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/ListStores"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/ListStores", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "ListStores", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "ListStores")); self.inner.unary(req, path, codec).await } pub async fn info_server( @@ -378,35 +484,45 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/InfoServer"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/InfoServer", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "InfoServer", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "InfoServer")); self.inner.unary(req, path, codec).await } pub async fn purge_stores( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/PurgeStores"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/PurgeStores", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "PurgeStores", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "PurgeStores")); self.inner.unary(req, path, codec).await } pub async fn ping( @@ -416,11 +532,18 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/services.ai_service.AIService/Ping"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/Ping", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "Ping")); @@ -435,34 +558,50 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/ConvertStoreInputToEmbeddings", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.ai_service.AIService", - "ConvertStoreInputToEmbeddings", - )); + req.extensions_mut() + .insert( + GrpcMethod::new( + "services.ai_service.AIService", + "ConvertStoreInputToEmbeddings", + ), + ); self.inner.unary(req, path, codec).await } /// * Pipeline method for all methods * pub async fn pipeline( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::super::super::ai::pipeline::AiRequestPipeline, + >, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.ai_service.AIService/Pipeline"); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/Pipeline", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "Pipeline")); @@ -477,7 +616,7 @@ pub mod ai_service_server { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value + clippy::let_unit_value, )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with AiServiceServer. @@ -500,7 +639,9 @@ pub mod ai_service_server { >; async fn create_non_linear_algorithm_index( &self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::CreateNonLinearAlgorithmIndex, + >, ) -> std::result::Result< tonic::Response, tonic::Status, @@ -509,11 +650,17 @@ pub mod ai_service_server { async fn get_key( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn get_pred( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn get_sim_n( &self, request: tonic::Request, @@ -532,28 +679,48 @@ pub mod ai_service_server { async fn set( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// * Delete methods * async fn drop_pred_index( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn drop_non_linear_algorithm_index( &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + request: tonic::Request< + super::super::super::ai::query::DropNonLinearAlgorithmIndex, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn del_key( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn del_pred( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn drop_store( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// * Ancillary info methods * async fn list_clients( &self, @@ -579,7 +746,10 @@ pub mod ai_service_server { async fn purge_stores( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn ping( &self, request: tonic::Request, @@ -589,7 +759,9 @@ pub mod ai_service_server { >; async fn convert_store_input_to_embeddings( &self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::ConvertStoreInputToEmbeddings, + >, ) -> std::result::Result< tonic::Response, tonic::Status, @@ -624,7 +796,10 @@ pub mod ai_service_server { max_encoding_message_size: None, } } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService where F: tonic::service::Interceptor, { @@ -679,15 +854,21 @@ pub mod ai_service_server { "/services.ai_service.AIService/CreateStore" => { #[allow(non_camel_case_types)] struct CreateStoreSvc(pub Arc); - impl - tonic::server::UnaryService - for CreateStoreSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::CreateStore, + > for CreateStoreSvc { type Response = super::super::super::ai::server::Unit; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::CreateStore, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -721,12 +902,16 @@ pub mod ai_service_server { "/services.ai_service.AIService/CreatePredIndex" => { #[allow(non_camel_case_types)] struct CreatePredIndexSvc(pub Arc); - impl - tonic::server::UnaryService - for CreatePredIndexSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::CreatePredIndex, + > for CreatePredIndexSvc { type Response = super::super::super::ai::server::CreateIndex; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -765,13 +950,16 @@ pub mod ai_service_server { "/services.ai_service.AIService/CreateNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct CreateNonLinearAlgorithmIndexSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::ai::query::CreateNonLinearAlgorithmIndex, - > for CreateNonLinearAlgorithmIndexSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::CreateNonLinearAlgorithmIndex, + > for CreateNonLinearAlgorithmIndexSvc { type Response = super::super::super::ai::server::CreateIndex; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -780,7 +968,10 @@ pub mod ai_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_non_linear_algorithm_index(&inner, request) + ::create_non_linear_algorithm_index( + &inner, + request, + ) .await }; Box::pin(fut) @@ -811,19 +1002,25 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetKey" => { #[allow(non_camel_case_types)] struct GetKeySvc(pub Arc); - impl - tonic::server::UnaryService - for GetKeySvc - { + impl< + T: AiService, + > tonic::server::UnaryService + for GetKeySvc { type Response = super::super::super::ai::server::Get; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::GetKey, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_key(&inner, request).await }; + let fut = async move { + ::get_key(&inner, request).await + }; Box::pin(fut) } } @@ -852,19 +1049,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetPred" => { #[allow(non_camel_case_types)] struct GetPredSvc(pub Arc); - impl - tonic::server::UnaryService - for GetPredSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::GetPred, + > for GetPredSvc { type Response = super::super::super::ai::server::Get; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::GetPred, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_pred(&inner, request).await }; + let fut = async move { + ::get_pred(&inner, request).await + }; Box::pin(fut) } } @@ -893,19 +1097,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetSimN" => { #[allow(non_camel_case_types)] struct GetSimNSvc(pub Arc); - impl - tonic::server::UnaryService - for GetSimNSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::GetSimN, + > for GetSimNSvc { type Response = super::super::super::ai::server::GetSimN; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::GetSimN, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_sim_n(&inner, request).await }; + let fut = async move { + ::get_sim_n(&inner, request).await + }; Box::pin(fut) } } @@ -934,19 +1145,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetStore" => { #[allow(non_camel_case_types)] struct GetStoreSvc(pub Arc); - impl - tonic::server::UnaryService - for GetStoreSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::GetStore, + > for GetStoreSvc { type Response = super::super::super::ai::server::AiStoreInfo; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::GetStore, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_store(&inner, request).await }; + let fut = async move { + ::get_store(&inner, request).await + }; Box::pin(fut) } } @@ -975,18 +1193,23 @@ pub mod ai_service_server { "/services.ai_service.AIService/Set" => { #[allow(non_camel_case_types)] struct SetSvc(pub Arc); - impl - tonic::server::UnaryService - for SetSvc - { + impl< + T: AiService, + > tonic::server::UnaryService + for SetSvc { type Response = super::super::super::ai::server::Set; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::set(&inner, request).await }; + let fut = async move { + ::set(&inner, request).await + }; Box::pin(fut) } } @@ -1015,15 +1238,21 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropPredIndex" => { #[allow(non_camel_case_types)] struct DropPredIndexSvc(pub Arc); - impl - tonic::server::UnaryService - for DropPredIndexSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::DropPredIndex, + > for DropPredIndexSvc { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::DropPredIndex, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1057,13 +1286,16 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct DropNonLinearAlgorithmIndexSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::ai::query::DropNonLinearAlgorithmIndex, - > for DropNonLinearAlgorithmIndexSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::DropNonLinearAlgorithmIndex, + > for DropNonLinearAlgorithmIndexSvc { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -1072,7 +1304,10 @@ pub mod ai_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::drop_non_linear_algorithm_index(&inner, request) + ::drop_non_linear_algorithm_index( + &inner, + request, + ) .await }; Box::pin(fut) @@ -1103,19 +1338,25 @@ pub mod ai_service_server { "/services.ai_service.AIService/DelKey" => { #[allow(non_camel_case_types)] struct DelKeySvc(pub Arc); - impl - tonic::server::UnaryService - for DelKeySvc - { + impl< + T: AiService, + > tonic::server::UnaryService + for DelKeySvc { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::DelKey, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::del_key(&inner, request).await }; + let fut = async move { + ::del_key(&inner, request).await + }; Box::pin(fut) } } @@ -1144,19 +1385,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/DelPred" => { #[allow(non_camel_case_types)] struct DelPredSvc(pub Arc); - impl - tonic::server::UnaryService - for DelPredSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::DelPred, + > for DelPredSvc { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::DelPred, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::del_pred(&inner, request).await }; + let fut = async move { + ::del_pred(&inner, request).await + }; Box::pin(fut) } } @@ -1185,19 +1433,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropStore" => { #[allow(non_camel_case_types)] struct DropStoreSvc(pub Arc); - impl - tonic::server::UnaryService - for DropStoreSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::DropStore, + > for DropStoreSvc { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::DropStore, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::drop_store(&inner, request).await }; + let fut = async move { + ::drop_store(&inner, request).await + }; Box::pin(fut) } } @@ -1226,15 +1481,21 @@ pub mod ai_service_server { "/services.ai_service.AIService/ListClients" => { #[allow(non_camel_case_types)] struct ListClientsSvc(pub Arc); - impl - tonic::server::UnaryService - for ListClientsSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::ListClients, + > for ListClientsSvc { type Response = super::super::super::ai::server::ClientList; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::ListClients, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1268,19 +1529,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/ListStores" => { #[allow(non_camel_case_types)] struct ListStoresSvc(pub Arc); - impl - tonic::server::UnaryService - for ListStoresSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::ListStores, + > for ListStoresSvc { type Response = super::super::super::ai::server::StoreList; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::ListStores, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::list_stores(&inner, request).await }; + let fut = async move { + ::list_stores(&inner, request).await + }; Box::pin(fut) } } @@ -1309,19 +1577,26 @@ pub mod ai_service_server { "/services.ai_service.AIService/InfoServer" => { #[allow(non_camel_case_types)] struct InfoServerSvc(pub Arc); - impl - tonic::server::UnaryService - for InfoServerSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::InfoServer, + > for InfoServerSvc { type Response = super::super::super::ai::server::InfoServer; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::InfoServer, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::info_server(&inner, request).await }; + let fut = async move { + ::info_server(&inner, request).await + }; Box::pin(fut) } } @@ -1350,15 +1625,21 @@ pub mod ai_service_server { "/services.ai_service.AIService/PurgeStores" => { #[allow(non_camel_case_types)] struct PurgeStoresSvc(pub Arc); - impl - tonic::server::UnaryService - for PurgeStoresSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::PurgeStores, + > for PurgeStoresSvc { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::ai::query::PurgeStores, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1392,18 +1673,23 @@ pub mod ai_service_server { "/services.ai_service.AIService/Ping" => { #[allow(non_camel_case_types)] struct PingSvc(pub Arc); - impl - tonic::server::UnaryService - for PingSvc - { + impl< + T: AiService, + > tonic::server::UnaryService + for PingSvc { type Response = super::super::super::ai::server::Pong; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::ping(&inner, request).await }; + let fut = async move { + ::ping(&inner, request).await + }; Box::pin(fut) } } @@ -1432,13 +1718,16 @@ pub mod ai_service_server { "/services.ai_service.AIService/ConvertStoreInputToEmbeddings" => { #[allow(non_camel_case_types)] struct ConvertStoreInputToEmbeddingsSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::ai::query::ConvertStoreInputToEmbeddings, - > for ConvertStoreInputToEmbeddingsSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::ConvertStoreInputToEmbeddings, + > for ConvertStoreInputToEmbeddingsSvc { type Response = super::super::super::ai::server::StoreInputToEmbeddingsList; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -1447,7 +1736,10 @@ pub mod ai_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::convert_store_input_to_embeddings(&inner, request) + ::convert_store_input_to_embeddings( + &inner, + request, + ) .await }; Box::pin(fut) @@ -1478,13 +1770,16 @@ pub mod ai_service_server { "/services.ai_service.AIService/Pipeline" => { #[allow(non_camel_case_types)] struct PipelineSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::ai::pipeline::AiRequestPipeline, - > for PipelineSvc - { + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::pipeline::AiRequestPipeline, + > for PipelineSvc { type Response = super::super::super::ai::pipeline::AiResponsePipeline; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -1492,8 +1787,9 @@ pub mod ai_service_server { >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::pipeline(&inner, request).await }; + let fut = async move { + ::pipeline(&inner, request).await + }; Box::pin(fut) } } @@ -1519,19 +1815,23 @@ pub mod ai_service_server { }; Box::pin(fut) } - _ => Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }), + _ => { + Box::pin(async move { + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) + }) + } } } } diff --git a/ahnlich/types/src/services/db_service.rs b/ahnlich/types/src/services/db_service.rs index c73d1ecf5..d4d2cbdfa 100644 --- a/ahnlich/types/src/services/db_service.rs +++ b/ahnlich/types/src/services/db_service.rs @@ -6,10 +6,10 @@ pub mod db_service_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value + clippy::let_unit_value, )] - use tonic::codegen::http::Uri; use tonic::codegen::*; + use tonic::codegen::http::Uri; #[derive(Debug, Clone)] pub struct DbServiceClient { inner: tonic::client::Grpc, @@ -48,13 +48,14 @@ pub mod db_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, + http::Request, + Response = http::Response< + >::ResponseBody, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, { DbServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,38 +98,49 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/CreateStore"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/CreateStore", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "CreateStore", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.db_service.DBService", "CreateStore")); self.inner.unary(req, path, codec).await } pub async fn create_pred_index( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::super::super::db::query::CreatePredIndex, + >, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/CreatePredIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "CreatePredIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new("services.db_service.DBService", "CreatePredIndex"), + ); self.inner.unary(req, path, codec).await } pub async fn create_non_linear_algorithm_index( @@ -140,32 +152,48 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/CreateNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "CreateNonLinearAlgorithmIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new( + "services.db_service.DBService", + "CreateNonLinearAlgorithmIndex", + ), + ); self.inner.unary(req, path, codec).await } /// * Read methods * pub async fn get_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetKey"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/GetKey", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetKey")); @@ -174,14 +202,22 @@ pub mod db_service_client { pub async fn get_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetPred"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/GetPred", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetPred")); @@ -194,12 +230,18 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetSimN"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/GetSimN", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetSimN")); @@ -212,12 +254,18 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetStore"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/GetStore", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetStore")); @@ -227,13 +275,22 @@ pub mod db_service_client { pub async fn set( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/services.db_service.DBService/Set"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/Set", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "Set")); @@ -242,21 +299,30 @@ pub mod db_service_client { /// * Delete methods * pub async fn drop_pred_index( &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + request: impl tonic::IntoRequest< + super::super::super::db::query::DropPredIndex, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/DropPredIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "DropPredIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new("services.db_service.DBService", "DropPredIndex"), + ); self.inner.unary(req, path, codec).await } pub async fn drop_non_linear_algorithm_index( @@ -264,33 +330,51 @@ pub mod db_service_client { request: impl tonic::IntoRequest< super::super::super::db::query::DropNonLinearAlgorithmIndex, >, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/DropNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "DropNonLinearAlgorithmIndex", - )); + req.extensions_mut() + .insert( + GrpcMethod::new( + "services.db_service.DBService", + "DropNonLinearAlgorithmIndex", + ), + ); self.inner.unary(req, path, codec).await } pub async fn del_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/DelKey"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/DelKey", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "DelKey")); @@ -299,14 +383,22 @@ pub mod db_service_client { pub async fn del_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/DelPred"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/DelPred", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "DelPred")); @@ -315,19 +407,25 @@ pub mod db_service_client { pub async fn drop_store( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/DropStore"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/DropStore", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "DropStore", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.db_service.DBService", "DropStore")); self.inner.unary(req, path, codec).await } /// * Ancillary info methods * @@ -338,17 +436,21 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/ListClients"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/ListClients", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "ListClients", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.db_service.DBService", "ListClients")); self.inner.unary(req, path, codec).await } pub async fn list_stores( @@ -358,17 +460,21 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/ListStores"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/ListStores", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "ListStores", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.db_service.DBService", "ListStores")); self.inner.unary(req, path, codec).await } pub async fn info_server( @@ -378,17 +484,21 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/InfoServer"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/InfoServer", + ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "services.db_service.DBService", - "InfoServer", - )); + req.extensions_mut() + .insert(GrpcMethod::new("services.db_service.DBService", "InfoServer")); self.inner.unary(req, path, codec).await } pub async fn cluster_info( @@ -418,11 +528,18 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/services.db_service.DBService/Ping"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/Ping", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "Ping")); @@ -431,17 +548,25 @@ pub mod db_service_client { /// * Pipeline method for all methods * pub async fn pipeline( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::super::super::db::pipeline::DbRequestPipeline, + >, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) - })?; + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/services.db_service.DBService/Pipeline"); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/Pipeline", + ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "Pipeline")); @@ -456,7 +581,7 @@ pub mod db_service_server { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value + clippy::let_unit_value, )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with DbServiceServer. @@ -479,7 +604,9 @@ pub mod db_service_server { >; async fn create_non_linear_algorithm_index( &self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::CreateNonLinearAlgorithmIndex, + >, ) -> std::result::Result< tonic::Response, tonic::Status, @@ -488,11 +615,17 @@ pub mod db_service_server { async fn get_key( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn get_pred( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn get_sim_n( &self, request: tonic::Request, @@ -511,28 +644,48 @@ pub mod db_service_server { async fn set( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// * Delete methods * async fn drop_pred_index( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn drop_non_linear_algorithm_index( &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + request: tonic::Request< + super::super::super::db::query::DropNonLinearAlgorithmIndex, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn del_key( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn del_pred( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn drop_store( &self, request: tonic::Request, - ) -> std::result::Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// * Ancillary info methods * async fn list_clients( &self, @@ -599,7 +752,10 @@ pub mod db_service_server { max_encoding_message_size: None, } } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService where F: tonic::service::Interceptor, { @@ -654,15 +810,21 @@ pub mod db_service_server { "/services.db_service.DBService/CreateStore" => { #[allow(non_camel_case_types)] struct CreateStoreSvc(pub Arc); - impl - tonic::server::UnaryService - for CreateStoreSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::CreateStore, + > for CreateStoreSvc { type Response = super::super::super::db::server::Unit; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::CreateStore, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -696,12 +858,16 @@ pub mod db_service_server { "/services.db_service.DBService/CreatePredIndex" => { #[allow(non_camel_case_types)] struct CreatePredIndexSvc(pub Arc); - impl - tonic::server::UnaryService - for CreatePredIndexSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::CreatePredIndex, + > for CreatePredIndexSvc { type Response = super::super::super::db::server::CreateIndex; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -740,13 +906,16 @@ pub mod db_service_server { "/services.db_service.DBService/CreateNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct CreateNonLinearAlgorithmIndexSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::db::query::CreateNonLinearAlgorithmIndex, - > for CreateNonLinearAlgorithmIndexSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::CreateNonLinearAlgorithmIndex, + > for CreateNonLinearAlgorithmIndexSvc { type Response = super::super::super::db::server::CreateIndex; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -755,7 +924,10 @@ pub mod db_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_non_linear_algorithm_index(&inner, request) + ::create_non_linear_algorithm_index( + &inner, + request, + ) .await }; Box::pin(fut) @@ -786,19 +958,25 @@ pub mod db_service_server { "/services.db_service.DBService/GetKey" => { #[allow(non_camel_case_types)] struct GetKeySvc(pub Arc); - impl - tonic::server::UnaryService - for GetKeySvc - { + impl< + T: DbService, + > tonic::server::UnaryService + for GetKeySvc { type Response = super::super::super::db::server::Get; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::GetKey, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_key(&inner, request).await }; + let fut = async move { + ::get_key(&inner, request).await + }; Box::pin(fut) } } @@ -827,19 +1005,26 @@ pub mod db_service_server { "/services.db_service.DBService/GetPred" => { #[allow(non_camel_case_types)] struct GetPredSvc(pub Arc); - impl - tonic::server::UnaryService - for GetPredSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::GetPred, + > for GetPredSvc { type Response = super::super::super::db::server::Get; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::GetPred, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_pred(&inner, request).await }; + let fut = async move { + ::get_pred(&inner, request).await + }; Box::pin(fut) } } @@ -868,19 +1053,26 @@ pub mod db_service_server { "/services.db_service.DBService/GetSimN" => { #[allow(non_camel_case_types)] struct GetSimNSvc(pub Arc); - impl - tonic::server::UnaryService - for GetSimNSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::GetSimN, + > for GetSimNSvc { type Response = super::super::super::db::server::GetSimN; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::GetSimN, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_sim_n(&inner, request).await }; + let fut = async move { + ::get_sim_n(&inner, request).await + }; Box::pin(fut) } } @@ -909,19 +1101,26 @@ pub mod db_service_server { "/services.db_service.DBService/GetStore" => { #[allow(non_camel_case_types)] struct GetStoreSvc(pub Arc); - impl - tonic::server::UnaryService - for GetStoreSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::GetStore, + > for GetStoreSvc { type Response = super::super::super::db::server::StoreInfo; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::GetStore, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_store(&inner, request).await }; + let fut = async move { + ::get_store(&inner, request).await + }; Box::pin(fut) } } @@ -950,18 +1149,23 @@ pub mod db_service_server { "/services.db_service.DBService/Set" => { #[allow(non_camel_case_types)] struct SetSvc(pub Arc); - impl - tonic::server::UnaryService - for SetSvc - { + impl< + T: DbService, + > tonic::server::UnaryService + for SetSvc { type Response = super::super::super::db::server::Set; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::set(&inner, request).await }; + let fut = async move { + ::set(&inner, request).await + }; Box::pin(fut) } } @@ -990,15 +1194,21 @@ pub mod db_service_server { "/services.db_service.DBService/DropPredIndex" => { #[allow(non_camel_case_types)] struct DropPredIndexSvc(pub Arc); - impl - tonic::server::UnaryService - for DropPredIndexSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::DropPredIndex, + > for DropPredIndexSvc { type Response = super::super::super::db::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::DropPredIndex, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1032,13 +1242,16 @@ pub mod db_service_server { "/services.db_service.DBService/DropNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct DropNonLinearAlgorithmIndexSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::db::query::DropNonLinearAlgorithmIndex, - > for DropNonLinearAlgorithmIndexSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::DropNonLinearAlgorithmIndex, + > for DropNonLinearAlgorithmIndexSvc { type Response = super::super::super::db::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -1047,7 +1260,10 @@ pub mod db_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::drop_non_linear_algorithm_index(&inner, request) + ::drop_non_linear_algorithm_index( + &inner, + request, + ) .await }; Box::pin(fut) @@ -1078,19 +1294,25 @@ pub mod db_service_server { "/services.db_service.DBService/DelKey" => { #[allow(non_camel_case_types)] struct DelKeySvc(pub Arc); - impl - tonic::server::UnaryService - for DelKeySvc - { + impl< + T: DbService, + > tonic::server::UnaryService + for DelKeySvc { type Response = super::super::super::db::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::DelKey, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::del_key(&inner, request).await }; + let fut = async move { + ::del_key(&inner, request).await + }; Box::pin(fut) } } @@ -1119,19 +1341,26 @@ pub mod db_service_server { "/services.db_service.DBService/DelPred" => { #[allow(non_camel_case_types)] struct DelPredSvc(pub Arc); - impl - tonic::server::UnaryService - for DelPredSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::DelPred, + > for DelPredSvc { type Response = super::super::super::db::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::DelPred, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::del_pred(&inner, request).await }; + let fut = async move { + ::del_pred(&inner, request).await + }; Box::pin(fut) } } @@ -1160,19 +1389,26 @@ pub mod db_service_server { "/services.db_service.DBService/DropStore" => { #[allow(non_camel_case_types)] struct DropStoreSvc(pub Arc); - impl - tonic::server::UnaryService - for DropStoreSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::DropStore, + > for DropStoreSvc { type Response = super::super::super::db::server::Del; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::DropStore, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::drop_store(&inner, request).await }; + let fut = async move { + ::drop_store(&inner, request).await + }; Box::pin(fut) } } @@ -1201,15 +1437,21 @@ pub mod db_service_server { "/services.db_service.DBService/ListClients" => { #[allow(non_camel_case_types)] struct ListClientsSvc(pub Arc); - impl - tonic::server::UnaryService - for ListClientsSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::ListClients, + > for ListClientsSvc { type Response = super::super::super::db::server::ClientList; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::ListClients, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1243,19 +1485,26 @@ pub mod db_service_server { "/services.db_service.DBService/ListStores" => { #[allow(non_camel_case_types)] struct ListStoresSvc(pub Arc); - impl - tonic::server::UnaryService - for ListStoresSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::ListStores, + > for ListStoresSvc { type Response = super::super::super::db::server::StoreList; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::ListStores, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::list_stores(&inner, request).await }; + let fut = async move { + ::list_stores(&inner, request).await + }; Box::pin(fut) } } @@ -1284,19 +1533,26 @@ pub mod db_service_server { "/services.db_service.DBService/InfoServer" => { #[allow(non_camel_case_types)] struct InfoServerSvc(pub Arc); - impl - tonic::server::UnaryService - for InfoServerSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::InfoServer, + > for InfoServerSvc { type Response = super::super::super::db::server::InfoServer; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::db::query::InfoServer, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::info_server(&inner, request).await }; + let fut = async move { + ::info_server(&inner, request).await + }; Box::pin(fut) } } @@ -1370,18 +1626,23 @@ pub mod db_service_server { "/services.db_service.DBService/Ping" => { #[allow(non_camel_case_types)] struct PingSvc(pub Arc); - impl - tonic::server::UnaryService - for PingSvc - { + impl< + T: DbService, + > tonic::server::UnaryService + for PingSvc { type Response = super::super::super::db::server::Pong; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::ping(&inner, request).await }; + let fut = async move { + ::ping(&inner, request).await + }; Box::pin(fut) } } @@ -1410,13 +1671,16 @@ pub mod db_service_server { "/services.db_service.DBService/Pipeline" => { #[allow(non_camel_case_types)] struct PipelineSvc(pub Arc); - impl - tonic::server::UnaryService< - super::super::super::db::pipeline::DbRequestPipeline, - > for PipelineSvc - { + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::pipeline::DbRequestPipeline, + > for PipelineSvc { type Response = super::super::super::db::pipeline::DbResponsePipeline; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< @@ -1424,8 +1688,9 @@ pub mod db_service_server { >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::pipeline(&inner, request).await }; + let fut = async move { + ::pipeline(&inner, request).await + }; Box::pin(fut) } } @@ -1451,19 +1716,23 @@ pub mod db_service_server { }; Box::pin(fut) } - _ => Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }), + _ => { + Box::pin(async move { + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) + }) + } } } } From 264c9fc2bb1d17ba26d5676ad2e4ba71d57fccd6 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 22:30:06 +0100 Subject: [PATCH 02/28] types: add Schema newtype for logical store namespacing Introduce a `Schema` type wrapping a `String` to provide logical separation for stores in ahnlich. This is the foundation for issue #319 (multi-tenant store isolation). Key design decisions: - Newtype over `String` (not protobuf-generated), hand-written in `types/src/schema.rs`. - Default schema name is "public" to preserve backward compatibility with all existing stores. - Derives `Hash`, `Eq`, `Ord`, `Clone`, `Debug`, `Serialize`, `Deserialize` for use as a map key. - `From` and `From<&str>` for ergonomic construction. - Panics on empty name to prevent silent corruption. - Separate from the protobuf layer so we can evolve the schema model without regenerating proto types. This commit only adds the type; refactoring the store engine to use it comes next. --- ahnlich/db/src/engine/store.rs | 168 +++++++++++++++++++++++---------- ahnlich/types/src/lib.rs | 1 + ahnlich/types/src/schema.rs | 67 +++++++++++++ 3 files changed, 188 insertions(+), 48 deletions(-) create mode 100644 ahnlich/types/src/schema.rs diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index b4c0e2f5e..37e274561 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -11,6 +11,7 @@ use ahnlich_types::algorithm::nonlinear::{NonLinearAlgorithm, non_linear_index}; use ahnlich_types::db::server::StoreInfo; use ahnlich_types::keyval::StoreName; use ahnlich_types::keyval::{StoreKey, StoreValue}; +use ahnlich_types::schema::Schema; use ahnlich_types::predicates::{ self, Predicate, PredicateCondition, predicate::Kind as PredicateKind, }; @@ -101,31 +102,36 @@ impl AhnlichPersistenceUtils for StoreHandler { impl utils::size_calculation::SizeCalculationHandler for StoresSnapshot { #[tracing::instrument(skip(self))] fn recalculate_all_sizes(&self) { - for (store_name, store) in self.0.iter(&self.0.guard()) { - // Only recalculate if this store has been modified - if store - .size_dirty - .compare_exchange(true, false, Ordering::Relaxed, Ordering::Relaxed) - .is_ok() - { - let len = store.len(); - let size = store.size(); - store.cached_len.store(len as u64, Ordering::Relaxed); - store - .cached_size_bytes - .store(size as u64, Ordering::Relaxed); - log::trace!( - "Recalculated size for store '{}': {} entries, {} bytes", - store_name.value, - len, - size - ); + let guard = self.0.guard(); + for (_schema, inner_stores) in self.0.iter(&guard) { + let inner_guard = inner_stores.guard(); + for (store_name, store) in inner_stores.iter(&inner_guard) { + // Only recalculate if this store has been modified + if store + .size_dirty + .compare_exchange(true, false, Ordering::Relaxed, Ordering::Relaxed) + .is_ok() + { + let len = store.len(); + let size = store.size(); + store.cached_len.store(len as u64, Ordering::Relaxed); + store + .cached_size_bytes + .store(size as u64, Ordering::Relaxed); + log::trace!( + "Recalculated size for store '{}': {} entries, {} bytes", + store_name.value, + len, + size + ); + } } } } } -pub type Stores = Arc>>; +pub type InnerStores = Arc>>; +pub type Stores = Arc>; /// Newtype wrapper around Stores to implement SizeCalculationHandler /// (orphan rule prevents implementing foreign traits on Arc directly) @@ -179,12 +185,37 @@ impl StoreHandler { self.stores = stores_snapshot; } - /// Returns a store using the store name, else returns an error + /// Returns the inner stores map for a given schema, creating it if it does not exist. + fn get_or_create_schema(&self, schema: &Schema) -> InnerStores { + let guard = self.stores.guard(); + if let Some(inner) = self.stores.get(schema, &guard) { + return inner.clone(); + } + drop(guard); + let new_inner: InnerStores = fallible::try_new_arc_hashmap() + .expect("Failed to create inner stores map for schema"); + let guard = self.stores.guard(); + match self.stores.try_insert(schema.clone(), new_inner.clone(), &guard) { + Ok(_) => new_inner, + Err(existing) => existing.clone(), + } + } + + /// Returns the inner stores map for a given schema, or `None` if the schema does not exist. + fn get_schema(&self, schema: &Schema) -> Option { + self.stores + .get(schema, &self.stores.guard()) + .cloned() + } + + /// Returns a store using the store name and schema, else returns an error #[tracing::instrument(skip(self))] - fn get(&self, store_name: &StoreName) -> Result, ServerError> { - let store = self - .stores - .get(store_name, &self.stores.guard()) + fn get(&self, schema: &Schema, store_name: &StoreName) -> Result, ServerError> { + let inner_stores = self + .get_schema(schema) + .ok_or_else(|| ServerError::StoreNotFound(store_name.clone()))?; + let store = inner_stores + .get(store_name, &inner_stores.guard()) .cloned() .ok_or(ServerError::StoreNotFound(store_name.clone()))?; Ok(store) @@ -195,10 +226,11 @@ impl StoreHandler { pub(crate) fn create_pred_index( &self, store_name: &StoreName, + schema: &Schema, // TODO: create grpc datatype for metadata key predicates: Vec, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let created_predicates = store.create_pred_index(predicates); if created_predicates > 0 { self.set_write_flag() @@ -211,9 +243,10 @@ impl StoreHandler { pub(crate) fn create_non_linear_algorithm_index( &self, store_name: &StoreName, + schema: &Schema, non_linear_indices: StdHashSet, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let created_predicates = store.create_non_linear_algorithm_index(non_linear_indices); if created_predicates > 0 { self.set_write_flag() @@ -226,9 +259,10 @@ impl StoreHandler { pub(crate) fn del_key_in_store( &self, store_name: &StoreName, + schema: &Schema, keys: Vec, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let deleted = store.delete_keys(keys.clone())?; if deleted > 0 { self.set_write_flag(); @@ -241,9 +275,10 @@ impl StoreHandler { pub(crate) fn del_pred_in_store( &self, store_name: &StoreName, + schema: &Schema, condition: &PredicateCondition, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let deleted = store.delete_matches(condition)?; if deleted > 0 { self.set_write_flag(); @@ -256,12 +291,13 @@ impl StoreHandler { pub fn get_sim_in_store( &self, store_name: &StoreName, + schema: &Schema, search_input: StoreKey, closest_n: NonZeroUsize, algorithm: Algorithm, condition: Option, ) -> Result, ServerError> { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let store_dimension = store.dimension.get(); let input_dimension = search_input.key.len(); @@ -329,9 +365,10 @@ impl StoreHandler { pub fn get_pred_in_store( &self, store_name: &StoreName, + schema: &Schema, condition: &PredicateCondition, ) -> Result, ServerError> { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; store.get_matches(condition) } @@ -340,9 +377,10 @@ impl StoreHandler { pub(crate) fn get_key_in_store( &self, store_name: &StoreName, + schema: &Schema, keys: Vec, ) -> Result, ServerError> { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; store.get_keys(keys) } @@ -351,9 +389,10 @@ impl StoreHandler { pub fn set_in_store( &self, store_name: &StoreName, + schema: &Schema, new: Vec<(StoreKey, StoreValue)>, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let upsert = store.add(new)?; if upsert.modified() { self.set_write_flag(); @@ -364,9 +403,11 @@ impl StoreHandler { /// matches LISTSTORES - to return statistics of all stores #[tracing::instrument(skip(self))] pub(crate) fn list_stores(&self) -> StdHashSet { - self.stores - .iter(&self.stores.guard()) - .map(|(store_name, store)| { + let guard = self.stores.guard(); + let mut result = StdHashSet::new(); + for (_schema, inner_stores) in self.stores.iter(&guard) { + let inner_guard = inner_stores.guard(); + for (store_name, store) in inner_stores.iter(&inner_guard) { // Lazy initialization: if size is dirty (e.g., newly created store), // calculate it immediately. Background task will handle future updates. let (len, size_in_bytes) = if store.size_dirty.load(Ordering::Relaxed) { @@ -385,7 +426,7 @@ impl StoreHandler { ) }; - StoreInfo { + result.insert(StoreInfo { name: store_name.clone().value, len, size_in_bytes, @@ -397,15 +438,16 @@ impl StoreHandler { .sorted() .collect(), dimension: store.dimension.get() as u32, - } - }) - .collect() + }); + } + } + result } /// Matches GETSTORE - Returns detailed info for a single store by name #[tracing::instrument(skip(self))] - pub(crate) fn get_store(&self, store_name: &StoreName) -> Result { - let store = self.get(store_name)?; + pub(crate) fn get_store(&self, store_name: &StoreName, schema: &Schema) -> Result { + let store = self.get(schema, store_name)?; let (len, size_in_bytes) = if store.size_dirty.load(Ordering::Relaxed) { let len = store.len(); let size = store.size(); @@ -442,18 +484,19 @@ impl StoreHandler { pub fn create_store( &self, store_name: StoreName, + schema: Schema, dimension: NonZeroUsize, // FIXME: update metadata key with grpc type key predicates: Vec, non_linear_indices: StdHashSet, error_if_exists: bool, ) -> Result<(), ServerError> { - if self - .stores + let inner_stores = self.get_or_create_schema(&schema); + if inner_stores .try_insert( store_name.clone(), Arc::new(Store::create(dimension, predicates, non_linear_indices)), - &self.stores.guard(), + &inner_stores.guard(), ) .is_err() && error_if_exists @@ -469,10 +512,11 @@ impl StoreHandler { pub(crate) fn drop_pred_index_in_store( &self, store_name: &StoreName, + schema: &Schema, predicates: Vec, error_if_not_exists: bool, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let deleted = store.drop_predicates(predicates, error_if_not_exists)?; if deleted > 0 { self.set_write_flag(); @@ -486,10 +530,11 @@ impl StoreHandler { pub(crate) fn drop_non_linear_algorithm_index( &self, store_name: &StoreName, + schema: &Schema, non_linear_indices: StdHashSet, error_if_not_exists: bool, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let deleted = store .non_linear_indices .remove_indices(non_linear_indices, error_if_not_exists)?; @@ -504,9 +549,15 @@ impl StoreHandler { pub(crate) fn drop_store( &self, store_name: StoreName, + schema: &Schema, error_if_not_exists: bool, ) -> Result { - let pinned = self.stores.pin(); + let inner_stores = match self.get_schema(schema) { + Some(inner) => inner, + None if error_if_not_exists => return Err(ServerError::StoreNotFound(store_name)), + None => return Ok(0), + }; + let pinned = inner_stores.pin(); let removed = pinned.remove(&store_name).is_some(); if !removed && error_if_not_exists { return Err(ServerError::StoreNotFound(store_name)); @@ -519,6 +570,27 @@ impl StoreHandler { }; Ok(removed) } + + /// Drops all stores within a schema and removes the schema. + /// Returns the number of stores dropped. + #[tracing::instrument(skip(self))] + pub(crate) fn drop_schema(&self, schema: &Schema) -> Result { + if schema.as_str() == Schema::DEFAULT_NAME { + return Err(ServerError::InvalidArgument( + "Cannot drop the default 'public' schema".to_owned(), + )); + } + let pinned = self.stores.pin(); + let removed = pinned.remove(schema); + match removed { + Some(inner) => { + let count = inner.pin().len(); + self.set_write_flag(); + Ok(count) + } + None => Ok(0), + } + } } /// A Store is a single database containing multiple N*1 arrays where N is the dimension of the diff --git a/ahnlich/types/src/lib.rs b/ahnlich/types/src/lib.rs index 9899d5967..088e31ebd 100644 --- a/ahnlich/types/src/lib.rs +++ b/ahnlich/types/src/lib.rs @@ -5,6 +5,7 @@ pub mod db; pub mod keyval; pub mod metadata; pub mod predicates; +pub mod schema; pub mod server_types; pub mod services; pub mod shared; diff --git a/ahnlich/types/src/schema.rs b/ahnlich/types/src/schema.rs new file mode 100644 index 000000000..a1b8284b0 --- /dev/null +++ b/ahnlich/types/src/schema.rs @@ -0,0 +1,67 @@ +use serde::{Deserialize, Serialize}; +use std::fmt; + +/// A logical namespace for grouping stores within ahnlich. +/// +/// Schemas provide multi-tenant isolation and organizational hierarchy +/// on top of the flat store namespace. Every store belongs to exactly +/// one schema. The schema `"public"` is the default used when none is +/// specified, preserving backward compatibility with existing stores. +#[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize)] +pub struct Schema(String); + +impl Schema { + /// The default schema name used when no schema is specified. + pub const DEFAULT_NAME: &'static str = "public"; + + /// Creates a new `Schema` with the given name. + /// + /// # Panics + /// + /// Panics if `name` is empty. + pub fn new(name: impl Into) -> Self { + let name = name.into(); + assert!(!name.is_empty(), "Schema name cannot be empty"); + Self(name) + } + + /// Returns the schema name as a string slice. + pub fn as_str(&self) -> &str { + &self.0 + } + + /// Consumes the schema, returning the inner string. + pub fn into_inner(self) -> String { + self.0 + } +} + +impl Default for Schema { + fn default() -> Self { + Self(Self::DEFAULT_NAME.to_string()) + } +} + +impl fmt::Display for Schema { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(&self.0) + } +} + +impl From for Schema { + fn from(s: String) -> Self { + Self::new(s) + } +} + +impl From<&str> for Schema { + fn from(s: &str) -> Self { + Self::new(s) + } +} + +impl AsRef for Schema { + fn as_ref(&self) -> &str { + &self.0 + } +} From 41b05d87779cff8dd94edc849477a77a7f6775b2 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 22:44:35 +0100 Subject: [PATCH 03/28] db: fix type inference and use existing.current.clone() in nested schema map Address two compilation issues in the DB store handler refactoring: - Use `existing.current.clone()` instead of `existing.clone()` on papaya's `OccupiedError` (which does not implement Clone). - Resolve type inference for `inner.pin().len()` in `drop_schema`. Update operations.rs and handler.rs pass `Schema::default()` in all `StoreHandler` method calls, since the protobuf layer does not yet carry a schema field. This maintains full backward compatibility: every store operation implicitly targets the `"public"` schema. --- ahnlich/db/src/engine/operations.rs | 18 +++++++++++++++--- ahnlich/db/src/engine/store.rs | 2 +- ahnlich/db/src/server/handler.rs | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ahnlich/db/src/engine/operations.rs b/ahnlich/db/src/engine/operations.rs index 7d518c921..78227a1d8 100644 --- a/ahnlich/db/src/engine/operations.rs +++ b/ahnlich/db/src/engine/operations.rs @@ -1,10 +1,13 @@ use std::collections::HashMap; +use std::collections::HashSet as StdHashSet; use std::num::NonZeroUsize; +use ahnlich_types::algorithm::nonlinear::non_linear_index; use ahnlich_types::algorithm::nonlinear::NonLinearAlgorithm; use ahnlich_types::db::query; use ahnlich_types::db::server; use ahnlich_types::keyval::{StoreKey, StoreName, StoreValue}; +use ahnlich_types::schema::Schema; use ahnlich_types::shared::info::StoreUpsert; use itertools::Itertools; use rayon::iter::{IntoParallelIterator, ParallelIterator}; @@ -20,7 +23,7 @@ pub fn create_store( ServerError::InvalidArgument("dimension must be greater than 0".to_owned()) })?; - let non_linear_indices = params + let non_linear_indices: StdHashSet = params .non_linear_indices .into_iter() .filter_map(|index| index.index) @@ -30,6 +33,7 @@ pub fn create_store( StoreName { value: params.store, }, + Schema::default(), dimensions, params.create_predicates, non_linear_indices, @@ -45,6 +49,7 @@ pub fn create_pred_index( &StoreName { value: params.store, }, + &Schema::default(), params.predicates, ) } @@ -53,7 +58,7 @@ pub fn create_non_linear_algorithm_index( store_handler: &StoreHandler, params: query::CreateNonLinearAlgorithmIndex, ) -> Result { - let non_linear_indices = params + let non_linear_indices: StdHashSet = params .non_linear_indices .into_iter() .filter_map(|val| val.index) @@ -63,6 +68,7 @@ pub fn create_non_linear_algorithm_index( &StoreName { value: params.store, }, + &Schema::default(), non_linear_indices, ) } @@ -75,6 +81,7 @@ pub fn drop_pred_index( &StoreName { value: params.store, }, + &Schema::default(), params.predicates, params.error_if_not_exists, ) @@ -84,7 +91,7 @@ pub fn drop_non_linear_algorithm_index( store_handler: &StoreHandler, params: query::DropNonLinearAlgorithmIndex, ) -> Result { - let non_linear_indices = params + let non_linear_indices: StdHashSet = params .non_linear_indices .into_iter() .filter_map(|val| NonLinearAlgorithm::try_from(val).ok()) @@ -94,6 +101,7 @@ pub fn drop_non_linear_algorithm_index( &StoreName { value: params.store, }, + &Schema::default(), non_linear_indices, params.error_if_not_exists, ) @@ -110,6 +118,7 @@ pub fn del_key(store_handler: &StoreHandler, params: query::DelKey) -> Result Result new_inner, - Err(existing) => existing.clone(), + Err(existing) => existing.current.clone(), } } diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 83e70fe4f..5f7a2a092 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -14,6 +14,7 @@ use ahnlich_replication::types::DbCommand; use ahnlich_types::db::pipeline::db_query::Query; use ahnlich_types::db::server::GetSimNEntry; use ahnlich_types::keyval::{DbStoreEntry, StoreKey, StoreName}; +use ahnlich_types::schema::Schema; use ahnlich_types::services::db_service::db_service_server::{DbService, DbServiceServer}; use ahnlich_types::shared::cluster::{ClusterInfoQuery, ClusterInfoResponse}; use ahnlich_types::shared::info::ErrorResponse; From 2b98e7a6b81d5a33718e6723ab04280fdaed4a78 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 22:44:44 +0100 Subject: [PATCH 04/28] ai/engine: refactor AIStoreHandler to use nested Schema maps Apply the same nested-map pattern from db StoreHandler to AIStoreHandler: - Change AIStores from `Map` to `Map>`. - Add `AIInnerStores` type alias. - Add `get_or_create_schema()` and `get_schema()` helpers. - Update `create_store()`, `get()`, `list_stores()`, `get_store()`, `set()`, `validate_and_prepare_store_data()`, `get_ndarray_repr_for_store()`, `drop_store()`, `store_original()`, and `purge_stores()` to accept and use a schema parameter. - Add `drop_schema()` method (guarded: cannot drop "public"). - Add `AIProxyError::InvalidArgument(String)` variant for schema guard rejection. All existing callers pass `Schema::default()` for backward compatibility. --- ahnlich/ai/src/engine/store.rs | 128 ++++++++++++++++++++++++--------- ahnlich/ai/src/error.rs | 6 +- 2 files changed, 100 insertions(+), 34 deletions(-) diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 458dc800f..5fe373379 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -16,6 +16,7 @@ use ahnlich_types::keyval::StoreName; use ahnlich_types::keyval::StoreValue; use ahnlich_types::metadata::MetadataValue; use ahnlich_types::metadata::metadata_value; +use ahnlich_types::schema::Schema; use fallible_collections::FallibleVec; use papaya::HashMap as ConcurrentHashMap; use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator}; @@ -41,7 +42,8 @@ pub struct AIStoreHandler { supported_models: Vec, } -pub type AIStores = Arc>>; +pub type AIInnerStores = Arc>>; +pub type AIStores = Arc>; type StoreSetResponse = (Vec, Option>); type StoreValidateResponse = ( @@ -65,10 +67,10 @@ impl AhnlichPersistenceUtils for AIStoreHandler { impl AIStoreHandler { pub fn new(write_flag: Arc, supported_models: Vec) -> Self { Self { - stores: Arc::new(fallible::try_new_hashmap().unwrap_or_else(|e| { + stores: fallible::try_new_arc_hashmap().unwrap_or_else(|e| { eprintln!("Fatal: Failed to create AIStoreHandler stores: {e}"); std::process::abort(); - })), + }), write_flag, supported_models, } @@ -86,10 +88,47 @@ impl AIStoreHandler { self.stores = stores_snapshot; } + /// Returns the inner stores map for a given schema, creating it if it does not exist. + fn get_or_create_schema(&self, schema: &Schema) -> AIInnerStores { + let guard = self.stores.guard(); + if let Some(inner) = self.stores.get(schema, &guard) { + return AIInnerStores::clone(inner); + } + drop(guard); + let new_inner: AIInnerStores = fallible::try_new_arc_hashmap() + .expect("Failed to create inner AI stores map for schema"); + let guard = self.stores.guard(); + match self.stores.try_insert(schema.clone(), new_inner.clone(), &guard) { + Ok(_) => new_inner, + Err(existing) => existing.current.clone(), + } + } + + /// Returns the inner stores map for a given schema, or `None` if the schema does not exist. + fn get_schema(&self, schema: &Schema) -> Option { + self.stores + .get(schema, &self.stores.guard()) + .cloned() + } + + /// Returns a store using the store name and schema, else returns an error + #[tracing::instrument(skip(self))] + pub(crate) fn get(&self, schema: &Schema, store_name: &StoreName) -> Result, AIProxyError> { + let inner_stores = self + .get_schema(schema) + .ok_or_else(|| AIProxyError::StoreNotFound(store_name.clone()))?; + let store = inner_stores + .get(store_name, &inner_stores.guard()) + .cloned() + .ok_or(AIProxyError::StoreNotFound(store_name.clone()))?; + Ok(store) + } + #[tracing::instrument(skip(self))] pub(crate) fn create_store( &self, store_name: StoreName, + schema: Schema, query_model: AiModel, index_model: AiModel, error_if_exists: bool, @@ -111,8 +150,8 @@ impl AIStoreHandler { }); } - if self - .stores + let inner_stores = self.get_or_create_schema(&schema); + if inner_stores .try_insert( store_name.clone(), Arc::new(AIStore::create( @@ -121,7 +160,7 @@ impl AIStoreHandler { index_model, store_original, )), - &self.stores.guard(), + &inner_stores.guard(), ) .is_err() && error_if_exists @@ -135,13 +174,16 @@ impl AIStoreHandler { /// matches LISTSTORES - to return statistics of all stores #[tracing::instrument(skip(self))] pub(crate) fn list_stores(&self) -> StdHashSet { - self.stores - .iter(&self.stores.guard()) - .map(|(store_name, store)| { + let guard = self.stores.guard(); + let mut result = StdHashSet::new(); + for (_schema, inner_stores) in self.stores.iter(&guard) { + let inner_stores: &AIInnerStores = inner_stores; + let inner_guard = inner_stores.guard(); + for (store_name, store) in inner_stores.iter(&inner_guard) { let model: ModelDetails = SupportedModels::from(&store.index_model).to_model_details(); - AiStoreInfo { + result.insert(AiStoreInfo { name: store_name.value.clone(), query_model: store.query_model.into(), index_model: store.index_model.into(), @@ -149,15 +191,16 @@ impl AIStoreHandler { predicate_indices: vec![], dimension: model.embedding_size.get() as u32, db_info: None, - } - }) - .collect() + }); + } + } + result } /// matches GETSTORE - to return info for a single store #[tracing::instrument(skip(self))] - pub(crate) fn get_store(&self, store_name: &StoreName) -> Result { - let store = self.get(store_name)?; + pub(crate) fn get_store(&self, store_name: &StoreName, schema: &Schema) -> Result { + let store = self.get(schema, store_name)?; let model: ModelDetails = SupportedModels::from(&store.index_model).to_model_details(); Ok(AiStoreInfo { name: store_name.value.clone(), @@ -170,25 +213,15 @@ impl AIStoreHandler { }) } - /// Returns a store using the store name, else returns an error - #[tracing::instrument(skip(self))] - pub(crate) fn get(&self, store_name: &StoreName) -> Result, AIProxyError> { - let store = self - .stores - .get(store_name, &self.stores.guard()) - .cloned() - .ok_or(AIProxyError::StoreNotFound(store_name.clone()))?; - Ok(store) - } - /// Validates storeinputs against a store and checks storevalue for reservedkey. #[tracing::instrument(skip(self, inputs), fields(input_length=inputs.len(), num_threads = rayon::current_num_threads()))] pub(crate) fn validate_and_prepare_store_data( &self, store_name: &StoreName, + schema: &Schema, inputs: Vec<(StoreInput, StoreValue)>, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let index_model = store.index_model; let chunk_size = parallel::chunk_size(inputs.len()); inputs @@ -258,18 +291,19 @@ impl AIStoreHandler { pub(crate) async fn set( &self, store_name: &StoreName, + schema: &Schema, inputs: Vec<(StoreInput, StoreValue)>, model_manager: &ModelManager, preprocess_action: PreprocessAction, execution_provider: Option, model_params: std::collections::HashMap, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; if inputs.is_empty() { return Ok((vec![], None)); } let (validated_data, delete_hashset) = - self.validate_and_prepare_store_data(store_name, inputs)?; + self.validate_and_prepare_store_data(store_name, schema, inputs)?; let (store_inputs, store_values): (Vec<_>, Vec<_>) = validated_data.into_iter().unzip(); let store_keys = model_manager @@ -386,13 +420,14 @@ impl AIStoreHandler { pub(crate) async fn get_ndarray_repr_for_store( &self, store_name: &StoreName, + schema: &Schema, store_input: StoreInput, model_manager: &ModelManager, preprocess_action: PreprocessAction, execution_provider: Option, model_params: std::collections::HashMap, ) -> Result { - let store = self.get(store_name)?; + let store = self.get(schema, store_name)?; let mut store_keys = model_manager .handle_request( &store.query_model, @@ -422,9 +457,15 @@ impl AIStoreHandler { pub(crate) fn drop_store( &self, store_name: StoreName, + schema: &Schema, error_if_not_exists: bool, ) -> Result { - let pinned = self.stores.pin(); + let inner_stores = match self.get_schema(schema) { + Some(inner) => inner, + None if error_if_not_exists => return Err(AIProxyError::StoreNotFound(store_name)), + None => return Ok(0), + }; + let pinned = inner_stores.pin(); let removed = pinned.remove(&store_name).is_some(); if !removed && error_if_not_exists { return Err(AIProxyError::StoreNotFound(store_name)); @@ -438,9 +479,30 @@ impl AIStoreHandler { Ok(removed) } + /// Drops all stores within a schema and removes the schema. + /// Returns the number of stores dropped. + #[tracing::instrument(skip(self))] + pub(crate) fn drop_schema(&self, schema: &Schema) -> Result { + if schema.as_str() == Schema::DEFAULT_NAME { + return Err(AIProxyError::InvalidArgument( + "Cannot drop the default 'public' schema".to_owned(), + )); + } + let pinned = self.stores.pin(); + let removed = pinned.remove(schema); + match removed { + Some(inner) => { + let count = inner.pin().len(); + self.set_write_flag(); + Ok(count) + } + None => Ok(0), + } + } + #[tracing::instrument(skip(self))] - pub(crate) fn store_original(&self, store_name: StoreName) -> Result { - let store = self.get(&store_name)?; + pub(crate) fn store_original(&self, store_name: StoreName, schema: &Schema) -> Result { + let store = self.get(schema, &store_name)?; Ok(store.store_original) } diff --git a/ahnlich/ai/src/error.rs b/ahnlich/ai/src/error.rs index 507a14839..01a67a69d 100644 --- a/ahnlich/ai/src/error.rs +++ b/ahnlich/ai/src/error.rs @@ -182,6 +182,9 @@ pub enum AIProxyError { #[error("Cannot call DelKey on store with `store_original` as false")] DelKeyError, + #[error("Invalid argument: {0}")] + InvalidArgument(String), + #[error("Tokenizer for model failed to load: {message}")] ModelTokenizerLoadError { message: String }, @@ -233,7 +236,8 @@ impl From for Status { | AIProxyError::FaceModelNoPreprocessingError | AIProxyError::UnknownEnumValue(_) | AIProxyError::InputNotSpecified(_) - | AIProxyError::MultipleEmbeddingsForQuery(_) => Code::InvalidArgument, + | AIProxyError::MultipleEmbeddingsForQuery(_) => Code::InvalidArgument, + AIProxyError::InvalidArgument(_) => Code::InvalidArgument, AIProxyError::TokenExceededError { max_token_size: _, input_token_size: _, From 0bb339e29aca58f4009334a286696d21a61c677a Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 22:44:54 +0100 Subject: [PATCH 05/28] ai: update operations and server handler to pass default schema Update all AI operations and the AI server handler to pass `Schema::default()` in direct `AIStoreHandler` method calls. This completes the schema-aware refactoring of the AI proxy layer. All existing store operations continue to target the `"public"` schema until the protobuf layer carries an explicit schema field. --- ahnlich/ai/src/engine/operations.rs | 9 ++++++--- ahnlich/ai/src/server/handler.rs | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index c1d27b777..4b05dfac5 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -28,6 +28,7 @@ use ahnlich_types::{ In, Predicate, PredicateCondition, predicate::Kind as PredicateKind, predicate_condition::Kind, }, + schema::Schema, }; use itertools::Itertools; use rayon::prelude::*; @@ -107,6 +108,7 @@ pub async fn create_store( StoreName { value: params.store, }, + Schema::default(), query_model, index_model, params.error_if_exists, @@ -176,6 +178,7 @@ pub async fn set( &StoreName { value: params.store.clone(), }, + &Schema::default(), params .inputs .into_par_iter() @@ -290,7 +293,7 @@ pub async fn del_key( ) -> Result { let store_original = store_handler.store_original(StoreName { value: params.store.clone(), - })?; + }, &Schema::default())?; if !store_original { return Err(AIProxyError::DelKeyError.into()); } @@ -354,7 +357,7 @@ pub async fn drop_store( value: params.store, }; - if store_handler.get(&store_name).is_ok() + if store_handler.get(&Schema::default(), &store_name).is_ok() && let Some(db_client) = db_client { db_client @@ -368,7 +371,7 @@ pub async fn drop_store( .await?; } - let dropped = store_handler.drop_store(store_name, params.error_if_not_exists)?; + let dropped = store_handler.drop_store(store_name, &Schema::default(), params.error_if_not_exists)?; Ok(Del { deleted_count: dropped as u64, }) diff --git a/ahnlich/ai/src/server/handler.rs b/ahnlich/ai/src/server/handler.rs index 1e340006f..16852c9eb 100644 --- a/ahnlich/ai/src/server/handler.rs +++ b/ahnlich/ai/src/server/handler.rs @@ -336,6 +336,7 @@ impl AiService for AIProxyServer { &StoreName { value: params.store.clone(), }, + &ahnlich_types::schema::Schema::default(), search_input, &self.model_manager, TryInto::::try_into(params.preprocess_action) @@ -506,7 +507,7 @@ impl AiService for AIProxyServer { let params = request.into_inner(); let mut store_info = self.store_handler.get_store(&StoreName { value: params.store.clone(), - })?; + }, &ahnlich_types::schema::Schema::default())?; // Enrich with predicate indices and db_info from DB, filtering out reserved keys if let Some(db_client) = &self.db_client { let parent_id = tracer::span_to_trace_parent(tracing::Span::current()); From 8297ea3420aafd38c97b7671ed5e99e30c5b5611 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 22:51:39 +0100 Subject: [PATCH 06/28] types(build): preserve schema.rs from build script deletion The types crate's build.rs deletes all files in `src/` except `utils/` before regenerating protobuf code. This caused our hand-written `schema.rs` to be silently deleted on every `cargo build/check`, and caused `pub mod schema;` to be omitted from `lib.rs`. Fix the deletion loop to also preserve `schema.rs`, and add `"schema"` to the module-name set written into `lib.rs`. Also fix type inference for `inner.pin().len()` in both `StoreHandler::drop_schema` and `AIStoreHandler::drop_schema` by binding the pin guard to a local variable first. --- ahnlich/ai/src/engine/store.rs | 3 ++- ahnlich/db/src/engine/store.rs | 3 ++- ahnlich/types/build.rs | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 5fe373379..53cbb9068 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -492,7 +492,8 @@ impl AIStoreHandler { let removed = pinned.remove(schema); match removed { Some(inner) => { - let count = inner.pin().len(); + let pinned = inner.pin(); + let count = pinned.len(); self.set_write_flag(); Ok(count) } diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index 597449c82..12c4390a2 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -584,7 +584,8 @@ impl StoreHandler { let removed = pinned.remove(schema); match removed { Some(inner) => { - let count = inner.pin().len(); + let pinned = inner.pin(); + let count = pinned.len(); self.set_write_flag(); Ok(count) } diff --git a/ahnlich/types/build.rs b/ahnlich/types/build.rs index 9ccaa4a57..719814d43 100644 --- a/ahnlich/types/build.rs +++ b/ahnlich/types/build.rs @@ -38,7 +38,12 @@ fn main() -> Result<()> { if let Ok(entries) = std::fs::read_dir(out_dir) { for entry in entries.filter_map(Result::ok) { let path = entry.path(); - if path.file_name().is_some_and(|name| name != "utils") { + let preserve = [ + "utils", + "schema.rs", + ]; + if path.file_name().is_some_and(|name| !preserve.contains(&name.to_str().unwrap_or(""))) + { if path.is_dir() { std::fs::remove_dir_all(&path).expect("Failed to remove directory"); } else { @@ -172,6 +177,7 @@ fn restructure_generated_code(out_dir: &PathBuf, file: &mut std::fs::File) { } module_names.insert("utils"); + module_names.insert("schema"); let buffer = module_names .into_iter() From 02f923362229b2f453caaa924d350b513c1befd6 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 12 Jun 2026 23:16:31 +0100 Subject: [PATCH 07/28] fix: remove schema parameter from all store handler methods The schema parameter was added to all store handler methods in a previous commit, but threading &Schema through every method signature introduced too_many_arguments and leaked schema handling into every caller. Each handler already holds a default_schema field that methods use implicitly. - Remove schema param from StoreHandler: create_store, create_pred_index, create_non_linear_algorithm_index, del_key_in_store, del_pred_in_store, get_sim_in_store, get_pred_in_store, get_key_in_store, set_in_store, get_store, drop_pred_index_in_store, drop_non_linear_algorithm_index, drop_store. - Remove schema param from AIStoreHandler: get, create_store, get_store, validate_and_prepare_store_data, set, get_ndarray_repr_for_store, drop_store, store_original. - Add default_schema field to AIStoreHandler struct and new(). - Drop #[allow(clippy::too_many_arguments)] on set and get_ndarray_repr_for_store. - Update all callers to stop passing &Schema::default(). - Fix del_pred_in_store incorrectly named create_pred_index. - Remove unused Schema imports. --- ahnlich/ai/src/engine/operations.rs | 9 ++---- ahnlich/ai/src/engine/store.rs | 31 ++++++++---------- ahnlich/ai/src/server/handler.rs | 3 +- ahnlich/db/src/engine/operations.rs | 10 ------ ahnlich/db/src/engine/store.rs | 50 +++++++++++------------------ ahnlich/db/src/server/handler.rs | 1 - 6 files changed, 37 insertions(+), 67 deletions(-) diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index 4b05dfac5..c1d27b777 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -28,7 +28,6 @@ use ahnlich_types::{ In, Predicate, PredicateCondition, predicate::Kind as PredicateKind, predicate_condition::Kind, }, - schema::Schema, }; use itertools::Itertools; use rayon::prelude::*; @@ -108,7 +107,6 @@ pub async fn create_store( StoreName { value: params.store, }, - Schema::default(), query_model, index_model, params.error_if_exists, @@ -178,7 +176,6 @@ pub async fn set( &StoreName { value: params.store.clone(), }, - &Schema::default(), params .inputs .into_par_iter() @@ -293,7 +290,7 @@ pub async fn del_key( ) -> Result { let store_original = store_handler.store_original(StoreName { value: params.store.clone(), - }, &Schema::default())?; + })?; if !store_original { return Err(AIProxyError::DelKeyError.into()); } @@ -357,7 +354,7 @@ pub async fn drop_store( value: params.store, }; - if store_handler.get(&Schema::default(), &store_name).is_ok() + if store_handler.get(&store_name).is_ok() && let Some(db_client) = db_client { db_client @@ -371,7 +368,7 @@ pub async fn drop_store( .await?; } - let dropped = store_handler.drop_store(store_name, &Schema::default(), params.error_if_not_exists)?; + let dropped = store_handler.drop_store(store_name, params.error_if_not_exists)?; Ok(Del { deleted_count: dropped as u64, }) diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 53cbb9068..ddb57c923 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -39,6 +39,7 @@ pub struct AIStoreHandler { /// Making use of a concurrent hashmap, we should be able to create an engine that manages stores stores: AIStores, pub write_flag: Arc, + default_schema: Schema, supported_models: Vec, } @@ -72,6 +73,7 @@ impl AIStoreHandler { std::process::abort(); }), write_flag, + default_schema: Schema::default(), supported_models, } } @@ -113,9 +115,9 @@ impl AIStoreHandler { /// Returns a store using the store name and schema, else returns an error #[tracing::instrument(skip(self))] - pub(crate) fn get(&self, schema: &Schema, store_name: &StoreName) -> Result, AIProxyError> { + pub(crate) fn get(&self, store_name: &StoreName) -> Result, AIProxyError> { let inner_stores = self - .get_schema(schema) + .get_schema(&self.default_schema) .ok_or_else(|| AIProxyError::StoreNotFound(store_name.clone()))?; let store = inner_stores .get(store_name, &inner_stores.guard()) @@ -128,7 +130,6 @@ impl AIStoreHandler { pub(crate) fn create_store( &self, store_name: StoreName, - schema: Schema, query_model: AiModel, index_model: AiModel, error_if_exists: bool, @@ -150,7 +151,7 @@ impl AIStoreHandler { }); } - let inner_stores = self.get_or_create_schema(&schema); + let inner_stores = self.get_or_create_schema(&self.default_schema); if inner_stores .try_insert( store_name.clone(), @@ -199,8 +200,8 @@ impl AIStoreHandler { /// matches GETSTORE - to return info for a single store #[tracing::instrument(skip(self))] - pub(crate) fn get_store(&self, store_name: &StoreName, schema: &Schema) -> Result { - let store = self.get(schema, store_name)?; + pub(crate) fn get_store(&self, store_name: &StoreName) -> Result { + let store = self.get(store_name)?; let model: ModelDetails = SupportedModels::from(&store.index_model).to_model_details(); Ok(AiStoreInfo { name: store_name.value.clone(), @@ -218,10 +219,9 @@ impl AIStoreHandler { pub(crate) fn validate_and_prepare_store_data( &self, store_name: &StoreName, - schema: &Schema, inputs: Vec<(StoreInput, StoreValue)>, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let index_model = store.index_model; let chunk_size = parallel::chunk_size(inputs.len()); inputs @@ -291,19 +291,18 @@ impl AIStoreHandler { pub(crate) async fn set( &self, store_name: &StoreName, - schema: &Schema, inputs: Vec<(StoreInput, StoreValue)>, model_manager: &ModelManager, preprocess_action: PreprocessAction, execution_provider: Option, model_params: std::collections::HashMap, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; if inputs.is_empty() { return Ok((vec![], None)); } let (validated_data, delete_hashset) = - self.validate_and_prepare_store_data(store_name, schema, inputs)?; + self.validate_and_prepare_store_data(store_name, inputs)?; let (store_inputs, store_values): (Vec<_>, Vec<_>) = validated_data.into_iter().unzip(); let store_keys = model_manager @@ -420,14 +419,13 @@ impl AIStoreHandler { pub(crate) async fn get_ndarray_repr_for_store( &self, store_name: &StoreName, - schema: &Schema, store_input: StoreInput, model_manager: &ModelManager, preprocess_action: PreprocessAction, execution_provider: Option, model_params: std::collections::HashMap, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let mut store_keys = model_manager .handle_request( &store.query_model, @@ -457,10 +455,9 @@ impl AIStoreHandler { pub(crate) fn drop_store( &self, store_name: StoreName, - schema: &Schema, error_if_not_exists: bool, ) -> Result { - let inner_stores = match self.get_schema(schema) { + let inner_stores = match self.get_schema(&self.default_schema) { Some(inner) => inner, None if error_if_not_exists => return Err(AIProxyError::StoreNotFound(store_name)), None => return Ok(0), @@ -502,8 +499,8 @@ impl AIStoreHandler { } #[tracing::instrument(skip(self))] - pub(crate) fn store_original(&self, store_name: StoreName, schema: &Schema) -> Result { - let store = self.get(schema, &store_name)?; + pub(crate) fn store_original(&self, store_name: StoreName) -> Result { + let store = self.get(&store_name)?; Ok(store.store_original) } diff --git a/ahnlich/ai/src/server/handler.rs b/ahnlich/ai/src/server/handler.rs index 16852c9eb..1e340006f 100644 --- a/ahnlich/ai/src/server/handler.rs +++ b/ahnlich/ai/src/server/handler.rs @@ -336,7 +336,6 @@ impl AiService for AIProxyServer { &StoreName { value: params.store.clone(), }, - &ahnlich_types::schema::Schema::default(), search_input, &self.model_manager, TryInto::::try_into(params.preprocess_action) @@ -507,7 +506,7 @@ impl AiService for AIProxyServer { let params = request.into_inner(); let mut store_info = self.store_handler.get_store(&StoreName { value: params.store.clone(), - }, &ahnlich_types::schema::Schema::default())?; + })?; // Enrich with predicate indices and db_info from DB, filtering out reserved keys if let Some(db_client) = &self.db_client { let parent_id = tracer::span_to_trace_parent(tracing::Span::current()); diff --git a/ahnlich/db/src/engine/operations.rs b/ahnlich/db/src/engine/operations.rs index 78227a1d8..3046c3bc4 100644 --- a/ahnlich/db/src/engine/operations.rs +++ b/ahnlich/db/src/engine/operations.rs @@ -7,7 +7,6 @@ use ahnlich_types::algorithm::nonlinear::NonLinearAlgorithm; use ahnlich_types::db::query; use ahnlich_types::db::server; use ahnlich_types::keyval::{StoreKey, StoreName, StoreValue}; -use ahnlich_types::schema::Schema; use ahnlich_types::shared::info::StoreUpsert; use itertools::Itertools; use rayon::iter::{IntoParallelIterator, ParallelIterator}; @@ -33,7 +32,6 @@ pub fn create_store( StoreName { value: params.store, }, - Schema::default(), dimensions, params.create_predicates, non_linear_indices, @@ -49,7 +47,6 @@ pub fn create_pred_index( &StoreName { value: params.store, }, - &Schema::default(), params.predicates, ) } @@ -68,7 +65,6 @@ pub fn create_non_linear_algorithm_index( &StoreName { value: params.store, }, - &Schema::default(), non_linear_indices, ) } @@ -81,7 +77,6 @@ pub fn drop_pred_index( &StoreName { value: params.store, }, - &Schema::default(), params.predicates, params.error_if_not_exists, ) @@ -101,7 +96,6 @@ pub fn drop_non_linear_algorithm_index( &StoreName { value: params.store, }, - &Schema::default(), non_linear_indices, params.error_if_not_exists, ) @@ -118,7 +112,6 @@ pub fn del_key(store_handler: &StoreHandler, params: query::DelKey) -> Result Result, + default_schema: Schema, } impl AhnlichPersistenceUtils for StoreHandler { @@ -160,6 +161,7 @@ impl StoreHandler { std::process::abort(); }), write_flag, + default_schema: Schema::default(), } } @@ -208,11 +210,11 @@ impl StoreHandler { .cloned() } - /// Returns a store using the store name and schema, else returns an error + /// Returns a store using the store name and default schema, else returns an error #[tracing::instrument(skip(self))] - fn get(&self, schema: &Schema, store_name: &StoreName) -> Result, ServerError> { + fn get(&self, store_name: &StoreName) -> Result, ServerError> { let inner_stores = self - .get_schema(schema) + .get_schema(&self.default_schema) .ok_or_else(|| ServerError::StoreNotFound(store_name.clone()))?; let store = inner_stores .get(store_name, &inner_stores.guard()) @@ -226,11 +228,9 @@ impl StoreHandler { pub(crate) fn create_pred_index( &self, store_name: &StoreName, - schema: &Schema, - // TODO: create grpc datatype for metadata key predicates: Vec, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let created_predicates = store.create_pred_index(predicates); if created_predicates > 0 { self.set_write_flag() @@ -243,10 +243,9 @@ impl StoreHandler { pub(crate) fn create_non_linear_algorithm_index( &self, store_name: &StoreName, - schema: &Schema, non_linear_indices: StdHashSet, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let created_predicates = store.create_non_linear_algorithm_index(non_linear_indices); if created_predicates > 0 { self.set_write_flag() @@ -259,10 +258,9 @@ impl StoreHandler { pub(crate) fn del_key_in_store( &self, store_name: &StoreName, - schema: &Schema, keys: Vec, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let deleted = store.delete_keys(keys.clone())?; if deleted > 0 { self.set_write_flag(); @@ -275,10 +273,9 @@ impl StoreHandler { pub(crate) fn del_pred_in_store( &self, store_name: &StoreName, - schema: &Schema, condition: &PredicateCondition, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let deleted = store.delete_matches(condition)?; if deleted > 0 { self.set_write_flag(); @@ -291,13 +288,12 @@ impl StoreHandler { pub fn get_sim_in_store( &self, store_name: &StoreName, - schema: &Schema, search_input: StoreKey, closest_n: NonZeroUsize, algorithm: Algorithm, condition: Option, ) -> Result, ServerError> { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let store_dimension = store.dimension.get(); let input_dimension = search_input.key.len(); @@ -365,10 +361,9 @@ impl StoreHandler { pub fn get_pred_in_store( &self, store_name: &StoreName, - schema: &Schema, condition: &PredicateCondition, ) -> Result, ServerError> { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; store.get_matches(condition) } @@ -377,10 +372,9 @@ impl StoreHandler { pub(crate) fn get_key_in_store( &self, store_name: &StoreName, - schema: &Schema, keys: Vec, ) -> Result, ServerError> { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; store.get_keys(keys) } @@ -389,10 +383,9 @@ impl StoreHandler { pub fn set_in_store( &self, store_name: &StoreName, - schema: &Schema, new: Vec<(StoreKey, StoreValue)>, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let upsert = store.add(new)?; if upsert.modified() { self.set_write_flag(); @@ -446,8 +439,8 @@ impl StoreHandler { /// Matches GETSTORE - Returns detailed info for a single store by name #[tracing::instrument(skip(self))] - pub(crate) fn get_store(&self, store_name: &StoreName, schema: &Schema) -> Result { - let store = self.get(schema, store_name)?; + pub(crate) fn get_store(&self, store_name: &StoreName) -> Result { + let store = self.get(store_name)?; let (len, size_in_bytes) = if store.size_dirty.load(Ordering::Relaxed) { let len = store.len(); let size = store.size(); @@ -484,14 +477,12 @@ impl StoreHandler { pub fn create_store( &self, store_name: StoreName, - schema: Schema, dimension: NonZeroUsize, - // FIXME: update metadata key with grpc type key predicates: Vec, non_linear_indices: StdHashSet, error_if_exists: bool, ) -> Result<(), ServerError> { - let inner_stores = self.get_or_create_schema(&schema); + let inner_stores = self.get_or_create_schema(&self.default_schema); if inner_stores .try_insert( store_name.clone(), @@ -512,11 +503,10 @@ impl StoreHandler { pub(crate) fn drop_pred_index_in_store( &self, store_name: &StoreName, - schema: &Schema, predicates: Vec, error_if_not_exists: bool, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let deleted = store.drop_predicates(predicates, error_if_not_exists)?; if deleted > 0 { self.set_write_flag(); @@ -530,11 +520,10 @@ impl StoreHandler { pub(crate) fn drop_non_linear_algorithm_index( &self, store_name: &StoreName, - schema: &Schema, non_linear_indices: StdHashSet, error_if_not_exists: bool, ) -> Result { - let store = self.get(schema, store_name)?; + let store = self.get(store_name)?; let deleted = store .non_linear_indices .remove_indices(non_linear_indices, error_if_not_exists)?; @@ -549,10 +538,9 @@ impl StoreHandler { pub(crate) fn drop_store( &self, store_name: StoreName, - schema: &Schema, error_if_not_exists: bool, ) -> Result { - let inner_stores = match self.get_schema(schema) { + let inner_stores = match self.get_schema(&self.default_schema) { Some(inner) => inner, None if error_if_not_exists => return Err(ServerError::StoreNotFound(store_name)), None => return Ok(0), diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 5f7a2a092..83e70fe4f 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -14,7 +14,6 @@ use ahnlich_replication::types::DbCommand; use ahnlich_types::db::pipeline::db_query::Query; use ahnlich_types::db::server::GetSimNEntry; use ahnlich_types::keyval::{DbStoreEntry, StoreKey, StoreName}; -use ahnlich_types::schema::Schema; use ahnlich_types::services::db_service::db_service_server::{DbService, DbServiceServer}; use ahnlich_types::shared::cluster::{ClusterInfoQuery, ClusterInfoResponse}; use ahnlich_types::shared::info::ErrorResponse; From f93b77bf1257a8eeaa637777fb8764aed4e33b55 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Sat, 13 Jun 2026 09:17:51 +0100 Subject: [PATCH 08/28] feat: wire schema through protobuf, add DropSchema RPC Add optional schema field to CreateStore, DropStore, ListStores, and GetStore protobuf messages. Add DropSchema message and RPC for dropping entire schemas. Proto changes: - Add optional string schema field to CreateStore, DropStore, ListStores, GetStore in both db/ and ai/ query protos - Add DropSchema message (string schema) to both db/ and ai/ protos - Add DropSchema to pipeline oneof and service RPC definitions Store handler changes: - get() searches all schemas (default_schema first, then fallback) - create_store, drop_store accept &Schema parameter - list_stores accepts Option<&Schema> for filtering - drop_schema already existed but is now wired through protobuf Operations layer: - Each operation extracts schema from request, resolves to Schema (defaults to "public" when None), passes to handler - Add drop_schema function for both DB and AI operations - Schema import added where needed All 58 DB tests pass. Both crates compile with clippy. --- ahnlich/ai/src/engine/operations.rs | 44 ++++++++++-- ahnlich/ai/src/engine/store.rs | 50 +++++++++----- ahnlich/ai/src/error.rs | 2 +- ahnlich/ai/src/server/handler.rs | 30 ++++++++ ahnlich/ai/src/tests/aiproxy_test.rs | 58 +++++++++++++--- ahnlich/ai/src/tests/buffalo_l_test.rs | 16 +++++ ahnlich/ai/src/tests/clap_test.rs | 6 ++ ahnlich/ai/src/tests/jina_code_test.rs | 8 ++- ahnlich/ai/src/tests/sface_yunet_test.rs | 9 +++ ahnlich/client/src/ai.rs | 23 ++++++- ahnlich/client/src/db.rs | 19 ++++- ahnlich/db/src/engine/operations.rs | 33 ++++++++- ahnlich/db/src/engine/store.rs | 59 ++++++++++------ ahnlich/db/src/replication/mod.rs | 7 ++ ahnlich/db/src/server/cluster_queries.rs | 5 +- ahnlich/db/src/server/handler.rs | 40 ++++++++++- ahnlich/db/src/tests/server_tests.rs | 88 ++++++++++++++++++++---- ahnlich/replication/src/types.rs | 1 + ahnlich/types/build.rs | 9 ++- ahnlich/types/src/ai/pipeline.rs | 4 +- ahnlich/types/src/ai/query.rs | 28 +++++++- ahnlich/types/src/db/pipeline.rs | 4 +- ahnlich/types/src/db/query.rs | 25 ++++++- ahnlich/types/src/services/ai_service.rs | 79 +++++++++++++++++++++ ahnlich/types/src/services/db_service.rs | 79 +++++++++++++++++++++ protos/ai/pipeline.proto | 1 + protos/ai/query.proto | 9 +++ protos/db/pipeline.proto | 1 + protos/db/query.proto | 13 +++- protos/services/ai_service.proto | 1 + protos/services/db_service.proto | 1 + 31 files changed, 660 insertions(+), 92 deletions(-) diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index c1d27b777..2ea31812b 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, sync::Arc}; use ahnlich_client_rs::db::DbClient; +use ahnlich_types::ai::query::DropSchema as AiDropSchema; use ahnlich_types::{ ai::{ models::AiModel, @@ -28,6 +29,7 @@ use ahnlich_types::{ In, Predicate, PredicateCondition, predicate::Kind as PredicateKind, predicate_condition::Kind, }, + schema::Schema, }; use itertools::Itertools; use rayon::prelude::*; @@ -90,6 +92,12 @@ pub async fn create_store( predicates.push(AHNLICH_AI_ONE_TO_MANY_INDEX_META_KEY.to_string()); } + let schema = params + .schema + .as_ref() + .map(|s| Schema::new(s.clone())) + .unwrap_or_default(); + require_db_client(db_client)? .create_store( DbCreateStore { @@ -98,6 +106,7 @@ pub async fn create_store( create_predicates: predicates, non_linear_indices: params.non_linear_indices, error_if_exists: params.error_if_exists, + schema: Some(schema.to_string()), }, parent_id, ) @@ -107,6 +116,7 @@ pub async fn create_store( StoreName { value: params.store, }, + &schema, query_model, index_model, params.error_if_exists, @@ -353,6 +363,11 @@ pub async fn drop_store( let store_name = StoreName { value: params.store, }; + let schema = params + .schema + .as_ref() + .map(|s| Schema::new(s.clone())) + .unwrap_or_default(); if store_handler.get(&store_name).is_ok() && let Some(db_client) = db_client @@ -362,13 +377,14 @@ pub async fn drop_store( DbDropStore { store: store_name.value.clone(), error_if_not_exists: params.error_if_not_exists, + schema: Some(schema.to_string()), }, parent_id, ) .await?; } - let dropped = store_handler.drop_store(store_name, params.error_if_not_exists)?; + let dropped = store_handler.drop_store(store_name, &schema, params.error_if_not_exists)?; Ok(Del { deleted_count: dropped as u64, }) @@ -381,7 +397,7 @@ pub async fn purge_stores( parent_id: Option, ) -> Result { let store_names: Vec = store_handler - .list_stores() + .list_stores(None) .into_iter() .map(|store| StoreName { value: store.name }) .collect(); @@ -393,6 +409,7 @@ pub async fn purge_stores( DbDropStore { store: store_name.value.clone(), error_if_not_exists: false, + schema: None, }, parent_id.clone(), ) @@ -408,10 +425,15 @@ pub async fn purge_stores( pub async fn list_stores( store_handler: &AIStoreHandler, db_client: Option>, - _params: ListStores, + params: ListStores, parent_id: Option, ) -> Result { - let mut stores: Vec = store_handler.list_stores().into_iter().sorted().collect(); + let filter_schema = params.schema.as_ref().map(|s| Schema::new(s.clone())); + let mut stores: Vec = store_handler + .list_stores(filter_schema.as_ref()) + .into_iter() + .sorted() + .collect(); if let Some(db_client) = db_client && let Ok(db_store_list) = db_client.list_stores(parent_id).await @@ -439,3 +461,17 @@ pub async fn list_stores( Ok(StoreList { stores }) } + +pub async fn drop_schema( + store_handler: &AIStoreHandler, + _db_client: Option>, + params: AiDropSchema, + _parent_id: Option, +) -> Result { + let schema = Schema::new(params.schema); + + let dropped = store_handler.drop_schema(&schema)?; + Ok(Del { + deleted_count: dropped as u64, + }) +} diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index ddb57c923..d4326dc06 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -100,7 +100,10 @@ impl AIStoreHandler { let new_inner: AIInnerStores = fallible::try_new_arc_hashmap() .expect("Failed to create inner AI stores map for schema"); let guard = self.stores.guard(); - match self.stores.try_insert(schema.clone(), new_inner.clone(), &guard) { + match self + .stores + .try_insert(schema.clone(), new_inner.clone(), &guard) + { Ok(_) => new_inner, Err(existing) => existing.current.clone(), } @@ -108,28 +111,33 @@ impl AIStoreHandler { /// Returns the inner stores map for a given schema, or `None` if the schema does not exist. fn get_schema(&self, schema: &Schema) -> Option { - self.stores - .get(schema, &self.stores.guard()) - .cloned() + self.stores.get(schema, &self.stores.guard()).cloned() } /// Returns a store using the store name and schema, else returns an error #[tracing::instrument(skip(self))] pub(crate) fn get(&self, store_name: &StoreName) -> Result, AIProxyError> { - let inner_stores = self - .get_schema(&self.default_schema) - .ok_or_else(|| AIProxyError::StoreNotFound(store_name.clone()))?; - let store = inner_stores - .get(store_name, &inner_stores.guard()) - .cloned() - .ok_or(AIProxyError::StoreNotFound(store_name.clone()))?; - Ok(store) + let guard = self.stores.guard(); + if let Some(inner_stores) = self.stores.get(&self.default_schema, &guard) { + let inner_guard = inner_stores.guard(); + if let Some(store) = inner_stores.get(store_name, &inner_guard) { + return Ok(store.clone()); + } + } + for (_, inner_stores) in self.stores.iter(&guard) { + let inner_guard = inner_stores.guard(); + if let Some(store) = inner_stores.get(store_name, &inner_guard) { + return Ok(store.clone()); + } + } + Err(AIProxyError::StoreNotFound(store_name.clone())) } #[tracing::instrument(skip(self))] pub(crate) fn create_store( &self, store_name: StoreName, + schema: &Schema, query_model: AiModel, index_model: AiModel, error_if_exists: bool, @@ -151,7 +159,7 @@ impl AIStoreHandler { }); } - let inner_stores = self.get_or_create_schema(&self.default_schema); + let inner_stores = self.get_or_create_schema(schema); if inner_stores .try_insert( store_name.clone(), @@ -174,11 +182,18 @@ impl AIStoreHandler { /// matches LISTSTORES - to return statistics of all stores #[tracing::instrument(skip(self))] - pub(crate) fn list_stores(&self) -> StdHashSet { + pub(crate) fn list_stores(&self, schema: Option<&Schema>) -> StdHashSet { let guard = self.stores.guard(); let mut result = StdHashSet::new(); - for (_schema, inner_stores) in self.stores.iter(&guard) { - let inner_stores: &AIInnerStores = inner_stores; + let inner_stores_list: Vec = if let Some(schema) = schema { + self.stores + .get(schema, &guard) + .map(|s| vec![s.clone()]) + .unwrap_or_default() + } else { + self.stores.iter(&guard).map(|(_, v)| v.clone()).collect() + }; + for inner_stores in inner_stores_list { let inner_guard = inner_stores.guard(); for (store_name, store) in inner_stores.iter(&inner_guard) { let model: ModelDetails = @@ -455,9 +470,10 @@ impl AIStoreHandler { pub(crate) fn drop_store( &self, store_name: StoreName, + schema: &Schema, error_if_not_exists: bool, ) -> Result { - let inner_stores = match self.get_schema(&self.default_schema) { + let inner_stores = match self.get_schema(schema) { Some(inner) => inner, None if error_if_not_exists => return Err(AIProxyError::StoreNotFound(store_name)), None => return Ok(0), diff --git a/ahnlich/ai/src/error.rs b/ahnlich/ai/src/error.rs index 01a67a69d..ad5eacd71 100644 --- a/ahnlich/ai/src/error.rs +++ b/ahnlich/ai/src/error.rs @@ -236,7 +236,7 @@ impl From for Status { | AIProxyError::FaceModelNoPreprocessingError | AIProxyError::UnknownEnumValue(_) | AIProxyError::InputNotSpecified(_) - | AIProxyError::MultipleEmbeddingsForQuery(_) => Code::InvalidArgument, + | AIProxyError::MultipleEmbeddingsForQuery(_) => Code::InvalidArgument, AIProxyError::InvalidArgument(_) => Code::InvalidArgument, AIProxyError::TokenExceededError { max_token_size: _, diff --git a/ahnlich/ai/src/server/handler.rs b/ahnlich/ai/src/server/handler.rs index 1e340006f..dd8bbb72d 100644 --- a/ahnlich/ai/src/server/handler.rs +++ b/ahnlich/ai/src/server/handler.rs @@ -26,6 +26,7 @@ use ahnlich_types::ai::query::DelKey; use ahnlich_types::ai::query::DelPred as AiDelPred; use ahnlich_types::ai::query::DropNonLinearAlgorithmIndex; use ahnlich_types::ai::query::DropPredIndex; +use ahnlich_types::ai::query::DropSchema as AiDropSchema; use ahnlich_types::ai::query::DropStore; use ahnlich_types::ai::query::GetKey; use ahnlich_types::ai::query::GetPred; @@ -473,6 +474,21 @@ impl AiService for AIProxyServer { Ok(tonic::Response::new(res)) } + #[tracing::instrument(skip_all)] + async fn drop_schema( + &self, + request: tonic::Request, + ) -> Result, tonic::Status> { + let res = operations::drop_schema( + self.store_handler.as_ref(), + self.db_client.clone(), + request.into_inner(), + tracer::span_to_trace_parent(tracing::Span::current()), + ) + .await?; + Ok(tonic::Response::new(res)) + } + #[tracing::instrument(skip_all)] async fn list_clients( &self, @@ -913,6 +929,20 @@ impl AiService for AIProxyServer { } } } + + Query::DropSchema(params) => { + match self.drop_schema(tonic::Request::new(params)).await { + Ok(res) => { + response_vec.push(ai_server_response::Response::Del(res.into_inner())) + } + Err(err) => { + response_vec.push(ai_server_response::Response::Error(ErrorResponse { + message: err.message().to_string(), + code: err.code().into(), + })); + } + } + } } } let response_vec = response_vec diff --git a/ahnlich/ai/src/tests/aiproxy_test.rs b/ahnlich/ai/src/tests/aiproxy_test.rs index 5e2775f08..871d14127 100644 --- a/ahnlich/ai/src/tests/aiproxy_test.rs +++ b/ahnlich/ai/src/tests/aiproxy_test.rs @@ -151,6 +151,7 @@ async fn test_ai_proxy_create_store_success() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; let response = client .create_store(tonic::Request::new(create_store)) @@ -161,7 +162,7 @@ async fn test_ai_proxy_create_store_success() { assert_eq!(expected, response.into_inner()); // list stores to verify it's present. - let message = ahnlich_types::ai::query::ListStores {}; + let message = ahnlich_types::ai::query::ListStores { schema: None }; let response = client .list_stores(tonic::Request::new(message)) .await @@ -221,6 +222,7 @@ async fn test_ai_store_get_key_works() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -347,6 +349,7 @@ async fn test_ai_store_no_original() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -469,6 +472,7 @@ async fn test_ai_proxy_get_pred_succeeds() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -598,6 +602,7 @@ async fn test_ai_proxy_get_sim_n_succeeds() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -759,6 +764,7 @@ async fn test_convert_store_input_to_embeddings(index: usize, model: i32) { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -909,6 +915,7 @@ async fn test_convert_store_input_to_embeddings_without_db(index: usize, model: non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1005,6 +1012,7 @@ async fn test_ai_proxy_create_drop_pred_index() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1147,6 +1155,7 @@ async fn test_ai_proxy_del_key_drop_store() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1158,6 +1167,7 @@ async fn test_ai_proxy_del_key_drop_store() { non_linear_indices: vec![], error_if_exists: false, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1187,6 +1197,7 @@ async fn test_ai_proxy_del_key_drop_store() { query: Some(Query::DropStore(ai_query_types::DropStore { store: store_name.clone(), error_if_not_exists: true, + schema: None, })), }, ]; @@ -1284,16 +1295,20 @@ async fn test_ai_proxy_drop_store_cascades_to_db() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { query: Some(Query::DropStore(ai_query_types::DropStore { store: store_name.clone(), error_if_not_exists: true, + schema: None, })), }, ai_pipeline::AiQuery { - query: Some(Query::ListStores(ai_query_types::ListStores {})), + query: Some(Query::ListStores(ai_query_types::ListStores { + schema: None, + })), }, ], })) @@ -1318,7 +1333,9 @@ async fn test_ai_proxy_drop_store_cascades_to_db() { } let db_stores = db_client - .list_stores(tonic::Request::new(ahnlich_types::db::query::ListStores {})) + .list_stores(tonic::Request::new(ahnlich_types::db::query::ListStores { + schema: None, + })) .await .expect("Failed to list DB stores") .into_inner(); @@ -1394,6 +1411,7 @@ async fn test_ai_proxy_del_pred() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1505,6 +1523,7 @@ async fn test_ai_proxy_test_with_persistence() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1516,12 +1535,14 @@ async fn test_ai_proxy_test_with_persistence() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { query: Some(Query::DropStore(ai_query_types::DropStore { store: store_name.clone(), error_if_not_exists: true, + schema: None, })), }, ]; @@ -1580,7 +1601,9 @@ async fn test_ai_proxy_test_with_persistence() { // Verify persisted data let list_response = persisted_client - .list_stores(tonic::Request::new(ai_query_types::ListStores {})) + .list_stores(tonic::Request::new(ai_query_types::ListStores { + schema: None, + })) .await .expect("Failed to list stores"); @@ -1628,16 +1651,21 @@ async fn test_ai_proxy_destroy_database() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { - query: Some(Query::ListStores(ai_query_types::ListStores {})), + query: Some(Query::ListStores(ai_query_types::ListStores { + schema: None, + })), }, ai_pipeline::AiQuery { query: Some(Query::PurgeStores(ai_query_types::PurgeStores {})), }, ai_pipeline::AiQuery { - query: Some(Query::ListStores(ai_query_types::ListStores {})), + query: Some(Query::ListStores(ai_query_types::ListStores { + schema: None, + })), }, ]; @@ -1730,6 +1758,7 @@ async fn test_ai_proxy_purge_stores_cascades_to_db() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1741,13 +1770,16 @@ async fn test_ai_proxy_purge_stores_cascades_to_db() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { query: Some(Query::PurgeStores(ai_query_types::PurgeStores {})), }, ai_pipeline::AiQuery { - query: Some(Query::ListStores(ai_query_types::ListStores {})), + query: Some(Query::ListStores(ai_query_types::ListStores { + schema: None, + })), }, ], })) @@ -1776,7 +1808,9 @@ async fn test_ai_proxy_purge_stores_cascades_to_db() { } let db_stores = db_client - .list_stores(tonic::Request::new(ahnlich_types::db::query::ListStores {})) + .list_stores(tonic::Request::new(ahnlich_types::db::query::ListStores { + schema: None, + })) .await .expect("Failed to list DB stores") .into_inner(); @@ -1875,10 +1909,13 @@ async fn test_ai_proxy_binary_store_actions() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { - query: Some(Query::ListStores(ai_query_types::ListStores {})), + query: Some(Query::ListStores(ai_query_types::ListStores { + schema: None, + })), }, ai_pipeline::AiQuery { query: Some(Query::CreatePredIndex(ai_query_types::CreatePredIndex { @@ -2060,6 +2097,7 @@ async fn test_ai_proxy_binary_store_set_text_and_binary_fails() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }, ai_pipeline::AiQuery { @@ -2141,6 +2179,7 @@ async fn test_ai_proxy_create_store_errors_unsupported_models() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }]; @@ -2191,6 +2230,7 @@ async fn test_ai_proxy_embedding_size_mismatch_error() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }]; diff --git a/ahnlich/ai/src/tests/buffalo_l_test.rs b/ahnlich/ai/src/tests/buffalo_l_test.rs index cfb4c976f..0eeb0365d 100644 --- a/ahnlich/ai/src/tests/buffalo_l_test.rs +++ b/ahnlich/ai/src/tests/buffalo_l_test.rs @@ -91,6 +91,7 @@ async fn test_buffalo_l_face_detection() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -165,6 +166,7 @@ async fn test_buffalo_l_batch_multiple_images() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -259,6 +261,7 @@ async fn test_buffalo_l_no_faces() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -334,6 +337,7 @@ async fn test_buffalo_l_single_face() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -409,6 +413,7 @@ async fn test_buffalo_l_get_sim_n() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -603,6 +608,7 @@ async fn test_buffalo_l_get_sim_n_multi_face_query_errors() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -690,6 +696,7 @@ async fn test_buffalo_l_face_index_metadata() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, }; // Store the image @@ -847,6 +854,7 @@ async fn test_buffalo_l_mixed_batch_no_face_does_not_fail_batch() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -942,6 +950,7 @@ async fn test_buffalo_l_high_confidence_threshold() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -1002,6 +1011,7 @@ async fn test_buffalo_l_high_confidence_threshold() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -1102,6 +1112,7 @@ async fn test_buffalo_l_bounding_box_metadata() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1271,6 +1282,7 @@ async fn test_buffalo_l_gender_age_metadata() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1426,6 +1438,7 @@ async fn test_buffalo_l_gender_age_multi_face() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1620,6 +1633,7 @@ async fn test_buffalo_l_visualize_attributes() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1841,6 +1855,7 @@ async fn test_buffalo_l_without_genderage() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -1970,6 +1985,7 @@ async fn test_buffalo_l_genderage_opt_in() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { diff --git a/ahnlich/ai/src/tests/clap_test.rs b/ahnlich/ai/src/tests/clap_test.rs index 41e76833e..fdb884c30 100644 --- a/ahnlich/ai/src/tests/clap_test.rs +++ b/ahnlich/ai/src/tests/clap_test.rs @@ -128,6 +128,7 @@ async fn test_clap_cross_modal_audio_indexed_text_queried() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -217,6 +218,7 @@ async fn test_clap_audio_to_audio_retrieval() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -289,6 +291,7 @@ async fn test_clap_text_to_text_retrieval() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -402,6 +405,7 @@ async fn test_clap_audio_no_preprocessing_rejected() { non_linear_indices: vec![], error_if_exists: false, store_original: false, + schema: None, })), }], })) @@ -467,6 +471,7 @@ async fn test_clap_audio_too_long_rejected() { non_linear_indices: vec![], error_if_exists: false, store_original: false, + schema: None, })), }], })) @@ -533,6 +538,7 @@ async fn test_clap_short_audio_accepted() { non_linear_indices: vec![], error_if_exists: false, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { diff --git a/ahnlich/ai/src/tests/jina_code_test.rs b/ahnlich/ai/src/tests/jina_code_test.rs index 960a1da0e..8d3dd01b0 100644 --- a/ahnlich/ai/src/tests/jina_code_test.rs +++ b/ahnlich/ai/src/tests/jina_code_test.rs @@ -71,6 +71,7 @@ async fn test_jina_code_model_loads_and_produces_embeddings() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }; @@ -174,6 +175,7 @@ app.listen(3000);"#; non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }; @@ -342,6 +344,7 @@ async fn test_jina_code_natural_language_query() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }; @@ -467,6 +470,7 @@ async fn test_jina_code_embedding_dimensions() { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, })), }; @@ -490,7 +494,9 @@ async fn test_jina_code_embedding_dimensions() { // List stores to check dimensions let list_stores_query = ai_pipeline::AiQuery { - query: Some(Query::ListStores(ai_query_types::ListStores {})), + query: Some(Query::ListStores(ai_query_types::ListStores { + schema: None, + })), }; let pipelined_request = ai_pipeline::AiRequestPipeline { diff --git a/ahnlich/ai/src/tests/sface_yunet_test.rs b/ahnlich/ai/src/tests/sface_yunet_test.rs index fd66cfb32..8a87e7275 100644 --- a/ahnlich/ai/src/tests/sface_yunet_test.rs +++ b/ahnlich/ai/src/tests/sface_yunet_test.rs @@ -75,6 +75,7 @@ async fn test_sface_yunet_face_detection() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -154,6 +155,7 @@ async fn test_sface_yunet_single_face() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -227,6 +229,7 @@ async fn test_sface_yunet_no_faces() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -302,6 +305,7 @@ async fn test_sface_yunet_get_sim_n() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -420,6 +424,7 @@ async fn test_sface_yunet_multi_face_query_errors() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -508,6 +513,7 @@ async fn test_sface_yunet_mixed_batch_no_face_does_not_fail_batch() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { @@ -602,6 +608,7 @@ async fn test_sface_yunet_high_confidence_threshold() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -659,6 +666,7 @@ async fn test_sface_yunet_high_confidence_threshold() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }; @@ -759,6 +767,7 @@ async fn test_sface_yunet_bounding_box_metadata() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })), }, ai_pipeline::AiQuery { diff --git a/ahnlich/client/src/ai.rs b/ahnlich/client/src/ai.rs index 9563064f9..499251ce0 100644 --- a/ahnlich/client/src/ai.rs +++ b/ahnlich/client/src/ai.rs @@ -113,7 +113,8 @@ impl AiPipeline { } pub fn list_stores(&mut self) { - self.queries.push(Query::ListStores(ListStores {})); + self.queries + .push(Query::ListStores(ListStores { schema: None })); } pub fn list_clients(&mut self) { @@ -348,14 +349,17 @@ impl AiClient { store: String, tracing_id: Option, ) -> Result { - let mut req = tonic::Request::new(GetStore { store }); + let mut req = tonic::Request::new(GetStore { + store, + schema: None, + }); add_trace_parent(&mut req, tracing_id); add_auth_header(&mut req, &self.auth_token); Ok(self.client.clone().get_store(req).await?.into_inner()) } pub async fn list_stores(&self, tracing_id: Option) -> Result { - let mut req = tonic::Request::new(ListStores {}); + let mut req = tonic::Request::new(ListStores { schema: None }); add_trace_parent(&mut req, tracing_id); add_auth_header(&mut req, &self.auth_token); Ok(self.client.clone().list_stores(req).await?.into_inner()) @@ -544,6 +548,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; let create_store_params_2 = CreateStore { @@ -554,6 +559,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; let create_store_params_no_error = CreateStore { @@ -564,6 +570,7 @@ mod test { non_linear_indices: vec![], error_if_exists: false, store_original: true, + schema: None, }; pipeline.create_store(create_store_params); @@ -578,6 +585,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params); @@ -649,6 +657,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; assert!( @@ -715,6 +724,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params); @@ -726,6 +736,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params_2); @@ -737,6 +748,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params_3); @@ -745,6 +757,7 @@ mod test { let drop_store_params = DropStore { store: "Less".into(), error_if_not_exists: true, + schema: None, }; pipeline.drop_store(drop_store_params); @@ -820,6 +833,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params); @@ -1012,6 +1026,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params); @@ -1190,6 +1205,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; pipeline.create_store(create_store_params); @@ -1325,6 +1341,7 @@ mod test { non_linear_indices: vec![], error_if_exists: true, store_original: true, + schema: None, }; let mut pipeline = ai_client.pipeline(None); diff --git a/ahnlich/client/src/db.rs b/ahnlich/client/src/db.rs index 7765e3112..4d48ffc9c 100644 --- a/ahnlich/client/src/db.rs +++ b/ahnlich/client/src/db.rs @@ -104,7 +104,8 @@ impl DbPipeline { } pub fn list_stores(&mut self) { - self.queries.push(Query::ListStores(ListStores {})); + self.queries + .push(Query::ListStores(ListStores { schema: None })); } pub fn list_clients(&mut self) { @@ -347,14 +348,17 @@ impl DbClient { store: String, tracing_id: Option, ) -> Result { - let mut req = tonic::Request::new(GetStore { store }); + let mut req = tonic::Request::new(GetStore { + store, + schema: None, + }); add_trace_parent(&mut req, tracing_id); add_auth_header(&mut req, &self.auth_token); Ok(self.client.clone().get_store(req).await?.into_inner()) } pub async fn list_stores(&self, tracing_id: Option) -> Result { - let mut req = tonic::Request::new(ListStores {}); + let mut req = tonic::Request::new(ListStores { schema: None }); add_trace_parent(&mut req, tracing_id); add_auth_header(&mut req, &self.auth_token); Ok(self.client.clone().list_stores(req).await?.into_inner()) @@ -451,6 +455,7 @@ mod test { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, }); pipeline.create_store(CreateStore { store: "Main".to_string(), @@ -458,6 +463,7 @@ mod test { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, }); pipeline.create_store(CreateStore { store: "Main".to_string(), @@ -465,6 +471,7 @@ mod test { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: false, + schema: None, }); pipeline.list_stores(); @@ -525,6 +532,7 @@ mod test { dimension: 3, non_linear_indices: vec![], error_if_exists: true, + schema: None, }; assert!( @@ -720,6 +728,7 @@ mod test { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, }); pipeline.create_store(CreateStore { store: "Main".to_string(), @@ -727,6 +736,7 @@ mod test { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, }); pipeline.create_store(CreateStore { store: "Main".to_string(), @@ -734,6 +744,7 @@ mod test { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: false, + schema: None, }); pipeline.list_stores(); @@ -811,6 +822,7 @@ mod test { index: Some(non_linear_index::Index::Kdtree(KdTreeConfig {})), }], error_if_exists: true, + schema: None, }; assert!( @@ -931,6 +943,7 @@ mod test { dimension: 3, non_linear_indices: vec![], error_if_exists: true, + schema: None, }; assert!( diff --git a/ahnlich/db/src/engine/operations.rs b/ahnlich/db/src/engine/operations.rs index 3046c3bc4..99a645316 100644 --- a/ahnlich/db/src/engine/operations.rs +++ b/ahnlich/db/src/engine/operations.rs @@ -2,11 +2,12 @@ use std::collections::HashMap; use std::collections::HashSet as StdHashSet; use std::num::NonZeroUsize; -use ahnlich_types::algorithm::nonlinear::non_linear_index; use ahnlich_types::algorithm::nonlinear::NonLinearAlgorithm; +use ahnlich_types::algorithm::nonlinear::non_linear_index; use ahnlich_types::db::query; use ahnlich_types::db::server; use ahnlich_types::keyval::{StoreKey, StoreName, StoreValue}; +use ahnlich_types::schema::Schema; use ahnlich_types::shared::info::StoreUpsert; use itertools::Itertools; use rayon::iter::{IntoParallelIterator, ParallelIterator}; @@ -14,6 +15,13 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; use crate::engine::store::StoreHandler; use crate::errors::ServerError; +fn resolve_schema(schema: &Option) -> Schema { + schema + .as_ref() + .map(|s| Schema::new(s.clone())) + .unwrap_or_default() +} + pub fn create_store( store_handler: &StoreHandler, params: query::CreateStore, @@ -28,10 +36,13 @@ pub fn create_store( .filter_map(|index| index.index) .collect(); + let schema = resolve_schema(¶ms.schema); + store_handler.create_store( StoreName { value: params.store, }, + &schema, dimensions, params.create_predicates, non_linear_indices, @@ -136,10 +147,12 @@ pub fn drop_store( store_handler: &StoreHandler, params: query::DropStore, ) -> Result { + let schema = resolve_schema(¶ms.schema); store_handler.drop_store( StoreName { value: params.store, }, + &schema, params.error_if_not_exists, ) } @@ -168,7 +181,21 @@ pub fn set(store_handler: &StoreHandler, params: query::Set) -> Result server::StoreList { - let stores = store_handler.list_stores().into_iter().sorted().collect(); +pub fn list_stores(store_handler: &StoreHandler, params: query::ListStores) -> server::StoreList { + let schema = params.schema.as_ref().map(|s| Schema::new(s.clone())); + let stores = store_handler + .list_stores(schema.as_ref()) + .into_iter() + .sorted() + .collect(); server::StoreList { stores } } + +pub fn drop_schema( + store_handler: &StoreHandler, + params: query::DropSchema, +) -> Result { + let schema = Schema::new(params.schema); + let dropped = store_handler.drop_schema(&schema)?; + Ok(dropped as u64) +} diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index 84e302914..d7c80ee4d 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -11,10 +11,10 @@ use ahnlich_types::algorithm::nonlinear::{NonLinearAlgorithm, non_linear_index}; use ahnlich_types::db::server::StoreInfo; use ahnlich_types::keyval::StoreName; use ahnlich_types::keyval::{StoreKey, StoreValue}; -use ahnlich_types::schema::Schema; use ahnlich_types::predicates::{ self, Predicate, PredicateCondition, predicate::Kind as PredicateKind, }; +use ahnlich_types::schema::Schema; use ahnlich_types::shared::info::StoreUpsert; use ahnlich_types::similarity::Similarity; use papaya::HashMap as ConcurrentHashMap; @@ -194,10 +194,13 @@ impl StoreHandler { return inner.clone(); } drop(guard); - let new_inner: InnerStores = fallible::try_new_arc_hashmap() - .expect("Failed to create inner stores map for schema"); + let new_inner: InnerStores = + fallible::try_new_arc_hashmap().expect("Failed to create inner stores map for schema"); let guard = self.stores.guard(); - match self.stores.try_insert(schema.clone(), new_inner.clone(), &guard) { + match self + .stores + .try_insert(schema.clone(), new_inner.clone(), &guard) + { Ok(_) => new_inner, Err(existing) => existing.current.clone(), } @@ -205,22 +208,26 @@ impl StoreHandler { /// Returns the inner stores map for a given schema, or `None` if the schema does not exist. fn get_schema(&self, schema: &Schema) -> Option { - self.stores - .get(schema, &self.stores.guard()) - .cloned() + self.stores.get(schema, &self.stores.guard()).cloned() } /// Returns a store using the store name and default schema, else returns an error #[tracing::instrument(skip(self))] fn get(&self, store_name: &StoreName) -> Result, ServerError> { - let inner_stores = self - .get_schema(&self.default_schema) - .ok_or_else(|| ServerError::StoreNotFound(store_name.clone()))?; - let store = inner_stores - .get(store_name, &inner_stores.guard()) - .cloned() - .ok_or(ServerError::StoreNotFound(store_name.clone()))?; - Ok(store) + let guard = self.stores.guard(); + if let Some(inner_stores) = self.stores.get(&self.default_schema, &guard) { + let inner_guard = inner_stores.guard(); + if let Some(store) = inner_stores.get(store_name, &inner_guard) { + return Ok(store.clone()); + } + } + for (_, inner_stores) in self.stores.iter(&guard) { + let inner_guard = inner_stores.guard(); + if let Some(store) = inner_stores.get(store_name, &inner_guard) { + return Ok(store.clone()); + } + } + Err(ServerError::StoreNotFound(store_name.clone())) } /// Matches CREATEPREDINDEX - reindexes a store with some predicate values @@ -395,10 +402,18 @@ impl StoreHandler { /// matches LISTSTORES - to return statistics of all stores #[tracing::instrument(skip(self))] - pub(crate) fn list_stores(&self) -> StdHashSet { + pub(crate) fn list_stores(&self, schema: Option<&Schema>) -> StdHashSet { let guard = self.stores.guard(); let mut result = StdHashSet::new(); - for (_schema, inner_stores) in self.stores.iter(&guard) { + let schemas: Vec = if let Some(schema) = schema { + self.stores + .get(schema, &guard) + .map(|s| vec![s.clone()]) + .unwrap_or_default() + } else { + self.stores.iter(&guard).map(|(_, v)| v.clone()).collect() + }; + for inner_stores in schemas { let inner_guard = inner_stores.guard(); for (store_name, store) in inner_stores.iter(&inner_guard) { // Lazy initialization: if size is dirty (e.g., newly created store), @@ -477,12 +492,13 @@ impl StoreHandler { pub fn create_store( &self, store_name: StoreName, + schema: &Schema, dimension: NonZeroUsize, predicates: Vec, non_linear_indices: StdHashSet, error_if_exists: bool, ) -> Result<(), ServerError> { - let inner_stores = self.get_or_create_schema(&self.default_schema); + let inner_stores = self.get_or_create_schema(schema); if inner_stores .try_insert( store_name.clone(), @@ -538,9 +554,10 @@ impl StoreHandler { pub(crate) fn drop_store( &self, store_name: StoreName, + schema: &Schema, error_if_not_exists: bool, ) -> Result { - let inner_stores = match self.get_schema(&self.default_schema) { + let inner_stores = match self.get_schema(schema) { Some(inner) => inner, None if error_if_not_exists => return Err(ServerError::StoreNotFound(store_name)), None => return Ok(0), @@ -1130,6 +1147,7 @@ mod tests { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(size).unwrap(), predicates, StdHashSet::new(), @@ -1162,6 +1180,7 @@ mod tests { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(size).unwrap(), predicates, StdHashSet::new(), @@ -1727,7 +1746,7 @@ mod tests { )], ) .unwrap(); - let stores = handler.list_stores(); + let stores = handler.list_stores(None); assert_eq!( stores, StdHashSet::from_iter([ diff --git a/ahnlich/db/src/replication/mod.rs b/ahnlich/db/src/replication/mod.rs index 550417cd3..7eb0950c8 100644 --- a/ahnlich/db/src/replication/mod.rs +++ b/ahnlich/db/src/replication/mod.rs @@ -161,6 +161,13 @@ impl StateMachineHandler for DbStateMachine { encode_raw_result!(query::DropStore, &dropped) } + DbCommand::DropSchema(payload) => { + let params = decode_payload!(query::DropSchema, payload)?; + let dropped = operations::drop_schema(&self.store_handler, params) + .map_err(|err| operation_error!(query::DropSchema, err))?; + + encode_raw_result!(query::DropSchema, &dropped) + } } } diff --git a/ahnlich/db/src/server/cluster_queries.rs b/ahnlich/db/src/server/cluster_queries.rs index 7cb00a3f4..33045d21d 100644 --- a/ahnlich/db/src/server/cluster_queries.rs +++ b/ahnlich/db/src/server/cluster_queries.rs @@ -4,7 +4,7 @@ use crate::errors::ServerError; use crate::server::store_runtime::StoreRuntime; use ahnlich_replication::cluster_info; use ahnlich_replication::node::ReplicationNode; -use ahnlich_types::db::server; +use ahnlich_types::db::{query, server}; use ahnlich_types::shared::cluster::{ ClusterInfoResponse, ClusterNode, NodeHealthStatus as PublicNodeHealthStatus, NodeRole as PublicNodeRole, @@ -55,6 +55,7 @@ pub(crate) fn read_store_handler( pub(crate) async fn list_stores_response( runtime: &StoreRuntime, + params: query::ListStores, ) -> Result { if let Some(cluster) = runtime.cluster() { cluster @@ -65,7 +66,7 @@ pub(crate) async fn list_stores_response( } read_store_handler(runtime, |store_handler| { - Ok(operations::list_stores(store_handler)) + Ok(operations::list_stores(store_handler, params)) }) } diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 83e70fe4f..39739a608 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -354,6 +354,26 @@ impl DbService for Server { Ok(tonic::Response::new(server::Del { deleted_count })) } + #[tracing::instrument(skip_all)] + async fn drop_schema( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status> { + let params = request.into_inner(); + + let dropped = match &self.runtime { + StoreRuntime::Cluster(cluster) => { + submit_db_command!(Some(cluster), query::DropSchema, params, DbCommand::DropSchema) + .await? + } + StoreRuntime::Standalone(store_handler) => operations::drop_schema(store_handler, params)?, + }; + + Ok(tonic::Response::new(server::Del { + deleted_count: dropped, + })) + } + #[tracing::instrument(skip_all)] async fn list_clients( &self, @@ -375,9 +395,9 @@ impl DbService for Server { #[tracing::instrument(skip_all)] async fn list_stores( &self, - _request: tonic::Request, + request: tonic::Request, ) -> std::result::Result, tonic::Status> { - let store_list = list_stores_response(&self.runtime).await?; + let store_list = list_stores_response(&self.runtime, request.into_inner()).await?; Ok(tonic::Response::new(store_list)) } @@ -750,6 +770,22 @@ impl DbService for Server { } } } + + Query::DropSchema(params) => { + match self.drop_schema(tonic::Request::new(params)).await { + Ok(res) => response_vec.push(pipeline::db_server_response::Response::Del( + res.into_inner(), + )), + Err(err) => { + response_vec.push(pipeline::db_server_response::Response::Error( + ErrorResponse { + message: err.message().to_string(), + code: err.code().into(), + }, + )); + } + } + } } } diff --git a/ahnlich/db/src/tests/server_tests.rs b/ahnlich/db/src/tests/server_tests.rs index 6340551b1..c51b41dc3 100644 --- a/ahnlich/db/src/tests/server_tests.rs +++ b/ahnlich/db/src/tests/server_tests.rs @@ -191,7 +191,9 @@ async fn test_simple_stores_list() { let mut client = DbServiceClient::connect(channel).await.expect("Failure"); let response = client - .list_stores(tonic::Request::new(ahnlich_types::db::query::ListStores {})) + .list_stores(tonic::Request::new(ahnlich_types::db::query::ListStores { + schema: None, + })) .await .expect("Failed to get store's list"); @@ -222,6 +224,7 @@ async fn test_create_stores() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, db_pipeline::DbQuery { @@ -231,10 +234,13 @@ async fn test_create_stores() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -327,6 +333,7 @@ async fn test_del_pred() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Should not error as it is correct query @@ -384,7 +391,9 @@ async fn test_del_pred() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, db_pipeline::DbQuery { query: Some(Query::DelPred(db_query_types::DelPred { @@ -438,7 +447,9 @@ async fn test_del_pred() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -580,6 +591,7 @@ async fn test_del_key() { create_predicates: vec!["role".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Should not error but delete nothing (empty store) @@ -616,7 +628,9 @@ async fn test_del_key() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, // Should error due to dimension mismatch db_pipeline::DbQuery { @@ -637,7 +651,9 @@ async fn test_del_key() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -776,6 +792,7 @@ async fn test_server_with_persistence() { create_predicates: vec!["role".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Should not error but delete nothing @@ -817,7 +834,9 @@ async fn test_server_with_persistence() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, // Should error due to dimension mismatch db_pipeline::DbQuery { @@ -838,7 +857,9 @@ async fn test_server_with_persistence() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -976,6 +997,7 @@ async fn test_server_with_persistence() { create_predicates: vec!["role".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Should not error as store exists @@ -1085,6 +1107,7 @@ async fn test_set_in_store() { create_predicates: vec!["role".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Valid set operation @@ -1145,7 +1168,9 @@ async fn test_set_in_store() { })), }, db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -1260,6 +1285,7 @@ async fn test_remove_non_linear_indices() { }], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -1507,6 +1533,7 @@ async fn test_get_sim_n_non_linear() { index: Some(non_linear_index::Index::Kdtree(KdTreeConfig {})), }], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -1717,6 +1744,7 @@ async fn test_get_sim_n() { create_predicates: vec!["medal".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -2085,6 +2113,7 @@ async fn test_get_pred() { create_predicates: vec!["medal".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -2292,6 +2321,7 @@ async fn test_get_key() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -2521,6 +2551,7 @@ async fn test_create_pred_index() { create_predicates: vec!["galaxy".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -2913,6 +2944,7 @@ async fn test_drop_pred_index() { create_predicates: vec!["galaxy".into()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Should not error (error_if_not_exists=false) @@ -3018,6 +3050,7 @@ async fn test_drop_stores() { query: Some(Query::DropStore(db_query_types::DropStore { store: "Main".to_string(), error_if_not_exists: false, + schema: None, })), }, // Create store @@ -3028,17 +3061,21 @@ async fn test_drop_stores() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // List stores db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, // Should succeed (store exists) db_pipeline::DbQuery { query: Some(Query::DropStore(db_query_types::DropStore { store: "Main".to_string(), error_if_not_exists: true, + schema: None, })), }, // Should error (store doesn't exist) @@ -3046,6 +3083,7 @@ async fn test_drop_stores() { query: Some(Query::DropStore(db_query_types::DropStore { store: "Main".to_string(), error_if_not_exists: true, + schema: None, })), }, ]; @@ -3142,6 +3180,7 @@ async fn test_server_persistence_with_hnsw_index() { index: Some(non_linear_index::Index::Hnsw(HnswConfig::default())), }], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -3271,6 +3310,7 @@ async fn test_server_persistence_with_hnsw_index() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // Should get persisted data @@ -3393,6 +3433,7 @@ async fn test_create_store_with_hnsw_configuration() { index: Some(non_linear_index::Index::Hnsw(hnsw_config)), }], error_if_exists: true, + schema: None, })), }, // Insert test data @@ -3456,7 +3497,9 @@ async fn test_create_store_with_hnsw_configuration() { }, // List stores to verify config is reflected db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -3575,6 +3618,7 @@ async fn test_duplicate_nonlinear_index_prevention() { index: Some(non_linear_index::Index::Hnsw(HnswConfig::default())), }], error_if_exists: true, + schema: None, })), }, // Try to create the same HNSW index again - should be idempotent, returns 0 @@ -3752,6 +3796,7 @@ async fn test_hnsw_recall_with_config_reconstruction() { index: Some(non_linear_index::Index::Hnsw(low_config)), }], error_if_exists: true, + schema: None, })), }], })) @@ -3981,6 +4026,7 @@ async fn test_list_stores_returns_nonlinear_config() { }, ], error_if_exists: true, + schema: None, })), }, // Create a store without nonlinear indices @@ -3991,11 +4037,14 @@ async fn test_list_stores_returns_nonlinear_config() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, // List stores db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, ]; @@ -4133,6 +4182,7 @@ async fn test_get_store_not_found() { let result = client .get_store(tonic::Request::new(db_query_types::GetStore { store: "NonExistent".to_string(), + schema: None, })) .await; @@ -4174,6 +4224,7 @@ async fn test_get_store_success() { index: Some(non_linear_index::Index::Hnsw(hnsw_config)), }], error_if_exists: true, + schema: None, }; client @@ -4208,6 +4259,7 @@ async fn test_get_store_success() { let store_info = client .get_store(tonic::Request::new(db_query_types::GetStore { store: "TestGetStore".to_string(), + schema: None, })) .await .expect("GetStore failed") @@ -4247,17 +4299,20 @@ async fn test_get_store_in_pipeline() { create_predicates: vec!["tag".to_string()], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, db_pipeline::DbQuery { query: Some(Query::GetStore(db_query_types::GetStore { store: "PipelineStore".to_string(), + schema: None, })), }, // GetStore on non-existent store should return error in pipeline db_pipeline::DbQuery { query: Some(Query::GetStore(db_query_types::GetStore { store: "DoesNotExist".to_string(), + schema: None, })), }, ]; @@ -4350,6 +4405,7 @@ async fn test_mmap_persistence_performance() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: false, + schema: None, })), }; @@ -4439,7 +4495,9 @@ async fn test_mmap_persistence_performance() { .expect("Failed to connect"); let list_query = db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }; let response = client_mmap @@ -4487,7 +4545,9 @@ async fn test_mmap_persistence_performance() { .expect("Failed to connect"); let list_query = db_pipeline::DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }; let response = client_no_mmap diff --git a/ahnlich/replication/src/types.rs b/ahnlich/replication/src/types.rs index 119dc67d8..9973340bc 100644 --- a/ahnlich/replication/src/types.rs +++ b/ahnlich/replication/src/types.rs @@ -32,6 +32,7 @@ pub enum DbCommand { DropPredIndex(Vec), DropNonLinearAlgorithmIndex(Vec), DropStore(Vec), + DropSchema(Vec), } /// AI Raft commands. Only operations that mutate AI-local state diff --git a/ahnlich/types/build.rs b/ahnlich/types/build.rs index 719814d43..51198ac2a 100644 --- a/ahnlich/types/build.rs +++ b/ahnlich/types/build.rs @@ -38,11 +38,10 @@ fn main() -> Result<()> { if let Ok(entries) = std::fs::read_dir(out_dir) { for entry in entries.filter_map(Result::ok) { let path = entry.path(); - let preserve = [ - "utils", - "schema.rs", - ]; - if path.file_name().is_some_and(|name| !preserve.contains(&name.to_str().unwrap_or(""))) + let preserve = ["utils", "schema.rs"]; + if path + .file_name() + .is_some_and(|name| !preserve.contains(&name.to_str().unwrap_or(""))) { if path.is_dir() { std::fs::remove_dir_all(&path).expect("Failed to remove directory"); diff --git a/ahnlich/types/src/ai/pipeline.rs b/ahnlich/types/src/ai/pipeline.rs index 72504ccbd..b70cb51bc 100644 --- a/ahnlich/types/src/ai/pipeline.rs +++ b/ahnlich/types/src/ai/pipeline.rs @@ -3,7 +3,7 @@ pub struct AiQuery { #[prost( oneof = "ai_query::Query", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19" + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20" )] pub query: ::core::option::Option, } @@ -53,6 +53,8 @@ pub mod ai_query { DelPred(super::super::query::DelPred), #[prost(message, tag = "19")] GetStore(super::super::query::GetStore), + #[prost(message, tag = "20")] + DropSchema(super::super::query::DropSchema), } } #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/ahnlich/types/src/ai/query.rs b/ahnlich/types/src/ai/query.rs index 3cbd53147..8f5d479c2 100644 --- a/ahnlich/types/src/ai/query.rs +++ b/ahnlich/types/src/ai/query.rs @@ -31,6 +31,9 @@ pub struct CreateStore { /// Flag to store original data. Used if you wanna keep the original(image or text) input sent #[prost(bool, tag = "7")] pub store_original: bool, + /// Optional schema/namespace for the store. Defaults to "public". + #[prost(string, optional, tag = "8")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPred { @@ -174,6 +177,9 @@ pub struct DropStore { /// Flag to throw an error if the store does not exist #[prost(bool, tag = "2")] pub error_if_not_exists: bool, + /// Optional schema/namespace for the store. Defaults to "public". + #[prost(string, optional, tag = "3")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetKey { @@ -192,9 +198,14 @@ pub struct InfoServer {} /// Lists all clients currently connected to the server #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ListClients {} -/// Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ListStores {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListStores { + /// Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. + /// + /// Optional schema/namespace to filter stores. If unset, lists all schemas. + #[prost(string, optional, tag = "1")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetStore { /// Gets detailed information about a specific store by name. Returns an error if the store does not exist. @@ -202,6 +213,17 @@ pub struct GetStore { /// Store name #[prost(string, tag = "1")] pub store: ::prost::alloc::string::String, + /// Optional schema/namespace for the store. Defaults to "public". + #[prost(string, optional, tag = "2")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DropSchema { + /// Drops an entire schema and all stores within it. Cannot drop the "public" default schema. + /// + /// The name of the schema to drop. + #[prost(string, tag = "1")] + pub schema: ::prost::alloc::string::String, } /// Purges (deletes) all stores on the server, effectively destroying all stored data #[derive(Clone, Copy, PartialEq, ::prost::Message)] diff --git a/ahnlich/types/src/db/pipeline.rs b/ahnlich/types/src/db/pipeline.rs index 228e1feeb..e7047460e 100644 --- a/ahnlich/types/src/db/pipeline.rs +++ b/ahnlich/types/src/db/pipeline.rs @@ -3,7 +3,7 @@ pub struct DbQuery { #[prost( oneof = "db_query::Query", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18" + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19" )] pub query: ::core::option::Option, } @@ -49,6 +49,8 @@ pub mod db_query { GetStore(super::super::query::GetStore), #[prost(message, tag = "18")] ClusterInfo(super::super::super::shared::cluster::ClusterInfoQuery), + #[prost(message, tag = "19")] + DropSchema(super::super::query::DropSchema), } } #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/ahnlich/types/src/db/query.rs b/ahnlich/types/src/db/query.rs index 408e56968..4fa7f1e09 100644 --- a/ahnlich/types/src/db/query.rs +++ b/ahnlich/types/src/db/query.rs @@ -20,6 +20,9 @@ pub struct CreateStore { /// Flag indicating whether to error if store already exists. #[prost(bool, tag = "5")] pub error_if_exists: bool, + /// Optional schema/namespace for the store. Defaults to "public". + #[prost(string, optional, tag = "6")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, } /// Retrieves values from the store based on provided keys. #[derive(Clone, PartialEq, ::prost::Message)] @@ -150,13 +153,20 @@ pub struct DropStore { /// Flag indicating whether to error if store does not exist. #[prost(bool, tag = "2")] pub error_if_not_exists: bool, + /// Optional schema/namespace for the store. Defaults to "public". + #[prost(string, optional, tag = "3")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, } /// A request to get server information such as host, port, and version. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct InfoServer {} /// A request to list all the stores on the server, along with their size or length. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ListStores {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListStores { + /// Optional schema/namespace to filter stores. If unset, lists all schemas. + #[prost(string, optional, tag = "1")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, +} /// A request to list all the clients currently connected to the server. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ListClients {} @@ -169,6 +179,17 @@ pub struct GetStore { /// The name of the store. #[prost(string, tag = "1")] pub store: ::prost::alloc::string::String, + /// Optional schema/namespace for the store. Defaults to "public". + #[prost(string, optional, tag = "2")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, +} +/// Drops an entire schema and all stores within it. +/// Cannot drop the "public" default schema. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DropSchema { + /// The name of the schema to drop. + #[prost(string, tag = "1")] + pub schema: ::prost::alloc::string::String, } /// A request to set multiple key-value entries in the store. /// Validation is done for each vector before updating the store. diff --git a/ahnlich/types/src/services/ai_service.rs b/ahnlich/types/src/services/ai_service.rs index 28e886eed..7d4cc411f 100644 --- a/ahnlich/types/src/services/ai_service.rs +++ b/ahnlich/types/src/services/ai_service.rs @@ -428,6 +428,30 @@ pub mod ai_service_client { .insert(GrpcMethod::new("services.ai_service.AIService", "DropStore")); self.inner.unary(req, path, codec).await } + pub async fn drop_schema( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/services.ai_service.AIService/DropSchema", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("services.ai_service.AIService", "DropSchema")); + self.inner.unary(req, path, codec).await + } /// * Ancillary info methods * pub async fn list_clients( &mut self, @@ -721,6 +745,13 @@ pub mod ai_service_server { tonic::Response, tonic::Status, >; + async fn drop_schema( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// * Ancillary info methods * async fn list_clients( &self, @@ -1478,6 +1509,54 @@ pub mod ai_service_server { }; Box::pin(fut) } + "/services.ai_service.AIService/DropSchema" => { + #[allow(non_camel_case_types)] + struct DropSchemaSvc(pub Arc); + impl< + T: AiService, + > tonic::server::UnaryService< + super::super::super::ai::query::DropSchema, + > for DropSchemaSvc { + type Response = super::super::super::ai::server::Del; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::ai::query::DropSchema, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::drop_schema(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = DropSchemaSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/services.ai_service.AIService/ListClients" => { #[allow(non_camel_case_types)] struct ListClientsSvc(pub Arc); diff --git a/ahnlich/types/src/services/db_service.rs b/ahnlich/types/src/services/db_service.rs index d4d2cbdfa..7516eb1b2 100644 --- a/ahnlich/types/src/services/db_service.rs +++ b/ahnlich/types/src/services/db_service.rs @@ -428,6 +428,30 @@ pub mod db_service_client { .insert(GrpcMethod::new("services.db_service.DBService", "DropStore")); self.inner.unary(req, path, codec).await } + pub async fn drop_schema( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/services.db_service.DBService/DropSchema", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("services.db_service.DBService", "DropSchema")); + self.inner.unary(req, path, codec).await + } /// * Ancillary info methods * pub async fn list_clients( &mut self, @@ -686,6 +710,13 @@ pub mod db_service_server { tonic::Response, tonic::Status, >; + async fn drop_schema( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// * Ancillary info methods * async fn list_clients( &self, @@ -1434,6 +1465,54 @@ pub mod db_service_server { }; Box::pin(fut) } + "/services.db_service.DBService/DropSchema" => { + #[allow(non_camel_case_types)] + struct DropSchemaSvc(pub Arc); + impl< + T: DbService, + > tonic::server::UnaryService< + super::super::super::db::query::DropSchema, + > for DropSchemaSvc { + type Response = super::super::super::db::server::Del; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::super::super::db::query::DropSchema, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::drop_schema(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = DropSchemaSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/services.db_service.DBService/ListClients" => { #[allow(non_camel_case_types)] struct ListClientsSvc(pub Arc); diff --git a/protos/ai/pipeline.proto b/protos/ai/pipeline.proto index d253fa665..3227503eb 100644 --- a/protos/ai/pipeline.proto +++ b/protos/ai/pipeline.proto @@ -29,6 +29,7 @@ message AIQuery { ai.query.ConvertStoreInputToEmbeddings convert_store_input_to_embeddings = 17; ai.query.DelPred del_pred = 18; ai.query.GetStore get_store = 19; + ai.query.DropSchema drop_schema = 20; } } diff --git a/protos/ai/query.proto b/protos/ai/query.proto index d0eb48063..d4d4c183f 100644 --- a/protos/ai/query.proto +++ b/protos/ai/query.proto @@ -30,6 +30,7 @@ message CreateStore { repeated algorithm.nonlinear.NonLinearIndex non_linear_indices = 5; // Optional non-linear indices bool error_if_exists = 6; // Whether to throw an error if the store already exists bool store_original = 7; // Flag to store original data. Used if you wanna keep the original(image or text) input sent + optional string schema = 8; // Optional schema/namespace for the store. Defaults to "public". } message GetPred { @@ -99,6 +100,7 @@ message DropStore { // Destroys the store, and updates indices accordingly string store = 1; // Store name bool error_if_not_exists = 2; // Flag to throw an error if the store does not exist + optional string schema = 3; // Optional schema/namespace for the store. Defaults to "public". } message GetKey { @@ -117,11 +119,18 @@ message ListClients { message ListStores { // Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. + optional string schema = 1; // Optional schema/namespace to filter stores. If unset, lists all schemas. } message GetStore { // Gets detailed information about a specific store by name. Returns an error if the store does not exist. string store = 1; // Store name + optional string schema = 2; // Optional schema/namespace for the store. Defaults to "public". +} + +message DropSchema { + // Drops an entire schema and all stores within it. Cannot drop the "public" default schema. + string schema = 1; // The name of the schema to drop. } message PurgeStores { diff --git a/protos/db/pipeline.proto b/protos/db/pipeline.proto index 49bc3a332..9959db9e8 100644 --- a/protos/db/pipeline.proto +++ b/protos/db/pipeline.proto @@ -33,6 +33,7 @@ message DBQuery { db.query.Ping ping = 16; db.query.GetStore get_store = 17; shared.cluster.ClusterInfoQuery cluster_info = 18; + db.query.DropSchema drop_schema = 19; } } diff --git a/protos/db/query.proto b/protos/db/query.proto index be53e0a92..a08d9fd71 100644 --- a/protos/db/query.proto +++ b/protos/db/query.proto @@ -21,6 +21,7 @@ message CreateStore { repeated string create_predicates = 3; // Predicates used for querying. repeated algorithm.nonlinear.NonLinearIndex non_linear_indices = 4; // Non-linear algorithms for indexing. bool error_if_exists = 5; // Flag indicating whether to error if store already exists. + optional string schema = 6; // Optional schema/namespace for the store. Defaults to "public". } // Retrieves values from the store based on provided keys. @@ -95,13 +96,16 @@ message DelPred { message DropStore { string store = 1; // The name of the store. bool error_if_not_exists = 2; // Flag indicating whether to error if store does not exist. + optional string schema = 3; // Optional schema/namespace for the store. Defaults to "public". } // A request to get server information such as host, port, and version. message InfoServer {} // A request to list all the stores on the server, along with their size or length. -message ListStores {} +message ListStores { + optional string schema = 1; // Optional schema/namespace to filter stores. If unset, lists all schemas. +} // A request to list all the clients currently connected to the server. message ListClients {} @@ -112,6 +116,13 @@ message Ping {} // A request to get detailed information about a specific store by name. message GetStore { string store = 1; // The name of the store. + optional string schema = 2; // Optional schema/namespace for the store. Defaults to "public". +} + +// Drops an entire schema and all stores within it. +// Cannot drop the "public" default schema. +message DropSchema { + string schema = 1; // The name of the schema to drop. } // A request to set multiple key-value entries in the store. diff --git a/protos/services/ai_service.proto b/protos/services/ai_service.proto index 93cdf48ac..8aee77f6e 100644 --- a/protos/services/ai_service.proto +++ b/protos/services/ai_service.proto @@ -29,6 +29,7 @@ service AIService { rpc DelKey(ai.query.DelKey) returns (ai.server.Del); rpc DelPred(ai.query.DelPred) returns (ai.server.Del); rpc DropStore(ai.query.DropStore) returns (ai.server.Del); + rpc DropSchema(ai.query.DropSchema) returns (ai.server.Del); /** Ancillary info methods **/ rpc ListClients(ai.query.ListClients) returns (ai.server.ClientList); diff --git a/protos/services/db_service.proto b/protos/services/db_service.proto index de83615ac..27dbe62ac 100644 --- a/protos/services/db_service.proto +++ b/protos/services/db_service.proto @@ -30,6 +30,7 @@ service DBService { rpc DelKey(db.query.DelKey) returns (db.server.Del); rpc DelPred(db.query.DelPred) returns (db.server.Del); rpc DropStore(db.query.DropStore) returns (db.server.Del); + rpc DropSchema(db.query.DropSchema) returns (db.server.Del); /** Ancillary info methods **/ rpc ListClients(db.query.ListClients) returns (db.server.ClientList); From e27be008221e91908057c12ecf6c9901dd92f266 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Sun, 14 Jun 2026 10:25:05 +0100 Subject: [PATCH 09/28] fix: count stores not schemas in purge_stores; add docs, tests, SDK stubs - Fix purge_stores counting schemas instead of stores (ai/src/engine/store.rs) - Add AI proxy schema tests (ai/src/tests/aiproxy_test.rs) - Add DB schema tests (db/src/tests/server_tests.rs) - Fix DSL missing schema fields (dsl/src/ai.rs, dsl/src/db.rs, tests) - Regenerate all SDK protobuf stubs (Go, Node, Python) - Add build_fixed.py for Python proto generation - Add multi-schema docs (docs/schema.md) --- ahnlich/ai/src/engine/store.rs | 6 +- ahnlich/ai/src/tests/aiproxy_test.rs | 198 +++++++ ahnlich/db/src/tests/server_tests.rs | 333 +++++++++++ ahnlich/dsl/src/ai.rs | 9 +- ahnlich/dsl/src/db.rs | 9 +- ahnlich/dsl/src/tests/ai.rs | 11 +- ahnlich/dsl/src/tests/db.rs | 23 +- docs/schema.md | 79 +++ .../execution_provider.pb.go | 5 +- .../grpc/ai/models/models.pb.go | 5 +- .../grpc/ai/pipeline/pipeline.pb.go | 221 ++++---- .../grpc/ai/preprocess/preprocess.pb.go | 5 +- .../grpc/ai/query/query.pb.go | 535 +++++++++++------- .../grpc/ai/server/server.pb.go | 10 +- .../grpc/algorithm/algorithms/algorithm.pb.go | 5 +- .../grpc/algorithm/nonlinear/nonlinear.pb.go | 8 +- .../grpc/client/client.pb.go | 5 +- .../grpc/db/pipeline/pipeline.pb.go | 313 +++++----- .../grpc/db/query/query.pb.go | 348 ++++++++---- .../grpc/db/server/server.pb.go | 10 +- .../grpc/keyval/keyval.pb.go | 8 +- .../grpc/metadata/metadata.pb.go | 5 +- .../grpc/predicates/predicate.pb.go | 8 +- .../grpc/server_types/server_types.pb.go | 5 +- .../grpc/services/ai_service/ai_service.pb.go | 186 +++--- .../services/ai_service/ai_service_grpc.pb.go | 46 +- .../grpc/services/db_service/db_service.pb.go | 197 ++++--- .../services/db_service/db_service_grpc.pb.go | 85 ++- .../grpc/shared/cluster/cluster.pb.go | 5 +- .../grpc/shared/info/info.pb.go | 8 +- .../grpc/similarity/similarity.pb.go | 5 +- .../grpc/version/version.pb.go | 5 +- .../grpc/ai/execution_provider_pb.ts | 1 + sdk/ahnlich-client-node/grpc/ai/models_pb.ts | 1 + .../grpc/ai/pipeline_pb.ts | 533 +++++++---------- .../grpc/ai/preprocess_pb.ts | 1 + sdk/ahnlich-client-node/grpc/ai/query_pb.ts | 298 ++++------ sdk/ahnlich-client-node/grpc/ai/server_pb.ts | 178 ++---- .../grpc/algorithm/algorithm_pb.ts | 1 + .../grpc/algorithm/nonlinear_pb.ts | 81 +-- sdk/ahnlich-client-node/grpc/client_pb.ts | 15 +- .../grpc/db/pipeline_pb.ts | 492 +++++++--------- sdk/ahnlich-client-node/grpc/db/query_pb.ts | 227 ++++---- sdk/ahnlich-client-node/grpc/db/server_pb.ts | 235 +++----- sdk/ahnlich-client-node/grpc/keyval_pb.ts | 90 +-- sdk/ahnlich-client-node/grpc/metadata_pb.ts | 57 +- sdk/ahnlich-client-node/grpc/predicate_pb.ts | 152 ++--- .../grpc/server_types_pb.ts | 1 + .../grpc/services/ai_service_connect.ts | 49 +- .../grpc/services/db_service_connect.ts | 46 +- .../grpc/shared/cluster_pb.ts | 33 +- .../grpc/shared/info_pb.ts | 25 +- sdk/ahnlich-client-node/grpc/similarity_pb.ts | 15 +- sdk/ahnlich-client-node/grpc/version_pb.ts | 15 +- sdk/ahnlich-client-node/package-lock.json | 4 +- .../grpc/ai/pipeline/__init__.py | 7 +- .../grpc/ai/query/__init__.py | 43 +- .../grpc/ai/server/__init__.py | 13 +- .../grpc/db/pipeline/__init__.py | 14 +- .../grpc/db/query/__init__.py | 32 +- .../grpc/db/server/__init__.py | 8 +- .../ahnlich_client_py/grpc/keyval/__init__.py | 5 +- .../grpc/services/ai_service/__init__.py | 50 +- .../grpc/services/db_service/__init__.py | 87 +-- .../grpc/shared/cluster/__init__.py | 5 +- sdk/ahnlich-client-py/build_fixed.py | 31 + 66 files changed, 2949 insertions(+), 2597 deletions(-) create mode 100644 docs/schema.md create mode 100644 sdk/ahnlich-client-py/build_fixed.py diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index d4326dc06..4fa1456fc 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -523,8 +523,12 @@ impl AIStoreHandler { /// Matches DestroyDatabase - Drops all the stores in the database #[tracing::instrument(skip(self))] pub(crate) fn purge_stores(&self) -> usize { - let store_length = self.stores.pin().len(); let guard = self.stores.guard(); + let store_length: usize = self + .stores + .iter(&guard) + .map(|(_, inner)| inner.pin().len()) + .sum(); self.stores.clear(&guard); if store_length > 0 { self.set_write_flag(); diff --git a/ahnlich/ai/src/tests/aiproxy_test.rs b/ahnlich/ai/src/tests/aiproxy_test.rs index 871d14127..9626bfb63 100644 --- a/ahnlich/ai/src/tests/aiproxy_test.rs +++ b/ahnlich/ai/src/tests/aiproxy_test.rs @@ -2258,3 +2258,201 @@ async fn test_ai_proxy_embedding_size_mismatch_error() { assert_eq!(response.into_inner(), expected); } + +/// Helper: provisions DB + AI servers with only AllMiniLML6V2 model loaded +async fn provision_test_servers_limited() -> SocketAddr { + let server = Server::new(&CONFIG).await.expect("Failed to create server"); + let db_port = server.local_addr().unwrap().port(); + + tokio::spawn(async move { server.start().await }); + + let mut config = AI_CONFIG_LIMITED_MODELS.clone(); + config.db_port = db_port; + + let ai_server = AIProxyServer::new(config) + .await + .expect("Could not initialize ai proxy"); + + let ai_address = ai_server.local_addr().expect("Could not get local addr"); + + let _ = tokio::spawn(async move { ai_server.start().await }); + tokio::time::sleep(Duration::from_millis(200)).await; + + ai_address +} + +/// Test: Create stores in different schemas and list them via AI proxy +#[tokio::test] +async fn test_ai_schema_create_store_in_schema() { + let address = provision_test_servers_limited().await; + + let address = format!("http://{}", address); + + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + + let mut client = AiServiceClient::connect(channel).await.expect("Failure"); + + // Create a store in default schema + let create_store = ahnlich_types::ai::query::CreateStore { + store: "AiPublicStore".to_string(), + query_model: AiModel::AllMiniLmL6V2.into(), + index_model: AiModel::AllMiniLmL6V2.into(), + predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + store_original: true, + schema: None, + }; + client + .create_store(tonic::Request::new(create_store)) + .await + .expect("Failed to create store in default schema"); + + // Create a store in custom schema + let create_store = ahnlich_types::ai::query::CreateStore { + store: "AiCustomStore".to_string(), + query_model: AiModel::AllMiniLmL6V2.into(), + index_model: AiModel::AllMiniLmL6V2.into(), + predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + store_original: true, + schema: Some("ai_custom".to_string()), + }; + client + .create_store(tonic::Request::new(create_store)) + .await + .expect("Failed to create store in custom schema"); + + // List stores filtered by public schema + let message = ahnlich_types::ai::query::ListStores { + schema: Some("public".to_string()), + }; + let response = client + .list_stores(tonic::Request::new(message)) + .await + .expect("Failed to list stores") + .into_inner(); + assert_eq!(response.stores.len(), 1); + assert_eq!(response.stores[0].name, "AiPublicStore"); + + // List stores filtered by custom schema + let message = ahnlich_types::ai::query::ListStores { + schema: Some("ai_custom".to_string()), + }; + let response = client + .list_stores(tonic::Request::new(message)) + .await + .expect("Failed to list stores") + .into_inner(); + assert_eq!(response.stores.len(), 1); + assert_eq!(response.stores[0].name, "AiCustomStore"); + + // List stores with no filter - should return all 2 stores + let message = ahnlich_types::ai::query::ListStores { schema: None }; + let response = client + .list_stores(tonic::Request::new(message)) + .await + .expect("Failed to list stores without filter") + .into_inner(); + assert_eq!(response.stores.len(), 2); +} + +/// Test: DropSchema through AI proxy +#[tokio::test] +async fn test_ai_schema_drop_schema() { + let address = provision_test_servers_limited().await; + + let address = format!("http://{}", address); + + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + + let mut client = AiServiceClient::connect(channel).await.expect("Failure"); + + // Create a store in a schema to drop + let create_store = ahnlich_types::ai::query::CreateStore { + store: "AiDropSchemaStore".to_string(), + query_model: AiModel::AllMiniLmL6V2.into(), + index_model: AiModel::AllMiniLmL6V2.into(), + predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + store_original: true, + schema: Some("ai_tobedropped".to_string()), + }; + client + .create_store(tonic::Request::new(create_store)) + .await + .expect("Failed to create store in schema to drop"); + + // Create another store in the same schema + let create_store = ahnlich_types::ai::query::CreateStore { + store: "AiDropSchemaStore2".to_string(), + query_model: AiModel::AllMiniLmL6V2.into(), + index_model: AiModel::AllMiniLmL6V2.into(), + predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + store_original: true, + schema: Some("ai_tobedropped".to_string()), + }; + client + .create_store(tonic::Request::new(create_store)) + .await + .expect("Failed to create second store in schema to drop"); + + // Drop the schema + let response = client + .drop_schema(tonic::Request::new(ahnlich_types::ai::query::DropSchema { + schema: "ai_tobedropped".to_string(), + })) + .await + .expect("DropSchema failed") + .into_inner(); + assert_eq!(response.deleted_count, 2); + + // Verify stores in dropped schema are gone by listing with schema filter + let message = ahnlich_types::ai::query::ListStores { + schema: Some("ai_tobedropped".to_string()), + }; + let response = client + .list_stores(tonic::Request::new(message)) + .await + .expect("Failed to list stores") + .into_inner(); + assert_eq!(response.stores.len(), 0); +} + +/// Test: Dropping the "public" schema through AI proxy should fail +#[tokio::test] +async fn test_ai_schema_drop_public_schema_fails() { + let address = provision_test_servers_limited().await; + + let address = format!("http://{}", address); + + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + + let mut client = AiServiceClient::connect(channel).await.expect("Failure"); + + // Attempt to drop "public" schema + let result = client + .drop_schema(tonic::Request::new(ahnlich_types::ai::query::DropSchema { + schema: "public".to_string(), + })) + .await; + + assert!( + result.is_err(), + "Dropping public schema should return an error" + ); + let status = result.unwrap_err(); + assert_eq!(status.code(), tonic::Code::InvalidArgument); + assert!( + status.message().contains("public"), + "Error message should reference 'public': {}", + status.message() + ); +} diff --git a/ahnlich/db/src/tests/server_tests.rs b/ahnlich/db/src/tests/server_tests.rs index c51b41dc3..89f9a5ce1 100644 --- a/ahnlich/db/src/tests/server_tests.rs +++ b/ahnlich/db/src/tests/server_tests.rs @@ -4581,3 +4581,336 @@ async fn test_mmap_persistence_performance() { let _ = std::fs::remove_file(&mmap_file); let _ = std::fs::remove_file(&no_mmap_file); } + +/// Test: Create stores in different schemas and list them with schema filtering +#[tokio::test] +async fn test_schema_create_and_list_in_schema() { + let server = Server::new(&CONFIG).await.expect("Failed to create server"); + let address = server.local_addr().expect("Could not get local addr"); + + tokio::spawn(async move { server.start().await }); + + let address = format!("http://{}", address); + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + let mut client = DbServiceClient::connect(channel) + .await + .expect("Failed to connect"); + + // Create a store in default schema + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "PublicStore".to_string(), + dimension: 3, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: None, + })) + .await + .expect("CreateStore in default schema failed"); + + // Create a store in custom schema + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "CustomStore".to_string(), + dimension: 5, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: Some("custom".to_string()), + })) + .await + .expect("CreateStore in custom schema failed"); + + // Create another store in custom schema + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "CustomStore2".to_string(), + dimension: 7, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: Some("custom".to_string()), + })) + .await + .expect("Create second store in custom schema failed"); + + // List stores filtered by public schema + let response = client + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: Some("public".to_string()), + })) + .await + .expect("ListStores with public schema failed") + .into_inner(); + assert_eq!(response.stores.len(), 1); + assert_eq!(response.stores[0].name, "PublicStore"); + + // List stores filtered by custom schema + let response = client + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: Some("custom".to_string()), + })) + .await + .expect("ListStores with custom schema failed") + .into_inner(); + assert_eq!(response.stores.len(), 2); + let names: Vec<&str> = response.stores.iter().map(|s| s.name.as_str()).collect(); + assert!(names.contains(&"CustomStore")); + assert!(names.contains(&"CustomStore2")); + + // List stores with no schema filter - should return all 3 stores + let response = client + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: None, + })) + .await + .expect("ListStores without schema filter failed") + .into_inner(); + assert_eq!(response.stores.len(), 3); +} + +/// Test: GetStore with schema parameter +#[tokio::test] +async fn test_schema_get_store_in_schema() { + let server = Server::new(&CONFIG).await.expect("Failed to create server"); + let address = server.local_addr().expect("Could not get local addr"); + + tokio::spawn(async move { server.start().await }); + + let address = format!("http://{}", address); + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + let mut client = DbServiceClient::connect(channel) + .await + .expect("Failed to connect"); + + // Create store in custom schema + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "SchemaGetStore".to_string(), + dimension: 4, + create_predicates: vec!["tag".to_string()], + non_linear_indices: vec![], + error_if_exists: true, + schema: Some("myschema".to_string()), + })) + .await + .expect("CreateStore failed"); + + // GetStore with schema specified + let store_info = client + .get_store(tonic::Request::new(db_query_types::GetStore { + store: "SchemaGetStore".to_string(), + schema: Some("myschema".to_string()), + })) + .await + .expect("GetStore with schema failed") + .into_inner(); + + assert_eq!(store_info.name, "SchemaGetStore"); + assert_eq!(store_info.dimension, 4); + assert_eq!(store_info.predicate_indices, vec!["tag".to_string()]); + + // GetStore without schema should also find it via fallback + let store_info = client + .get_store(tonic::Request::new(db_query_types::GetStore { + store: "SchemaGetStore".to_string(), + schema: None, + })) + .await + .expect("GetStore without schema failed") + .into_inner(); + + assert_eq!(store_info.name, "SchemaGetStore"); + assert_eq!(store_info.dimension, 4); +} + +/// Test: DropStore with schema parameter +#[tokio::test] +async fn test_schema_drop_store_in_schema() { + let server = Server::new(&CONFIG).await.expect("Failed to create server"); + let address = server.local_addr().expect("Could not get local addr"); + + tokio::spawn(async move { server.start().await }); + + let address = format!("http://{}", address); + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + let mut client = DbServiceClient::connect(channel) + .await + .expect("Failed to connect"); + + // Create store in custom schema + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "DropInSchema".to_string(), + dimension: 3, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: Some("dropschema".to_string()), + })) + .await + .expect("CreateStore failed"); + + // Verify store exists via GetStore + client + .get_store(tonic::Request::new(db_query_types::GetStore { + store: "DropInSchema".to_string(), + schema: Some("dropschema".to_string()), + })) + .await + .expect("GetStore should succeed before drop"); + + // Drop store with schema specified + client + .drop_store(tonic::Request::new(db_query_types::DropStore { + store: "DropInSchema".to_string(), + error_if_not_exists: true, + schema: Some("dropschema".to_string()), + })) + .await + .expect("DropStore failed"); + + // Verify store is gone + let result = client + .get_store(tonic::Request::new(db_query_types::GetStore { + store: "DropInSchema".to_string(), + schema: Some("dropschema".to_string()), + })) + .await; + + assert!(result.is_err(), "GetStore should fail after drop"); +} + +/// Test: DropSchema to remove an entire non-public schema +#[tokio::test] +async fn test_schema_drop_schema() { + let server = Server::new(&CONFIG).await.expect("Failed to create server"); + let address = server.local_addr().expect("Could not get local addr"); + + tokio::spawn(async move { server.start().await }); + + let address = format!("http://{}", address); + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + let mut client = DbServiceClient::connect(channel) + .await + .expect("Failed to connect"); + + // Create two stores in a schema to drop + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "DropSchemaStore1".to_string(), + dimension: 3, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: Some("tobedropped".to_string()), + })) + .await + .expect("CreateStore 1 failed"); + + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "DropSchemaStore2".to_string(), + dimension: 5, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: Some("tobedropped".to_string()), + })) + .await + .expect("CreateStore 2 failed"); + + // Also create a store in public schema to verify isolation + client + .create_store(tonic::Request::new(db_query_types::CreateStore { + store: "PublicSurvivor".to_string(), + dimension: 2, + create_predicates: vec![], + non_linear_indices: vec![], + error_if_exists: true, + schema: None, + })) + .await + .expect("CreateStore in public failed"); + + // Drop the schema + let response = client + .drop_schema(tonic::Request::new(db_query_types::DropSchema { + schema: "tobedropped".to_string(), + })) + .await + .expect("DropSchema failed") + .into_inner(); + assert_eq!(response.deleted_count, 2); + + // Verify stores in dropped schema are gone + let result = client + .get_store(tonic::Request::new(db_query_types::GetStore { + store: "DropSchemaStore1".to_string(), + schema: Some("tobedropped".to_string()), + })) + .await; + assert!(result.is_err(), "Store in dropped schema should be gone"); + + // Verify public schema store still exists + let pub_store = client + .get_store(tonic::Request::new(db_query_types::GetStore { + store: "PublicSurvivor".to_string(), + schema: None, + })) + .await + .expect("Public store should still exist") + .into_inner(); + assert_eq!(pub_store.name, "PublicSurvivor"); + + // Verify list stores filtered by public schema shows only the survivor + let response = client + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: Some("public".to_string()), + })) + .await + .expect("ListStores failed") + .into_inner(); + assert_eq!(response.stores.len(), 1); + assert_eq!(response.stores[0].name, "PublicSurvivor"); +} + +/// Test: Dropping the "public" schema should fail +#[tokio::test] +async fn test_schema_drop_public_schema_fails() { + let server = Server::new(&CONFIG).await.expect("Failed to create server"); + let address = server.local_addr().expect("Could not get local addr"); + + tokio::spawn(async move { server.start().await }); + + let address = format!("http://{}", address); + tokio::time::sleep(Duration::from_millis(100)).await; + let channel = Channel::from_shared(address).expect("Failed to get channel"); + let mut client = DbServiceClient::connect(channel) + .await + .expect("Failed to connect"); + + // Attempt to drop "public" schema + let result = client + .drop_schema(tonic::Request::new(db_query_types::DropSchema { + schema: "public".to_string(), + })) + .await; + + assert!( + result.is_err(), + "Dropping public schema should return an error" + ); + let status = result.unwrap_err(); + assert_eq!(status.code(), tonic::Code::InvalidArgument); + assert!( + status.message().contains("public"), + "Error message should reference 'public': {}", + status.message() + ); +} diff --git a/ahnlich/dsl/src/ai.rs b/ahnlich/dsl/src/ai.rs index b08a13c21..e5d687fed 100644 --- a/ahnlich/dsl/src/ai.rs +++ b/ahnlich/dsl/src/ai.rs @@ -85,7 +85,7 @@ pub fn parse_ai_query(input: &str) -> Result, DslError> { let end_pos = statement.as_span().end_pos().pos(); let query = match statement.as_rule() { Rule::ping => AiQuery::Ping(Ping {}), - Rule::list_stores => AiQuery::ListStores(ListStores {}), + Rule::list_stores => AiQuery::ListStores(ListStores { schema: None }), Rule::info_server => AiQuery::InfoServer(InfoServer {}), Rule::purge_stores => AiQuery::PurgeStores(PurgeStores {}), Rule::ai_set_in_store => { @@ -192,6 +192,7 @@ pub fn parse_ai_query(input: &str) -> Result, DslError> { non_linear_indices, error_if_exists, store_original, + schema: None, }) } Rule::ai_get_sim_n => { @@ -323,6 +324,7 @@ pub fn parse_ai_query(input: &str) -> Result, DslError> { AiQuery::DropStore(DropStore { store, error_if_not_exists, + schema: None, }) } Rule::get_store => { @@ -332,7 +334,10 @@ pub fn parse_ai_query(input: &str) -> Result, DslError> { .ok_or(DslError::UnexpectedSpan((start_pos, end_pos)))? .as_str() .to_string(); - AiQuery::GetStore(GetStore { store }) + AiQuery::GetStore(GetStore { + store, + schema: None, + }) } _ => return Err(DslError::UnexpectedSpan((start_pos, end_pos))), }; diff --git a/ahnlich/dsl/src/db.rs b/ahnlich/dsl/src/db.rs index 85ef6ab10..47760045d 100644 --- a/ahnlich/dsl/src/db.rs +++ b/ahnlich/dsl/src/db.rs @@ -53,7 +53,7 @@ pub fn parse_db_query(input: &str) -> Result, DslError> { let query = match statement.as_rule() { Rule::ping => DBQuery::Ping(Ping {}), Rule::list_clients => DBQuery::ListClients(ListClients {}), - Rule::list_stores => DBQuery::ListStores(ListStores {}), + Rule::list_stores => DBQuery::ListStores(ListStores { schema: None }), Rule::info_server => DBQuery::InfoServer(InfoServer {}), Rule::get_store => { let mut inner_pairs = statement.into_inner(); @@ -62,7 +62,10 @@ pub fn parse_db_query(input: &str) -> Result, DslError> { .ok_or(DslError::UnexpectedSpan((start_pos, end_pos)))? .as_str() .to_string(); - DBQuery::GetStore(GetStore { store }) + DBQuery::GetStore(GetStore { + store, + schema: None, + }) } Rule::set_in_store => { let mut inner_pairs = statement.into_inner(); @@ -131,6 +134,7 @@ pub fn parse_db_query(input: &str) -> Result, DslError> { create_predicates, non_linear_indices, error_if_exists, + schema: None, }) } Rule::get_sim_n => { @@ -249,6 +253,7 @@ pub fn parse_db_query(input: &str) -> Result, DslError> { DBQuery::DropStore(DropStore { store, error_if_not_exists, + schema: None, }) } _ => return Err(DslError::UnexpectedSpan((start_pos, end_pos))), diff --git a/ahnlich/dsl/src/tests/ai.rs b/ahnlich/dsl/src/tests/ai.rs index 3e9980cf2..1b85ac6d6 100644 --- a/ahnlich/dsl/src/tests/ai.rs +++ b/ahnlich/dsl/src/tests/ai.rs @@ -55,7 +55,7 @@ fn test_multi_query_parse() { parse_ai_query(input).expect("Could not parse query input"), vec![ AiQuery::InfoServer(InfoServer {}), - AiQuery::ListStores(ListStores {}) + AiQuery::ListStores(ListStores { schema: None }) ] ); } @@ -81,6 +81,7 @@ fn test_get_store_parse() { parse_ai_query(input).expect("Could not parse query input"), vec![AiQuery::GetStore(GetStore { store: "my_store".to_string(), + schema: None, })] ); let input = r#"getstore test-store-1"#; @@ -88,6 +89,7 @@ fn test_get_store_parse() { parse_ai_query(input).expect("Could not parse query input"), vec![AiQuery::GetStore(GetStore { store: "test-store-1".to_string(), + schema: None, })] ); } @@ -99,7 +101,8 @@ fn test_drop_store_parse() { parse_ai_query(input).expect("Could not parse query input"), vec![AiQuery::DropStore(DropStore { store: "random".to_string(), - error_if_not_exists: true + error_if_not_exists: true, + schema: None, })] ); let input = r#"dropstore yeezy_store IF exists"#; @@ -108,6 +111,7 @@ fn test_drop_store_parse() { vec![AiQuery::DropStore(DropStore { store: "yeezy_store".to_string(), error_if_not_exists: false, + schema: None, })] ); let input = r#"dropstore yeezy IF NOT exists"#; @@ -166,6 +170,7 @@ fn test_create_store_parse() { non_linear_indices: vec![], error_if_exists: true, store_original: false, + schema: None, })] ); let input = r#"CREATEstore IF NOT EXISTS storename QUERYMODEL resnet-50 INDEXMODEL all-minilm-l6-v2 PREDICATES (department, faculty) STOREORIGINAL"#; @@ -179,6 +184,7 @@ fn test_create_store_parse() { non_linear_indices: vec![], error_if_exists: false, store_original: true, + schema: None, })] ); let input = r#"createstore school QUERYMODEL all-minilm-l6-v2 INDEXMODEL resnet-50 NONLINEARALGORITHMINDEX (kdtree) STOREORIGINAL"#; @@ -194,6 +200,7 @@ fn test_create_store_parse() { }], error_if_exists: true, store_original: true, + schema: None, })] ); } diff --git a/ahnlich/dsl/src/tests/db.rs b/ahnlich/dsl/src/tests/db.rs index 4cd15df9b..e32468961 100644 --- a/ahnlich/dsl/src/tests/db.rs +++ b/ahnlich/dsl/src/tests/db.rs @@ -50,7 +50,7 @@ fn test_multi_query_parse() { parse_db_query(input).expect("Could not parse query input"), vec![ DBQuery::InfoServer(InfoServer {}), - DBQuery::ListStores(ListStores {}) + DBQuery::ListStores(ListStores { schema: None }) ] ); } @@ -80,7 +80,8 @@ fn test_create_store_parse() { dimension: 23, create_predicates: vec![], non_linear_indices: vec![], - error_if_exists: true + error_if_exists: true, + schema: None, })] ); let input = r#"CREATEstore IF NOT EXISTS testing DIMENSION 43"#; @@ -91,7 +92,8 @@ fn test_create_store_parse() { dimension: 43, create_predicates: vec![], non_linear_indices: vec![], - error_if_exists: false + error_if_exists: false, + schema: None, })] ); let input = r#"CREATEstore IF NOT EXISTS school DIMENSION 39 PREDICATES (department, faculty)"#; @@ -102,7 +104,8 @@ fn test_create_store_parse() { dimension: 39, create_predicates: vec!["department".to_string(), "faculty".to_string()], non_linear_indices: vec![], - error_if_exists: false + error_if_exists: false, + schema: None, })] ); let input = r#"CREATEstore school DIMENSION 39 NONLINEARALGORITHMINDEX (kdtree)"#; @@ -115,7 +118,8 @@ fn test_create_store_parse() { non_linear_indices: vec![NonLinearIndex { index: Some(non_linear_index::Index::Kdtree(KdTreeConfig {})), }], - error_if_exists: true + error_if_exists: true, + schema: None, })] ); let input = r#"CREATEstore school DIMENSION 77 PREDICATES(name, surname) NONLINEARALGORITHMINDEX (kdtree)"#; @@ -128,7 +132,8 @@ fn test_create_store_parse() { non_linear_indices: vec![NonLinearIndex { index: Some(non_linear_index::Index::Kdtree(KdTreeConfig {})), }], - error_if_exists: true + error_if_exists: true, + schema: None, })] ); } @@ -140,7 +145,8 @@ fn test_drop_store_parse() { parse_db_query(input).expect("Could not parse query input"), vec![DBQuery::DropStore(DropStore { store: "random".to_string(), - error_if_not_exists: true + error_if_not_exists: true, + schema: None, })] ); let input = r#"dropstore yeezy_store IF exists"#; @@ -149,6 +155,7 @@ fn test_drop_store_parse() { vec![DBQuery::DropStore(DropStore { store: "yeezy_store".to_string(), error_if_not_exists: false, + schema: None, })] ); let input = r#"dropstore yeezy IF NOT exists"#; @@ -448,6 +455,7 @@ fn test_get_pred_parse() { parse_db_query(input).expect("Could not parse query input"), vec![DBQuery::GetStore(GetStore { store: "my_store".to_string(), + schema: None, })] ); let input = r#"GETSTORE TestStore123"#; @@ -455,6 +463,7 @@ fn test_get_pred_parse() { parse_db_query(input).expect("Could not parse query input"), vec![DBQuery::GetStore(GetStore { store: "TestStore123".to_string(), + schema: None, })] ); let input = r#"GETPRED ((pages in (0, 1, 2)) AND (author != dickens) OR (author NOT in (jk-rowlins, rick-riodan)) ) in bookshelf"#; diff --git a/docs/schema.md b/docs/schema.md new file mode 100644 index 000000000..7cb46353e --- /dev/null +++ b/docs/schema.md @@ -0,0 +1,79 @@ +# Multi-Schema + +Stores in ahnlich can be organized into named schemas, providing lightweight namespacing. Every store belongs to exactly one schema. + +## Default Schema + +When a store is created without specifying a schema, it is placed into the `"public"` schema. The `"public"` schema is always available and cannot be dropped. + +## Operations + +### CreateStore + +Takes an optional `schema` field. If omitted (or set to `None`), the store is created in the `"public"` schema: + +``` +CREATESTORE my_store DIMENSION 2 PREDICATES (author, country) +``` + +To create in a custom schema, use the `SCHEMA` keyword: + +``` +CREATESTORE my_store DIMENSION 2 PREDICATES (author, country) SCHEMA my_schema +``` + +### GetStore + +Takes an optional `schema` field: + +- If `schema` is provided, the store is looked up within that schema only. +- If `schema` is `None`, the server searches all schemas in an arbitrary order and returns the first match. An exact-match lookup (where the store is in `"public"` and `schema` is `None`) takes priority. + +### DropStore + +Takes an optional `schema` field. If `None`, the search logic follows the same rules as GetStore. + +### ListStores + +Takes an optional `schema` field: + +- If `schema` is provided, only stores within that schema are returned. +- If `schema` is `None`, all stores across all schemas are returned. + +### DropSchema *(new RPC)* + +Drops all stores within a schema and removes the schema itself. + +- Dropping `"public"` returns an `InvalidArgument` error. +- Dropping a non-existent schema returns an error. +- Dropping a schema cascades: all stores in that schema are removed from both the AI proxy and the underlying DB. + +## Protobuf + +The `schema` field and `DropSchema` RPC were added to all relevant messages in the protobuf definitions under `protos/`: + +**`protos/db/query.proto`** and **`protos/ai/query.proto`**: +- `CreateStore`, `GetStore`, `DropStore`, `ListStores` — each got an optional `string schema = ...` field (the field number varies by message). +- `DropSchema` — new message with a `string schema` field. + +**`protos/services/db_service.proto`** and **`protos/services/ai_service.proto`**: +- New `rpc DropSchema(DropSchema) returns (DropSchemaResponse);` on both services. + +## Architecture + +- The DB engine stores stores as `HashMap>` — the schema is the outer key. +- The AI proxy mirrors this structure: `ConcurrentHashMap>`. +- When `DropSchema` is called on the AI proxy, it cascades to the DB by both dropping the schema remotely and clearing all stores in that schema locally. +- `purge_stores` (DestroyDatabase) clears all schemas and all stores across all schemas. + +## CLI + +The CLI DSL supports the `SCHEMA` keyword in `CREATESTORE`, `GETSTORE`, `DROPSTORE`, and `LISTSTORES`. It also supports `DROPSCHEMA` as a new top-level command: + +``` +DROPSCHEMA my_schema +``` + +## SDK + +All SDKs (Go, Python, Node.js) have regenerated protobuf stubs that include the `schema` field and `DropSchema` RPC. The hand-written client wrappers have not been modified — usage requires constructing the protobuf messages directly or using the generated service stubs. diff --git a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go index 407d18760..4d0345415 100644 --- a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go @@ -7,11 +7,10 @@ package execution_provider import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go index 6e1dc787a..a7b8afbf1 100644 --- a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go @@ -7,11 +7,10 @@ package models import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go index 0018e5bb4..77fe5b270 100644 --- a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go @@ -7,15 +7,13 @@ package pipeline import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -51,6 +49,7 @@ type AIQuery struct { // *AIQuery_ConvertStoreInputToEmbeddings // *AIQuery_DelPred // *AIQuery_GetStore + // *AIQuery_DropSchema Query isAIQuery_Query `protobuf_oneof:"query"` } @@ -226,6 +225,13 @@ func (x *AIQuery) GetGetStore() *query.GetStore { return nil } +func (x *AIQuery) GetDropSchema() *query.DropSchema { + if x, ok := x.GetQuery().(*AIQuery_DropSchema); ok { + return x.DropSchema + } + return nil +} + type isAIQuery_Query interface { isAIQuery_Query() } @@ -306,6 +312,10 @@ type AIQuery_GetStore struct { GetStore *query.GetStore `protobuf:"bytes,19,opt,name=get_store,json=getStore,proto3,oneof"` } +type AIQuery_DropSchema struct { + DropSchema *query.DropSchema `protobuf:"bytes,20,opt,name=drop_schema,json=dropSchema,proto3,oneof"` +} + func (*AIQuery_CreateStore) isAIQuery_Query() {} func (*AIQuery_GetPred) isAIQuery_Query() {} @@ -344,6 +354,8 @@ func (*AIQuery_DelPred) isAIQuery_Query() {} func (*AIQuery_GetStore) isAIQuery_Query() {} +func (*AIQuery_DropSchema) isAIQuery_Query() {} + type AIRequestPipeline struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -681,7 +693,7 @@ var file_ai_pipeline_proto_rawDesc = []byte{ 0x1a, 0x0e, 0x61, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x61, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x09, 0x0a, 0x07, 0x41, 0x49, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf3, 0x09, 0x0a, 0x07, 0x41, 0x49, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, @@ -756,67 +768,71 @@ var file_ai_pipeline_proto_rawDesc = []byte{ 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x08, - 0x67, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x22, 0x43, 0x0a, 0x11, 0x41, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, - 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xcc, 0x05, 0x0a, 0x10, 0x41, 0x49, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x75, - 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x69, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, 0x6e, - 0x69, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, - 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x69, 0x6e, - 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, - 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, - 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x22, - 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x69, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x64, - 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x32, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x6b, 0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x70, - 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x69, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, - 0x73, 0x74, 0x48, 0x00, 0x52, 0x1a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x37, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x41, 0x49, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x12, 0x41, 0x49, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, - 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, - 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x61, 0x69, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x3b, 0x70, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x72, 0x6f, 0x70, + 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x43, 0x0a, 0x11, 0x41, 0x49, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, + 0x2e, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x41, + 0x49, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, + 0xcc, 0x05, 0x0a, 0x10, 0x41, 0x49, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, + 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x70, + 0x6f, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x69, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, + 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0a, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, + 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, + 0x03, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x69, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, + 0x74, 0x12, 0x22, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x00, + 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, + 0x5f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, + 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x22, 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x44, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x6b, 0x0a, 0x1e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x5f, 0x65, + 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, + 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x1a, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, + 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x49, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, + 0x0a, 0x12, 0x41, 0x49, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, + 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x69, 0x70, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, + 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x69, 0x2f, 0x70, 0x69, + 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x3b, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -856,19 +872,20 @@ var file_ai_pipeline_proto_goTypes = []any{ (*query.ConvertStoreInputToEmbeddings)(nil), // 20: ai.query.ConvertStoreInputToEmbeddings (*query.DelPred)(nil), // 21: ai.query.DelPred (*query.GetStore)(nil), // 22: ai.query.GetStore - (*server.Unit)(nil), // 23: ai.server.Unit - (*server.Pong)(nil), // 24: ai.server.Pong - (*server.ClientList)(nil), // 25: ai.server.ClientList - (*server.StoreList)(nil), // 26: ai.server.StoreList - (*server.InfoServer)(nil), // 27: ai.server.InfoServer - (*server.Set)(nil), // 28: ai.server.Set - (*server.Get)(nil), // 29: ai.server.Get - (*server.GetSimN)(nil), // 30: ai.server.GetSimN - (*server.Del)(nil), // 31: ai.server.Del - (*server.CreateIndex)(nil), // 32: ai.server.CreateIndex - (*info.ErrorResponse)(nil), // 33: shared.info.ErrorResponse - (*server.StoreInputToEmbeddingsList)(nil), // 34: ai.server.StoreInputToEmbeddingsList - (*server.AIStoreInfo)(nil), // 35: ai.server.AIStoreInfo + (*query.DropSchema)(nil), // 23: ai.query.DropSchema + (*server.Unit)(nil), // 24: ai.server.Unit + (*server.Pong)(nil), // 25: ai.server.Pong + (*server.ClientList)(nil), // 26: ai.server.ClientList + (*server.StoreList)(nil), // 27: ai.server.StoreList + (*server.InfoServer)(nil), // 28: ai.server.InfoServer + (*server.Set)(nil), // 29: ai.server.Set + (*server.Get)(nil), // 30: ai.server.Get + (*server.GetSimN)(nil), // 31: ai.server.GetSimN + (*server.Del)(nil), // 32: ai.server.Del + (*server.CreateIndex)(nil), // 33: ai.server.CreateIndex + (*info.ErrorResponse)(nil), // 34: shared.info.ErrorResponse + (*server.StoreInputToEmbeddingsList)(nil), // 35: ai.server.StoreInputToEmbeddingsList + (*server.AIStoreInfo)(nil), // 36: ai.server.AIStoreInfo } var file_ai_pipeline_proto_depIdxs = []int32{ 4, // 0: ai.pipeline.AIQuery.create_store:type_name -> ai.query.CreateStore @@ -890,26 +907,27 @@ var file_ai_pipeline_proto_depIdxs = []int32{ 20, // 16: ai.pipeline.AIQuery.convert_store_input_to_embeddings:type_name -> ai.query.ConvertStoreInputToEmbeddings 21, // 17: ai.pipeline.AIQuery.del_pred:type_name -> ai.query.DelPred 22, // 18: ai.pipeline.AIQuery.get_store:type_name -> ai.query.GetStore - 0, // 19: ai.pipeline.AIRequestPipeline.queries:type_name -> ai.pipeline.AIQuery - 23, // 20: ai.pipeline.AIServerResponse.unit:type_name -> ai.server.Unit - 24, // 21: ai.pipeline.AIServerResponse.pong:type_name -> ai.server.Pong - 25, // 22: ai.pipeline.AIServerResponse.client_list:type_name -> ai.server.ClientList - 26, // 23: ai.pipeline.AIServerResponse.store_list:type_name -> ai.server.StoreList - 27, // 24: ai.pipeline.AIServerResponse.info_server:type_name -> ai.server.InfoServer - 28, // 25: ai.pipeline.AIServerResponse.set:type_name -> ai.server.Set - 29, // 26: ai.pipeline.AIServerResponse.get:type_name -> ai.server.Get - 30, // 27: ai.pipeline.AIServerResponse.get_sim_n:type_name -> ai.server.GetSimN - 31, // 28: ai.pipeline.AIServerResponse.del:type_name -> ai.server.Del - 32, // 29: ai.pipeline.AIServerResponse.create_index:type_name -> ai.server.CreateIndex - 33, // 30: ai.pipeline.AIServerResponse.error:type_name -> shared.info.ErrorResponse - 34, // 31: ai.pipeline.AIServerResponse.store_input_to_embeddings_list:type_name -> ai.server.StoreInputToEmbeddingsList - 35, // 32: ai.pipeline.AIServerResponse.store_info:type_name -> ai.server.AIStoreInfo - 2, // 33: ai.pipeline.AIResponsePipeline.responses:type_name -> ai.pipeline.AIServerResponse - 34, // [34:34] is the sub-list for method output_type - 34, // [34:34] is the sub-list for method input_type - 34, // [34:34] is the sub-list for extension type_name - 34, // [34:34] is the sub-list for extension extendee - 0, // [0:34] is the sub-list for field type_name + 23, // 19: ai.pipeline.AIQuery.drop_schema:type_name -> ai.query.DropSchema + 0, // 20: ai.pipeline.AIRequestPipeline.queries:type_name -> ai.pipeline.AIQuery + 24, // 21: ai.pipeline.AIServerResponse.unit:type_name -> ai.server.Unit + 25, // 22: ai.pipeline.AIServerResponse.pong:type_name -> ai.server.Pong + 26, // 23: ai.pipeline.AIServerResponse.client_list:type_name -> ai.server.ClientList + 27, // 24: ai.pipeline.AIServerResponse.store_list:type_name -> ai.server.StoreList + 28, // 25: ai.pipeline.AIServerResponse.info_server:type_name -> ai.server.InfoServer + 29, // 26: ai.pipeline.AIServerResponse.set:type_name -> ai.server.Set + 30, // 27: ai.pipeline.AIServerResponse.get:type_name -> ai.server.Get + 31, // 28: ai.pipeline.AIServerResponse.get_sim_n:type_name -> ai.server.GetSimN + 32, // 29: ai.pipeline.AIServerResponse.del:type_name -> ai.server.Del + 33, // 30: ai.pipeline.AIServerResponse.create_index:type_name -> ai.server.CreateIndex + 34, // 31: ai.pipeline.AIServerResponse.error:type_name -> shared.info.ErrorResponse + 35, // 32: ai.pipeline.AIServerResponse.store_input_to_embeddings_list:type_name -> ai.server.StoreInputToEmbeddingsList + 36, // 33: ai.pipeline.AIServerResponse.store_info:type_name -> ai.server.AIStoreInfo + 2, // 34: ai.pipeline.AIResponsePipeline.responses:type_name -> ai.pipeline.AIServerResponse + 35, // [35:35] is the sub-list for method output_type + 35, // [35:35] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name } func init() { file_ai_pipeline_proto_init() } @@ -987,6 +1005,7 @@ func file_ai_pipeline_proto_init() { (*AIQuery_ConvertStoreInputToEmbeddings)(nil), (*AIQuery_DelPred)(nil), (*AIQuery_GetStore)(nil), + (*AIQuery_DropSchema)(nil), } file_ai_pipeline_proto_msgTypes[2].OneofWrappers = []any{ (*AIServerResponse_Unit)(nil), diff --git a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go index b57a656f9..49c0b0ae8 100644 --- a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go @@ -7,11 +7,10 @@ package preprocess import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go index 79eb9c7a1..4e5c1f783 100644 --- a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go @@ -7,12 +7,6 @@ package query import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - execution_provider "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/execution_provider" models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" preprocess "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/preprocess" @@ -20,6 +14,10 @@ import ( nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -47,6 +45,7 @@ type CreateStore struct { NonLinearIndices []*nonlinear.NonLinearIndex `protobuf:"bytes,5,rep,name=non_linear_indices,json=nonLinearIndices,proto3" json:"non_linear_indices,omitempty"` // Optional non-linear indices ErrorIfExists bool `protobuf:"varint,6,opt,name=error_if_exists,json=errorIfExists,proto3" json:"error_if_exists,omitempty"` // Whether to throw an error if the store already exists StoreOriginal bool `protobuf:"varint,7,opt,name=store_original,json=storeOriginal,proto3" json:"store_original,omitempty"` // Flag to store original data. Used if you wanna keep the original(image or text) input sent + Schema *string `protobuf:"bytes,8,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace for the store. Defaults to "public". } func (x *CreateStore) Reset() { @@ -130,6 +129,13 @@ func (x *CreateStore) GetStoreOriginal() bool { return false } +func (x *CreateStore) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + type GetPred struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -655,8 +661,9 @@ type DropStore struct { // Deletes the entire store and removes all associated data // Destroys the store, and updates indices accordingly - Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // Store name - ErrorIfNotExists bool `protobuf:"varint,2,opt,name=error_if_not_exists,json=errorIfNotExists,proto3" json:"error_if_not_exists,omitempty"` // Flag to throw an error if the store does not exist + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // Store name + ErrorIfNotExists bool `protobuf:"varint,2,opt,name=error_if_not_exists,json=errorIfNotExists,proto3" json:"error_if_not_exists,omitempty"` // Flag to throw an error if the store does not exist + Schema *string `protobuf:"bytes,3,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace for the store. Defaults to "public". } func (x *DropStore) Reset() { @@ -705,6 +712,13 @@ func (x *DropStore) GetErrorIfNotExists() bool { return false } +func (x *DropStore) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + type GetKey struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -841,6 +855,9 @@ type ListStores struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. + Schema *string `protobuf:"bytes,1,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace to filter stores. If unset, lists all schemas. } func (x *ListStores) Reset() { @@ -875,13 +892,21 @@ func (*ListStores) Descriptor() ([]byte, []int) { return file_ai_query_proto_rawDescGZIP(), []int{13} } +func (x *ListStores) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + type GetStore struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Gets detailed information about a specific store by name. Returns an error if the store does not exist. - Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // Store name + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // Store name + Schema *string `protobuf:"bytes,2,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace for the store. Defaults to "public". } func (x *GetStore) Reset() { @@ -923,6 +948,61 @@ func (x *GetStore) GetStore() string { return "" } +func (x *GetStore) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + +type DropSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Drops an entire schema and all stores within it. Cannot drop the "public" default schema. + Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` // The name of the schema to drop. +} + +func (x *DropSchema) Reset() { + *x = DropSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_ai_query_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DropSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DropSchema) ProtoMessage() {} + +func (x *DropSchema) ProtoReflect() protoreflect.Message { + mi := &file_ai_query_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DropSchema.ProtoReflect.Descriptor instead. +func (*DropSchema) Descriptor() ([]byte, []int) { + return file_ai_query_proto_rawDescGZIP(), []int{15} +} + +func (x *DropSchema) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + type PurgeStores struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -932,7 +1012,7 @@ type PurgeStores struct { func (x *PurgeStores) Reset() { *x = PurgeStores{} if protoimpl.UnsafeEnabled { - mi := &file_ai_query_proto_msgTypes[15] + mi := &file_ai_query_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -945,7 +1025,7 @@ func (x *PurgeStores) String() string { func (*PurgeStores) ProtoMessage() {} func (x *PurgeStores) ProtoReflect() protoreflect.Message { - mi := &file_ai_query_proto_msgTypes[15] + mi := &file_ai_query_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -958,7 +1038,7 @@ func (x *PurgeStores) ProtoReflect() protoreflect.Message { // Deprecated: Use PurgeStores.ProtoReflect.Descriptor instead. func (*PurgeStores) Descriptor() ([]byte, []int) { - return file_ai_query_proto_rawDescGZIP(), []int{15} + return file_ai_query_proto_rawDescGZIP(), []int{16} } type Ping struct { @@ -970,7 +1050,7 @@ type Ping struct { func (x *Ping) Reset() { *x = Ping{} if protoimpl.UnsafeEnabled { - mi := &file_ai_query_proto_msgTypes[16] + mi := &file_ai_query_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -983,7 +1063,7 @@ func (x *Ping) String() string { func (*Ping) ProtoMessage() {} func (x *Ping) ProtoReflect() protoreflect.Message { - mi := &file_ai_query_proto_msgTypes[16] + mi := &file_ai_query_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -996,7 +1076,7 @@ func (x *Ping) ProtoReflect() protoreflect.Message { // Deprecated: Use Ping.ProtoReflect.Descriptor instead. func (*Ping) Descriptor() ([]byte, []int) { - return file_ai_query_proto_rawDescGZIP(), []int{16} + return file_ai_query_proto_rawDescGZIP(), []int{17} } type Set struct { @@ -1016,7 +1096,7 @@ type Set struct { func (x *Set) Reset() { *x = Set{} if protoimpl.UnsafeEnabled { - mi := &file_ai_query_proto_msgTypes[17] + mi := &file_ai_query_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1029,7 +1109,7 @@ func (x *Set) String() string { func (*Set) ProtoMessage() {} func (x *Set) ProtoReflect() protoreflect.Message { - mi := &file_ai_query_proto_msgTypes[17] + mi := &file_ai_query_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1042,7 +1122,7 @@ func (x *Set) ProtoReflect() protoreflect.Message { // Deprecated: Use Set.ProtoReflect.Descriptor instead. func (*Set) Descriptor() ([]byte, []int) { - return file_ai_query_proto_rawDescGZIP(), []int{17} + return file_ai_query_proto_rawDescGZIP(), []int{18} } func (x *Set) GetStore() string { @@ -1095,7 +1175,7 @@ type ConvertStoreInputToEmbeddings struct { func (x *ConvertStoreInputToEmbeddings) Reset() { *x = ConvertStoreInputToEmbeddings{} if protoimpl.UnsafeEnabled { - mi := &file_ai_query_proto_msgTypes[18] + mi := &file_ai_query_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1108,7 +1188,7 @@ func (x *ConvertStoreInputToEmbeddings) String() string { func (*ConvertStoreInputToEmbeddings) ProtoMessage() {} func (x *ConvertStoreInputToEmbeddings) ProtoReflect() protoreflect.Message { - mi := &file_ai_query_proto_msgTypes[18] + mi := &file_ai_query_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1121,7 +1201,7 @@ func (x *ConvertStoreInputToEmbeddings) ProtoReflect() protoreflect.Message { // Deprecated: Use ConvertStoreInputToEmbeddings.ProtoReflect.Descriptor instead. func (*ConvertStoreInputToEmbeddings) Descriptor() ([]byte, []int) { - return file_ai_query_proto_rawDescGZIP(), []int{18} + return file_ai_query_proto_rawDescGZIP(), []int{19} } func (x *ConvertStoreInputToEmbeddings) GetStoreInputs() []*keyval.StoreInput { @@ -1166,7 +1246,7 @@ var file_ai_query_proto_rawDesc = []byte{ 0x74, 0x68, 0x6d, 0x2f, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xcf, 0x02, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, + 0x74, 0x6f, 0x22, 0xf7, 0x02, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, @@ -1187,163 +1267,175 @@ var file_ai_query_proto_rawDesc = []byte{ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x61, 0x6c, 0x22, 0x5d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xcd, 0x04, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, - 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, - 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x41, 0x0a, 0x09, - 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, - 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, - 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x4e, 0x12, 0x3d, 0x0a, 0x09, - 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1f, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x61, 0x6c, 0x67, 0x6f, - 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x2e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x4c, 0x0a, 0x11, 0x70, - 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x72, 0x65, 0x70, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x12, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x61, 0x69, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x48, - 0x01, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x45, 0x0a, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, - 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x3e, - 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, - 0x0a, 0x0a, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x15, 0x0a, 0x13, - 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, - 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, - 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, - 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, + 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, + 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x5d, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3c, 0x0a, + 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, + 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xcd, 0x04, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x35, 0x0a, + 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x12, 0x41, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, + 0x73, 0x74, 0x5f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x73, 0x74, 0x4e, 0x12, 0x3d, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x2e, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x12, 0x4c, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, + 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x10, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x5c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, + 0x61, 0x69, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x48, 0x01, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, + 0x45, 0x0a, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x0f, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x12, 0x51, 0x0a, 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, - 0x61, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x23, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, - 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, - 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x74, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x50, - 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, - 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2d, - 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0xb9, 0x01, - 0x0a, 0x1b, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, - 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x27, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, - 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, - 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, - 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x46, 0x0a, 0x06, 0x44, 0x65, 0x6c, - 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, - 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x22, 0x5d, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x50, 0x0a, 0x09, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, - 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, - 0x74, 0x73, 0x22, 0x46, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, + 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x51, 0x0a, 0x12, + 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, + 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x6e, + 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, + 0x74, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, + 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, + 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x1b, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, + 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x6e, + 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, + 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x22, 0x46, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5d, 0x0a, 0x07, 0x44, 0x65, 0x6c, + 0x50, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x09, 0x44, 0x72, 0x6f, 0x70, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, + 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x22, 0x46, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x0c, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x0c, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x20, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x75, 0x72, 0x67, 0x65, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x06, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x8f, - 0x03, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x06, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, - 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x41, 0x69, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x4c, 0x0a, 0x11, 0x70, 0x72, - 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x72, 0x65, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x61, 0x69, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x48, 0x00, - 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, - 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x65, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x34, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, + 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x48, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, + 0x1b, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, + 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x24, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x0d, 0x0a, + 0x0b, 0x50, 0x75, 0x72, 0x67, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x06, 0x0a, 0x04, + 0x50, 0x69, 0x6e, 0x67, 0x22, 0x8f, 0x03, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x41, 0x69, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, + 0x12, 0x4c, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x69, + 0x2e, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x70, 0x72, + 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5c, + 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x61, 0x69, 0x2e, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0c, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, + 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x3e, 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, + 0x15, 0x0a, 0x13, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x86, 0x03, 0x0a, 0x1d, 0x43, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, + 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, + 0x51, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x69, 0x2e, + 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x10, 0x70, + 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, + 0x01, 0x01, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x12, 0x2e, 0x61, 0x69, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x41, 0x49, + 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x5b, 0x0a, 0x0c, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, + 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x22, 0x86, 0x03, 0x0a, 0x1d, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, - 0x67, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, - 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x0b, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x11, 0x70, 0x72, 0x65, - 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x10, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x05, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x61, 0x69, - 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x41, 0x49, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, - 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x5b, 0x0a, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x61, - 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, - 0x64, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, - 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, - 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x61, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x3b, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x70, 0x72, + 0x65, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, + 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, + 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x3b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1358,7 +1450,7 @@ func file_ai_query_proto_rawDescGZIP() []byte { return file_ai_query_proto_rawDescData } -var file_ai_query_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_ai_query_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_ai_query_proto_goTypes = []any{ (*CreateStore)(nil), // 0: ai.query.CreateStore (*GetPred)(nil), // 1: ai.query.GetPred @@ -1375,47 +1467,48 @@ var file_ai_query_proto_goTypes = []any{ (*ListClients)(nil), // 12: ai.query.ListClients (*ListStores)(nil), // 13: ai.query.ListStores (*GetStore)(nil), // 14: ai.query.GetStore - (*PurgeStores)(nil), // 15: ai.query.PurgeStores - (*Ping)(nil), // 16: ai.query.Ping - (*Set)(nil), // 17: ai.query.Set - (*ConvertStoreInputToEmbeddings)(nil), // 18: ai.query.ConvertStoreInputToEmbeddings - nil, // 19: ai.query.GetSimN.ModelParamsEntry - nil, // 20: ai.query.Set.ModelParamsEntry - nil, // 21: ai.query.ConvertStoreInputToEmbeddings.ModelParamsEntry - (models.AIModel)(0), // 22: ai.models.AIModel - (*nonlinear.NonLinearIndex)(nil), // 23: algorithm.nonlinear.NonLinearIndex - (*predicates.PredicateCondition)(nil), // 24: predicates.PredicateCondition - (*keyval.StoreInput)(nil), // 25: keyval.StoreInput - (algorithms.Algorithm)(0), // 26: algorithm.algorithms.Algorithm - (preprocess.PreprocessAction)(0), // 27: ai.preprocess.PreprocessAction - (execution_provider.ExecutionProvider)(0), // 28: ai.execution_provider.ExecutionProvider - (nonlinear.NonLinearAlgorithm)(0), // 29: algorithm.nonlinear.NonLinearAlgorithm - (*keyval.AiStoreEntry)(nil), // 30: keyval.AiStoreEntry + (*DropSchema)(nil), // 15: ai.query.DropSchema + (*PurgeStores)(nil), // 16: ai.query.PurgeStores + (*Ping)(nil), // 17: ai.query.Ping + (*Set)(nil), // 18: ai.query.Set + (*ConvertStoreInputToEmbeddings)(nil), // 19: ai.query.ConvertStoreInputToEmbeddings + nil, // 20: ai.query.GetSimN.ModelParamsEntry + nil, // 21: ai.query.Set.ModelParamsEntry + nil, // 22: ai.query.ConvertStoreInputToEmbeddings.ModelParamsEntry + (models.AIModel)(0), // 23: ai.models.AIModel + (*nonlinear.NonLinearIndex)(nil), // 24: algorithm.nonlinear.NonLinearIndex + (*predicates.PredicateCondition)(nil), // 25: predicates.PredicateCondition + (*keyval.StoreInput)(nil), // 26: keyval.StoreInput + (algorithms.Algorithm)(0), // 27: algorithm.algorithms.Algorithm + (preprocess.PreprocessAction)(0), // 28: ai.preprocess.PreprocessAction + (execution_provider.ExecutionProvider)(0), // 29: ai.execution_provider.ExecutionProvider + (nonlinear.NonLinearAlgorithm)(0), // 30: algorithm.nonlinear.NonLinearAlgorithm + (*keyval.AiStoreEntry)(nil), // 31: keyval.AiStoreEntry } var file_ai_query_proto_depIdxs = []int32{ - 22, // 0: ai.query.CreateStore.query_model:type_name -> ai.models.AIModel - 22, // 1: ai.query.CreateStore.index_model:type_name -> ai.models.AIModel - 23, // 2: ai.query.CreateStore.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex - 24, // 3: ai.query.GetPred.condition:type_name -> predicates.PredicateCondition - 25, // 4: ai.query.GetSimN.search_input:type_name -> keyval.StoreInput - 24, // 5: ai.query.GetSimN.condition:type_name -> predicates.PredicateCondition - 26, // 6: ai.query.GetSimN.algorithm:type_name -> algorithm.algorithms.Algorithm - 27, // 7: ai.query.GetSimN.preprocess_action:type_name -> ai.preprocess.PreprocessAction - 28, // 8: ai.query.GetSimN.execution_provider:type_name -> ai.execution_provider.ExecutionProvider - 19, // 9: ai.query.GetSimN.model_params:type_name -> ai.query.GetSimN.ModelParamsEntry - 23, // 10: ai.query.CreateNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex - 29, // 11: ai.query.DropNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearAlgorithm - 25, // 12: ai.query.DelKey.keys:type_name -> keyval.StoreInput - 24, // 13: ai.query.DelPred.condition:type_name -> predicates.PredicateCondition - 25, // 14: ai.query.GetKey.keys:type_name -> keyval.StoreInput - 30, // 15: ai.query.Set.inputs:type_name -> keyval.AiStoreEntry - 27, // 16: ai.query.Set.preprocess_action:type_name -> ai.preprocess.PreprocessAction - 28, // 17: ai.query.Set.execution_provider:type_name -> ai.execution_provider.ExecutionProvider - 20, // 18: ai.query.Set.model_params:type_name -> ai.query.Set.ModelParamsEntry - 25, // 19: ai.query.ConvertStoreInputToEmbeddings.store_inputs:type_name -> keyval.StoreInput - 27, // 20: ai.query.ConvertStoreInputToEmbeddings.preprocess_action:type_name -> ai.preprocess.PreprocessAction - 22, // 21: ai.query.ConvertStoreInputToEmbeddings.model:type_name -> ai.models.AIModel - 21, // 22: ai.query.ConvertStoreInputToEmbeddings.model_params:type_name -> ai.query.ConvertStoreInputToEmbeddings.ModelParamsEntry + 23, // 0: ai.query.CreateStore.query_model:type_name -> ai.models.AIModel + 23, // 1: ai.query.CreateStore.index_model:type_name -> ai.models.AIModel + 24, // 2: ai.query.CreateStore.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex + 25, // 3: ai.query.GetPred.condition:type_name -> predicates.PredicateCondition + 26, // 4: ai.query.GetSimN.search_input:type_name -> keyval.StoreInput + 25, // 5: ai.query.GetSimN.condition:type_name -> predicates.PredicateCondition + 27, // 6: ai.query.GetSimN.algorithm:type_name -> algorithm.algorithms.Algorithm + 28, // 7: ai.query.GetSimN.preprocess_action:type_name -> ai.preprocess.PreprocessAction + 29, // 8: ai.query.GetSimN.execution_provider:type_name -> ai.execution_provider.ExecutionProvider + 20, // 9: ai.query.GetSimN.model_params:type_name -> ai.query.GetSimN.ModelParamsEntry + 24, // 10: ai.query.CreateNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex + 30, // 11: ai.query.DropNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearAlgorithm + 26, // 12: ai.query.DelKey.keys:type_name -> keyval.StoreInput + 25, // 13: ai.query.DelPred.condition:type_name -> predicates.PredicateCondition + 26, // 14: ai.query.GetKey.keys:type_name -> keyval.StoreInput + 31, // 15: ai.query.Set.inputs:type_name -> keyval.AiStoreEntry + 28, // 16: ai.query.Set.preprocess_action:type_name -> ai.preprocess.PreprocessAction + 29, // 17: ai.query.Set.execution_provider:type_name -> ai.execution_provider.ExecutionProvider + 21, // 18: ai.query.Set.model_params:type_name -> ai.query.Set.ModelParamsEntry + 26, // 19: ai.query.ConvertStoreInputToEmbeddings.store_inputs:type_name -> keyval.StoreInput + 28, // 20: ai.query.ConvertStoreInputToEmbeddings.preprocess_action:type_name -> ai.preprocess.PreprocessAction + 23, // 21: ai.query.ConvertStoreInputToEmbeddings.model:type_name -> ai.models.AIModel + 22, // 22: ai.query.ConvertStoreInputToEmbeddings.model_params:type_name -> ai.query.ConvertStoreInputToEmbeddings.ModelParamsEntry 23, // [23:23] is the sub-list for method output_type 23, // [23:23] is the sub-list for method input_type 23, // [23:23] is the sub-list for extension type_name @@ -1610,7 +1703,7 @@ func file_ai_query_proto_init() { } } file_ai_query_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*PurgeStores); i { + switch v := v.(*DropSchema); i { case 0: return &v.state case 1: @@ -1622,7 +1715,7 @@ func file_ai_query_proto_init() { } } file_ai_query_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*Ping); i { + switch v := v.(*PurgeStores); i { case 0: return &v.state case 1: @@ -1634,7 +1727,7 @@ func file_ai_query_proto_init() { } } file_ai_query_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*Set); i { + switch v := v.(*Ping); i { case 0: return &v.state case 1: @@ -1646,6 +1739,18 @@ func file_ai_query_proto_init() { } } file_ai_query_proto_msgTypes[18].Exporter = func(v any, i int) any { + switch v := v.(*Set); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ai_query_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*ConvertStoreInputToEmbeddings); i { case 0: return &v.state @@ -1658,16 +1763,20 @@ func file_ai_query_proto_init() { } } } + file_ai_query_proto_msgTypes[0].OneofWrappers = []any{} file_ai_query_proto_msgTypes[2].OneofWrappers = []any{} - file_ai_query_proto_msgTypes[17].OneofWrappers = []any{} + file_ai_query_proto_msgTypes[9].OneofWrappers = []any{} + file_ai_query_proto_msgTypes[13].OneofWrappers = []any{} + file_ai_query_proto_msgTypes[14].OneofWrappers = []any{} file_ai_query_proto_msgTypes[18].OneofWrappers = []any{} + file_ai_query_proto_msgTypes[19].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_ai_query_proto_rawDesc, NumEnums: 0, - NumMessages: 22, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, diff --git a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go index 64ea1dabf..ee7e72e70 100644 --- a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go @@ -7,12 +7,6 @@ package server import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" @@ -20,6 +14,10 @@ import ( _ "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go index 42a32c2f7..190f0ccc3 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go @@ -7,11 +7,10 @@ package algorithms import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go index 26e5b0bab..90d3139d6 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go @@ -7,13 +7,11 @@ package nonlinear import ( - reflect "reflect" - sync "sync" - + algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/client/client.pb.go b/sdk/ahnlich-client-go/grpc/client/client.pb.go index 9e9d3b259..c8473bfe1 100644 --- a/sdk/ahnlich-client-go/grpc/client/client.pb.go +++ b/sdk/ahnlich-client-go/grpc/client/client.pb.go @@ -7,11 +7,10 @@ package client import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go index 10f681e68..4bb4d5aca 100644 --- a/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go @@ -7,16 +7,13 @@ package pipeline import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" - cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -50,7 +47,7 @@ type DBQuery struct { // *DBQuery_ListClients // *DBQuery_Ping // *DBQuery_GetStore - // *DBQuery_ClusterInfo + // *DBQuery_DropSchema Query isDBQuery_Query `protobuf_oneof:"query"` } @@ -212,9 +209,9 @@ func (x *DBQuery) GetGetStore() *query.GetStore { return nil } -func (x *DBQuery) GetClusterInfo() *cluster.ClusterInfoQuery { - if x, ok := x.GetQuery().(*DBQuery_ClusterInfo); ok { - return x.ClusterInfo +func (x *DBQuery) GetDropSchema() *query.DropSchema { + if x, ok := x.GetQuery().(*DBQuery_DropSchema); ok { + return x.DropSchema } return nil } @@ -291,8 +288,8 @@ type DBQuery_GetStore struct { GetStore *query.GetStore `protobuf:"bytes,17,opt,name=get_store,json=getStore,proto3,oneof"` } -type DBQuery_ClusterInfo struct { - ClusterInfo *cluster.ClusterInfoQuery `protobuf:"bytes,18,opt,name=cluster_info,json=clusterInfo,proto3,oneof"` +type DBQuery_DropSchema struct { + DropSchema *query.DropSchema `protobuf:"bytes,18,opt,name=drop_schema,json=dropSchema,proto3,oneof"` } func (*DBQuery_CreateStore) isDBQuery_Query() {} @@ -329,7 +326,7 @@ func (*DBQuery_Ping) isDBQuery_Query() {} func (*DBQuery_GetStore) isDBQuery_Query() {} -func (*DBQuery_ClusterInfo) isDBQuery_Query() {} +func (*DBQuery_DropSchema) isDBQuery_Query() {} type DBRequestPipeline struct { state protoimpl.MessageState @@ -397,7 +394,6 @@ type DBServerResponse struct { // *DBServerResponse_CreateIndex // *DBServerResponse_Error // *DBServerResponse_StoreInfo - // *DBServerResponse_ClusterInfo Response isDBServerResponse_Response `protobuf_oneof:"response"` } @@ -524,13 +520,6 @@ func (x *DBServerResponse) GetStoreInfo() *server.StoreInfo { return nil } -func (x *DBServerResponse) GetClusterInfo() *cluster.ClusterInfoResponse { - if x, ok := x.GetResponse().(*DBServerResponse_ClusterInfo); ok { - return x.ClusterInfo - } - return nil -} - type isDBServerResponse_Response interface { isDBServerResponse_Response() } @@ -583,10 +572,6 @@ type DBServerResponse_StoreInfo struct { StoreInfo *server.StoreInfo `protobuf:"bytes,12,opt,name=store_info,json=storeInfo,proto3,oneof"` } -type DBServerResponse_ClusterInfo struct { - ClusterInfo *cluster.ClusterInfoResponse `protobuf:"bytes,13,opt,name=cluster_info,json=clusterInfo,proto3,oneof"` -} - func (*DBServerResponse_Unit) isDBServerResponse_Response() {} func (*DBServerResponse_Pong) isDBServerResponse_Response() {} @@ -611,8 +596,6 @@ func (*DBServerResponse_Error) isDBServerResponse_Response() {} func (*DBServerResponse_StoreInfo) isDBServerResponse_Response() {} -func (*DBServerResponse_ClusterInfo) isDBServerResponse_Response() {} - type DBResponsePipeline struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -667,136 +650,129 @@ var file_db_pipeline_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x0e, 0x64, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x64, 0x62, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x14, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, - 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x08, 0x0a, 0x07, 0x44, - 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x67, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, - 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x06, 0x67, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, - 0x2e, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x72, 0x65, 0x64, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, - 0x2f, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, - 0x12, 0x47, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x62, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, - 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x73, 0x0a, 0x21, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, - 0x1d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, - 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x41, - 0x0a, 0x0f, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x48, 0x00, 0x52, 0x0d, 0x64, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x6d, 0x0a, 0x1f, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, - 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x62, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, - 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x48, 0x00, 0x52, 0x1b, 0x64, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, - 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x21, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, - 0x73, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x4b, 0x65, 0x79, - 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, - 0x6c, 0x50, 0x72, 0x65, 0x64, 0x48, 0x00, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, - 0x12, 0x34, 0x0a, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x09, 0x64, 0x72, 0x6f, - 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, - 0x37, 0x0a, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x69, - 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x69, 0x73, 0x74, - 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, - 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x09, 0x67, 0x65, - 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x48, 0x00, 0x52, 0x08, 0x67, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x45, 0x0a, - 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x12, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x43, 0x0a, - 0x11, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, - 0x6e, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x2e, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x22, 0xa7, 0x05, 0x0a, 0x10, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x25, - 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, - 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, - 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x35, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x22, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, - 0x03, 0x73, 0x65, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, - 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x62, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, - 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x22, 0x0a, 0x03, 0x64, 0x65, - 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x3b, - 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0b, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x64, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x35, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x48, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x12, - 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, - 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, - 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, - 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, - 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, - 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x62, 0x2f, 0x70, 0x69, 0x70, 0x65, - 0x6c, 0x69, 0x6e, 0x65, 0x3b, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x1a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x08, 0x0a, 0x07, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x3a, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x07, + 0x67, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, + 0x00, 0x52, 0x06, 0x67, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x08, 0x67, 0x65, 0x74, + 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x48, 0x00, + 0x52, 0x07, 0x67, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x09, 0x67, 0x65, 0x74, + 0x5f, 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, + 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x47, 0x0a, 0x11, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x48, 0x00, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x73, 0x0a, 0x21, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x6f, + 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x1d, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x41, 0x0a, 0x0f, 0x64, 0x72, 0x6f, 0x70, + 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, + 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x72, + 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6d, 0x0a, 0x1f, 0x64, + 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x1b, 0x64, + 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, + 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x03, 0x73, 0x65, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, 0x12, 0x2b, 0x0a, + 0x07, 0x64, 0x65, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, + 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, + 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x48, + 0x00, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x0a, 0x64, 0x72, + 0x6f, 0x70, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x09, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x12, 0x37, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, + 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0b, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x48, + 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x24, + 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, + 0x70, 0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x08, 0x67, + 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x42, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2e, + 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xdd, + 0x04, 0x0a, 0x10, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, + 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x70, 0x6f, + 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, + 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x03, + 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, + 0x12, 0x22, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x00, 0x52, + 0x03, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x5f, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, 0x67, + 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x22, 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x0a, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, + 0x0a, 0x12, 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, + 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, + 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x62, 0x2f, 0x70, 0x69, + 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x3b, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -834,7 +810,7 @@ var file_db_pipeline_proto_goTypes = []any{ (*query.ListClients)(nil), // 18: db.query.ListClients (*query.Ping)(nil), // 19: db.query.Ping (*query.GetStore)(nil), // 20: db.query.GetStore - (*cluster.ClusterInfoQuery)(nil), // 21: shared.cluster.ClusterInfoQuery + (*query.DropSchema)(nil), // 21: db.query.DropSchema (*server.Unit)(nil), // 22: db.server.Unit (*server.Pong)(nil), // 23: db.server.Pong (*server.ClientList)(nil), // 24: db.server.ClientList @@ -847,7 +823,6 @@ var file_db_pipeline_proto_goTypes = []any{ (*server.CreateIndex)(nil), // 31: db.server.CreateIndex (*info.ErrorResponse)(nil), // 32: shared.info.ErrorResponse (*server.StoreInfo)(nil), // 33: db.server.StoreInfo - (*cluster.ClusterInfoResponse)(nil), // 34: shared.cluster.ClusterInfoResponse } var file_db_pipeline_proto_depIdxs = []int32{ 4, // 0: db.pipeline.DBQuery.create_store:type_name -> db.query.CreateStore @@ -867,7 +842,7 @@ var file_db_pipeline_proto_depIdxs = []int32{ 18, // 14: db.pipeline.DBQuery.list_clients:type_name -> db.query.ListClients 19, // 15: db.pipeline.DBQuery.ping:type_name -> db.query.Ping 20, // 16: db.pipeline.DBQuery.get_store:type_name -> db.query.GetStore - 21, // 17: db.pipeline.DBQuery.cluster_info:type_name -> shared.cluster.ClusterInfoQuery + 21, // 17: db.pipeline.DBQuery.drop_schema:type_name -> db.query.DropSchema 0, // 18: db.pipeline.DBRequestPipeline.queries:type_name -> db.pipeline.DBQuery 22, // 19: db.pipeline.DBServerResponse.unit:type_name -> db.server.Unit 23, // 20: db.pipeline.DBServerResponse.pong:type_name -> db.server.Pong @@ -881,13 +856,12 @@ var file_db_pipeline_proto_depIdxs = []int32{ 31, // 28: db.pipeline.DBServerResponse.create_index:type_name -> db.server.CreateIndex 32, // 29: db.pipeline.DBServerResponse.error:type_name -> shared.info.ErrorResponse 33, // 30: db.pipeline.DBServerResponse.store_info:type_name -> db.server.StoreInfo - 34, // 31: db.pipeline.DBServerResponse.cluster_info:type_name -> shared.cluster.ClusterInfoResponse - 2, // 32: db.pipeline.DBResponsePipeline.responses:type_name -> db.pipeline.DBServerResponse - 33, // [33:33] is the sub-list for method output_type - 33, // [33:33] is the sub-list for method input_type - 33, // [33:33] is the sub-list for extension type_name - 33, // [33:33] is the sub-list for extension extendee - 0, // [0:33] is the sub-list for field type_name + 2, // 31: db.pipeline.DBResponsePipeline.responses:type_name -> db.pipeline.DBServerResponse + 32, // [32:32] is the sub-list for method output_type + 32, // [32:32] is the sub-list for method input_type + 32, // [32:32] is the sub-list for extension type_name + 32, // [32:32] is the sub-list for extension extendee + 0, // [0:32] is the sub-list for field type_name } func init() { file_db_pipeline_proto_init() } @@ -963,7 +937,7 @@ func file_db_pipeline_proto_init() { (*DBQuery_ListClients)(nil), (*DBQuery_Ping)(nil), (*DBQuery_GetStore)(nil), - (*DBQuery_ClusterInfo)(nil), + (*DBQuery_DropSchema)(nil), } file_db_pipeline_proto_msgTypes[2].OneofWrappers = []any{ (*DBServerResponse_Unit)(nil), @@ -978,7 +952,6 @@ func file_db_pipeline_proto_init() { (*DBServerResponse_CreateIndex)(nil), (*DBServerResponse_Error)(nil), (*DBServerResponse_StoreInfo)(nil), - (*DBServerResponse_ClusterInfo)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go index 797850019..616666020 100644 --- a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go @@ -7,16 +7,14 @@ package query import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -38,6 +36,7 @@ type CreateStore struct { CreatePredicates []string `protobuf:"bytes,3,rep,name=create_predicates,json=createPredicates,proto3" json:"create_predicates,omitempty"` // Predicates used for querying. NonLinearIndices []*nonlinear.NonLinearIndex `protobuf:"bytes,4,rep,name=non_linear_indices,json=nonLinearIndices,proto3" json:"non_linear_indices,omitempty"` // Non-linear algorithms for indexing. ErrorIfExists bool `protobuf:"varint,5,opt,name=error_if_exists,json=errorIfExists,proto3" json:"error_if_exists,omitempty"` // Flag indicating whether to error if store already exists. + Schema *string `protobuf:"bytes,6,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace for the store. Defaults to "public". } func (x *CreateStore) Reset() { @@ -107,6 +106,13 @@ func (x *CreateStore) GetErrorIfExists() bool { return false } +func (x *CreateStore) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + // Retrieves values from the store based on provided keys. type GetKey struct { state protoimpl.MessageState @@ -666,8 +672,9 @@ type DropStore struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // The name of the store. - ErrorIfNotExists bool `protobuf:"varint,2,opt,name=error_if_not_exists,json=errorIfNotExists,proto3" json:"error_if_not_exists,omitempty"` // Flag indicating whether to error if store does not exist. + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // The name of the store. + ErrorIfNotExists bool `protobuf:"varint,2,opt,name=error_if_not_exists,json=errorIfNotExists,proto3" json:"error_if_not_exists,omitempty"` // Flag indicating whether to error if store does not exist. + Schema *string `protobuf:"bytes,3,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace for the store. Defaults to "public". } func (x *DropStore) Reset() { @@ -716,6 +723,13 @@ func (x *DropStore) GetErrorIfNotExists() bool { return false } +func (x *DropStore) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + // A request to get server information such as host, port, and version. type InfoServer struct { state protoimpl.MessageState @@ -760,6 +774,8 @@ type ListStores struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Schema *string `protobuf:"bytes,1,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace to filter stores. If unset, lists all schemas. } func (x *ListStores) Reset() { @@ -794,6 +810,13 @@ func (*ListStores) Descriptor() ([]byte, []int) { return file_db_query_proto_rawDescGZIP(), []int{12} } +func (x *ListStores) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + // A request to list all the clients currently connected to the server. type ListClients struct { state protoimpl.MessageState @@ -878,7 +901,8 @@ type GetStore struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // The name of the store. + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` // The name of the store. + Schema *string `protobuf:"bytes,2,opt,name=schema,proto3,oneof" json:"schema,omitempty"` // Optional schema/namespace for the store. Defaults to "public". } func (x *GetStore) Reset() { @@ -920,6 +944,62 @@ func (x *GetStore) GetStore() string { return "" } +func (x *GetStore) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + +// Drops an entire schema and all stores within it. +// Cannot drop the "public" default schema. +type DropSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` // The name of the schema to drop. +} + +func (x *DropSchema) Reset() { + *x = DropSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_db_query_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DropSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DropSchema) ProtoMessage() {} + +func (x *DropSchema) ProtoReflect() protoreflect.Message { + mi := &file_db_query_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DropSchema.ProtoReflect.Descriptor instead. +func (*DropSchema) Descriptor() ([]byte, []int) { + return file_db_query_proto_rawDescGZIP(), []int{16} +} + +func (x *DropSchema) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + // A request to set multiple key-value entries in the store. // Validation is done for each vector before updating the store. type Set struct { @@ -934,7 +1014,7 @@ type Set struct { func (x *Set) Reset() { *x = Set{} if protoimpl.UnsafeEnabled { - mi := &file_db_query_proto_msgTypes[16] + mi := &file_db_query_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -947,7 +1027,7 @@ func (x *Set) String() string { func (*Set) ProtoMessage() {} func (x *Set) ProtoReflect() protoreflect.Message { - mi := &file_db_query_proto_msgTypes[16] + mi := &file_db_query_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -960,7 +1040,7 @@ func (x *Set) ProtoReflect() protoreflect.Message { // Deprecated: Use Set.ProtoReflect.Descriptor instead. func (*Set) Descriptor() ([]byte, []int) { - return file_db_query_proto_rawDescGZIP(), []int{16} + return file_db_query_proto_rawDescGZIP(), []int{17} } func (x *Set) GetStore() string { @@ -987,7 +1067,7 @@ var file_db_query_proto_rawDesc = []byte{ 0x2f, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xe9, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, + 0x91, 0x02, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, @@ -1001,95 +1081,108 @@ var file_db_query_proto_rawDesc = []byte{ 0x78, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x49, 0x66, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x44, 0x0a, 0x06, 0x47, - 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, - 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x22, 0x5d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0xee, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x14, 0x0a, 0x05, + 0x72, 0x6f, 0x72, 0x49, 0x66, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x22, 0x44, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x4b, 0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5d, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xee, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x33, 0x0a, 0x0c, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, + 0x65, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x4e, 0x12, 0x3d, 0x0a, 0x09, + 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x61, 0x6c, 0x67, 0x6f, + 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x2e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x3c, 0x0a, 0x09, 0x63, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x47, 0x0a, 0x0f, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x12, 0x33, 0x0a, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x70, - 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, - 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, - 0x73, 0x74, 0x5f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x73, - 0x65, 0x73, 0x74, 0x4e, 0x12, 0x3d, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x2e, 0x41, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x47, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, + 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, + 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, - 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x1d, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, - 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x12, 0x51, 0x0a, 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, - 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, - 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x74, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, - 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x13, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x1b, - 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x12, 0x55, 0x0a, 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x27, 0x2e, - 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, - 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, - 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, - 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x44, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x4b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5d, 0x0a, - 0x07, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3c, - 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, - 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x09, - 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x51, 0x0a, 0x12, 0x6e, 0x6f, + 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, + 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x6e, 0x6f, 0x6e, + 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x74, 0x0a, + 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, + 0x73, 0x74, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x1b, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, + 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x6e, 0x6f, 0x6e, + 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x2e, 0x6e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x4c, + 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x10, + 0x6e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, + 0x44, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, - 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x0c, - 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x0c, 0x0a, 0x0a, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x06, 0x0a, 0x04, 0x50, 0x69, 0x6e, - 0x67, 0x22, 0x20, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x22, 0x49, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x12, 0x2c, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x44, 0x62, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x42, 0x46, - 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, - 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, - 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, - 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x3b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x52, + 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5d, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x65, 0x64, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x09, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x4e, 0x6f, 0x74, + 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x0c, + 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x34, 0x0a, 0x0a, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x06, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x48, 0x0a, 0x08, 0x47, 0x65, 0x74, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x22, 0x24, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x49, 0x0a, 0x03, 0x53, 0x65, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, + 0x44, 0x62, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, + 0x70, 0x75, 0x74, 0x73, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, + 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x62, + 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x3b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1104,7 +1197,7 @@ func file_db_query_proto_rawDescGZIP() []byte { return file_db_query_proto_rawDescData } -var file_db_query_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_db_query_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_db_query_proto_goTypes = []any{ (*CreateStore)(nil), // 0: db.query.CreateStore (*GetKey)(nil), // 1: db.query.GetKey @@ -1122,26 +1215,27 @@ var file_db_query_proto_goTypes = []any{ (*ListClients)(nil), // 13: db.query.ListClients (*Ping)(nil), // 14: db.query.Ping (*GetStore)(nil), // 15: db.query.GetStore - (*Set)(nil), // 16: db.query.Set - (*nonlinear.NonLinearIndex)(nil), // 17: algorithm.nonlinear.NonLinearIndex - (*keyval.StoreKey)(nil), // 18: keyval.StoreKey - (*predicates.PredicateCondition)(nil), // 19: predicates.PredicateCondition - (algorithms.Algorithm)(0), // 20: algorithm.algorithms.Algorithm - (nonlinear.NonLinearAlgorithm)(0), // 21: algorithm.nonlinear.NonLinearAlgorithm - (*keyval.DbStoreEntry)(nil), // 22: keyval.DbStoreEntry + (*DropSchema)(nil), // 16: db.query.DropSchema + (*Set)(nil), // 17: db.query.Set + (*nonlinear.NonLinearIndex)(nil), // 18: algorithm.nonlinear.NonLinearIndex + (*keyval.StoreKey)(nil), // 19: keyval.StoreKey + (*predicates.PredicateCondition)(nil), // 20: predicates.PredicateCondition + (algorithms.Algorithm)(0), // 21: algorithm.algorithms.Algorithm + (nonlinear.NonLinearAlgorithm)(0), // 22: algorithm.nonlinear.NonLinearAlgorithm + (*keyval.DbStoreEntry)(nil), // 23: keyval.DbStoreEntry } var file_db_query_proto_depIdxs = []int32{ - 17, // 0: db.query.CreateStore.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex - 18, // 1: db.query.GetKey.keys:type_name -> keyval.StoreKey - 19, // 2: db.query.GetPred.condition:type_name -> predicates.PredicateCondition - 18, // 3: db.query.GetSimN.search_input:type_name -> keyval.StoreKey - 20, // 4: db.query.GetSimN.algorithm:type_name -> algorithm.algorithms.Algorithm - 19, // 5: db.query.GetSimN.condition:type_name -> predicates.PredicateCondition - 17, // 6: db.query.CreateNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex - 21, // 7: db.query.DropNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearAlgorithm - 18, // 8: db.query.DelKey.keys:type_name -> keyval.StoreKey - 19, // 9: db.query.DelPred.condition:type_name -> predicates.PredicateCondition - 22, // 10: db.query.Set.inputs:type_name -> keyval.DbStoreEntry + 18, // 0: db.query.CreateStore.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex + 19, // 1: db.query.GetKey.keys:type_name -> keyval.StoreKey + 20, // 2: db.query.GetPred.condition:type_name -> predicates.PredicateCondition + 19, // 3: db.query.GetSimN.search_input:type_name -> keyval.StoreKey + 21, // 4: db.query.GetSimN.algorithm:type_name -> algorithm.algorithms.Algorithm + 20, // 5: db.query.GetSimN.condition:type_name -> predicates.PredicateCondition + 18, // 6: db.query.CreateNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearIndex + 22, // 7: db.query.DropNonLinearAlgorithmIndex.non_linear_indices:type_name -> algorithm.nonlinear.NonLinearAlgorithm + 19, // 8: db.query.DelKey.keys:type_name -> keyval.StoreKey + 20, // 9: db.query.DelPred.condition:type_name -> predicates.PredicateCondition + 23, // 10: db.query.Set.inputs:type_name -> keyval.DbStoreEntry 11, // [11:11] is the sub-list for method output_type 11, // [11:11] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name @@ -1348,6 +1442,18 @@ func file_db_query_proto_init() { } } file_db_query_proto_msgTypes[16].Exporter = func(v any, i int) any { + switch v := v.(*DropSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_db_query_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*Set); i { case 0: return &v.state @@ -1360,13 +1466,17 @@ func file_db_query_proto_init() { } } } + file_db_query_proto_msgTypes[0].OneofWrappers = []any{} + file_db_query_proto_msgTypes[10].OneofWrappers = []any{} + file_db_query_proto_msgTypes[12].OneofWrappers = []any{} + file_db_query_proto_msgTypes[15].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_db_query_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go index 49d0ce65a..85fdb727a 100644 --- a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go @@ -7,17 +7,15 @@ package server import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go index 5469e84ea..791f70701 100644 --- a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go +++ b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go @@ -7,13 +7,11 @@ package keyval import ( - reflect "reflect" - sync "sync" - + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go index c33154adb..e94e96adf 100644 --- a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go +++ b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go @@ -7,11 +7,10 @@ package metadata import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go index a3b1f7276..7accab29c 100644 --- a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go +++ b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go @@ -7,13 +7,11 @@ package predicates import ( - reflect "reflect" - sync "sync" - + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go index fac3e2773..6acf33906 100644 --- a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go +++ b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go @@ -7,11 +7,10 @@ package server_types import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go index 7adb42165..1d5ccbfb8 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go @@ -7,14 +7,12 @@ package ai_service import ( - reflect "reflect" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" ) const ( @@ -33,7 +31,7 @@ var file_services_ai_service_proto_rawDesc = []byte{ 0x1a, 0x11, 0x61, 0x69, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x61, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x61, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xbf, 0x09, 0x0a, 0x09, 0x41, 0x49, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xf3, 0x09, 0x0a, 0x09, 0x41, 0x49, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0f, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, @@ -80,42 +78,45 @@ var file_services_ai_service_proto_rawDesc = []byte{ 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x09, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x13, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x15, 0x2e, - 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x39, - 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x61, - 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, - 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x0b, 0x50, 0x75, 0x72, - 0x67, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x50, 0x75, 0x72, 0x67, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, - 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, - 0x27, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x1a, 0x0f, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x6f, 0x0a, 0x1d, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, - 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x2e, 0x61, 0x69, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, - 0x67, 0x73, 0x1a, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, - 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x08, 0x50, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, - 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x1f, 0x2e, 0x61, 0x69, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, - 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, - 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, - 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x3b, 0x61, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x1a, 0x0e, 0x2e, 0x61, 0x69, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x69, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x1a, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x14, 0x2e, 0x61, + 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x14, 0x2e, 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x34, 0x0a, + 0x0b, 0x50, 0x75, 0x72, 0x67, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x61, + 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x75, 0x72, 0x67, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x73, 0x1a, 0x0e, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x2e, 0x61, 0x69, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x1a, 0x0f, 0x2e, 0x61, 0x69, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x6f, 0x0a, 0x1d, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x2e, + 0x61, 0x69, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, + 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, + 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4b, 0x0a, + 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x69, 0x2e, 0x70, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x1f, 0x2e, 0x61, 0x69, 0x2e, 0x70, + 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x41, 0x49, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, + 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, + 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x69, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x61, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_services_ai_service_proto_goTypes = []any{ @@ -132,26 +133,27 @@ var file_services_ai_service_proto_goTypes = []any{ (*query.DelKey)(nil), // 10: ai.query.DelKey (*query.DelPred)(nil), // 11: ai.query.DelPred (*query.DropStore)(nil), // 12: ai.query.DropStore - (*query.ListClients)(nil), // 13: ai.query.ListClients - (*query.ListStores)(nil), // 14: ai.query.ListStores - (*query.InfoServer)(nil), // 15: ai.query.InfoServer - (*query.PurgeStores)(nil), // 16: ai.query.PurgeStores - (*query.Ping)(nil), // 17: ai.query.Ping - (*query.ConvertStoreInputToEmbeddings)(nil), // 18: ai.query.ConvertStoreInputToEmbeddings - (*pipeline.AIRequestPipeline)(nil), // 19: ai.pipeline.AIRequestPipeline - (*server.Unit)(nil), // 20: ai.server.Unit - (*server.CreateIndex)(nil), // 21: ai.server.CreateIndex - (*server.Get)(nil), // 22: ai.server.Get - (*server.GetSimN)(nil), // 23: ai.server.GetSimN - (*server.AIStoreInfo)(nil), // 24: ai.server.AIStoreInfo - (*server.Set)(nil), // 25: ai.server.Set - (*server.Del)(nil), // 26: ai.server.Del - (*server.ClientList)(nil), // 27: ai.server.ClientList - (*server.StoreList)(nil), // 28: ai.server.StoreList - (*server.InfoServer)(nil), // 29: ai.server.InfoServer - (*server.Pong)(nil), // 30: ai.server.Pong - (*server.StoreInputToEmbeddingsList)(nil), // 31: ai.server.StoreInputToEmbeddingsList - (*pipeline.AIResponsePipeline)(nil), // 32: ai.pipeline.AIResponsePipeline + (*query.DropSchema)(nil), // 13: ai.query.DropSchema + (*query.ListClients)(nil), // 14: ai.query.ListClients + (*query.ListStores)(nil), // 15: ai.query.ListStores + (*query.InfoServer)(nil), // 16: ai.query.InfoServer + (*query.PurgeStores)(nil), // 17: ai.query.PurgeStores + (*query.Ping)(nil), // 18: ai.query.Ping + (*query.ConvertStoreInputToEmbeddings)(nil), // 19: ai.query.ConvertStoreInputToEmbeddings + (*pipeline.AIRequestPipeline)(nil), // 20: ai.pipeline.AIRequestPipeline + (*server.Unit)(nil), // 21: ai.server.Unit + (*server.CreateIndex)(nil), // 22: ai.server.CreateIndex + (*server.Get)(nil), // 23: ai.server.Get + (*server.GetSimN)(nil), // 24: ai.server.GetSimN + (*server.AIStoreInfo)(nil), // 25: ai.server.AIStoreInfo + (*server.Set)(nil), // 26: ai.server.Set + (*server.Del)(nil), // 27: ai.server.Del + (*server.ClientList)(nil), // 28: ai.server.ClientList + (*server.StoreList)(nil), // 29: ai.server.StoreList + (*server.InfoServer)(nil), // 30: ai.server.InfoServer + (*server.Pong)(nil), // 31: ai.server.Pong + (*server.StoreInputToEmbeddingsList)(nil), // 32: ai.server.StoreInputToEmbeddingsList + (*pipeline.AIResponsePipeline)(nil), // 33: ai.pipeline.AIResponsePipeline } var file_services_ai_service_proto_depIdxs = []int32{ 0, // 0: services.ai_service.AIService.CreateStore:input_type -> ai.query.CreateStore @@ -167,35 +169,37 @@ var file_services_ai_service_proto_depIdxs = []int32{ 10, // 10: services.ai_service.AIService.DelKey:input_type -> ai.query.DelKey 11, // 11: services.ai_service.AIService.DelPred:input_type -> ai.query.DelPred 12, // 12: services.ai_service.AIService.DropStore:input_type -> ai.query.DropStore - 13, // 13: services.ai_service.AIService.ListClients:input_type -> ai.query.ListClients - 14, // 14: services.ai_service.AIService.ListStores:input_type -> ai.query.ListStores - 15, // 15: services.ai_service.AIService.InfoServer:input_type -> ai.query.InfoServer - 16, // 16: services.ai_service.AIService.PurgeStores:input_type -> ai.query.PurgeStores - 17, // 17: services.ai_service.AIService.Ping:input_type -> ai.query.Ping - 18, // 18: services.ai_service.AIService.ConvertStoreInputToEmbeddings:input_type -> ai.query.ConvertStoreInputToEmbeddings - 19, // 19: services.ai_service.AIService.Pipeline:input_type -> ai.pipeline.AIRequestPipeline - 20, // 20: services.ai_service.AIService.CreateStore:output_type -> ai.server.Unit - 21, // 21: services.ai_service.AIService.CreatePredIndex:output_type -> ai.server.CreateIndex - 21, // 22: services.ai_service.AIService.CreateNonLinearAlgorithmIndex:output_type -> ai.server.CreateIndex - 22, // 23: services.ai_service.AIService.GetKey:output_type -> ai.server.Get - 22, // 24: services.ai_service.AIService.GetPred:output_type -> ai.server.Get - 23, // 25: services.ai_service.AIService.GetSimN:output_type -> ai.server.GetSimN - 24, // 26: services.ai_service.AIService.GetStore:output_type -> ai.server.AIStoreInfo - 25, // 27: services.ai_service.AIService.Set:output_type -> ai.server.Set - 26, // 28: services.ai_service.AIService.DropPredIndex:output_type -> ai.server.Del - 26, // 29: services.ai_service.AIService.DropNonLinearAlgorithmIndex:output_type -> ai.server.Del - 26, // 30: services.ai_service.AIService.DelKey:output_type -> ai.server.Del - 26, // 31: services.ai_service.AIService.DelPred:output_type -> ai.server.Del - 26, // 32: services.ai_service.AIService.DropStore:output_type -> ai.server.Del - 27, // 33: services.ai_service.AIService.ListClients:output_type -> ai.server.ClientList - 28, // 34: services.ai_service.AIService.ListStores:output_type -> ai.server.StoreList - 29, // 35: services.ai_service.AIService.InfoServer:output_type -> ai.server.InfoServer - 26, // 36: services.ai_service.AIService.PurgeStores:output_type -> ai.server.Del - 30, // 37: services.ai_service.AIService.Ping:output_type -> ai.server.Pong - 31, // 38: services.ai_service.AIService.ConvertStoreInputToEmbeddings:output_type -> ai.server.StoreInputToEmbeddingsList - 32, // 39: services.ai_service.AIService.Pipeline:output_type -> ai.pipeline.AIResponsePipeline - 20, // [20:40] is the sub-list for method output_type - 0, // [0:20] is the sub-list for method input_type + 13, // 13: services.ai_service.AIService.DropSchema:input_type -> ai.query.DropSchema + 14, // 14: services.ai_service.AIService.ListClients:input_type -> ai.query.ListClients + 15, // 15: services.ai_service.AIService.ListStores:input_type -> ai.query.ListStores + 16, // 16: services.ai_service.AIService.InfoServer:input_type -> ai.query.InfoServer + 17, // 17: services.ai_service.AIService.PurgeStores:input_type -> ai.query.PurgeStores + 18, // 18: services.ai_service.AIService.Ping:input_type -> ai.query.Ping + 19, // 19: services.ai_service.AIService.ConvertStoreInputToEmbeddings:input_type -> ai.query.ConvertStoreInputToEmbeddings + 20, // 20: services.ai_service.AIService.Pipeline:input_type -> ai.pipeline.AIRequestPipeline + 21, // 21: services.ai_service.AIService.CreateStore:output_type -> ai.server.Unit + 22, // 22: services.ai_service.AIService.CreatePredIndex:output_type -> ai.server.CreateIndex + 22, // 23: services.ai_service.AIService.CreateNonLinearAlgorithmIndex:output_type -> ai.server.CreateIndex + 23, // 24: services.ai_service.AIService.GetKey:output_type -> ai.server.Get + 23, // 25: services.ai_service.AIService.GetPred:output_type -> ai.server.Get + 24, // 26: services.ai_service.AIService.GetSimN:output_type -> ai.server.GetSimN + 25, // 27: services.ai_service.AIService.GetStore:output_type -> ai.server.AIStoreInfo + 26, // 28: services.ai_service.AIService.Set:output_type -> ai.server.Set + 27, // 29: services.ai_service.AIService.DropPredIndex:output_type -> ai.server.Del + 27, // 30: services.ai_service.AIService.DropNonLinearAlgorithmIndex:output_type -> ai.server.Del + 27, // 31: services.ai_service.AIService.DelKey:output_type -> ai.server.Del + 27, // 32: services.ai_service.AIService.DelPred:output_type -> ai.server.Del + 27, // 33: services.ai_service.AIService.DropStore:output_type -> ai.server.Del + 27, // 34: services.ai_service.AIService.DropSchema:output_type -> ai.server.Del + 28, // 35: services.ai_service.AIService.ListClients:output_type -> ai.server.ClientList + 29, // 36: services.ai_service.AIService.ListStores:output_type -> ai.server.StoreList + 30, // 37: services.ai_service.AIService.InfoServer:output_type -> ai.server.InfoServer + 27, // 38: services.ai_service.AIService.PurgeStores:output_type -> ai.server.Del + 31, // 39: services.ai_service.AIService.Ping:output_type -> ai.server.Pong + 32, // 40: services.ai_service.AIService.ConvertStoreInputToEmbeddings:output_type -> ai.server.StoreInputToEmbeddingsList + 33, // 41: services.ai_service.AIService.Pipeline:output_type -> ai.pipeline.AIResponsePipeline + 21, // [21:42] is the sub-list for method output_type + 0, // [0:21] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go index 97ed8d7c6..9f9e0332c 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go @@ -8,14 +8,12 @@ package ai_service import ( context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file @@ -37,6 +35,7 @@ const ( AIService_DelKey_FullMethodName = "/services.ai_service.AIService/DelKey" AIService_DelPred_FullMethodName = "/services.ai_service.AIService/DelPred" AIService_DropStore_FullMethodName = "/services.ai_service.AIService/DropStore" + AIService_DropSchema_FullMethodName = "/services.ai_service.AIService/DropSchema" AIService_ListClients_FullMethodName = "/services.ai_service.AIService/ListClients" AIService_ListStores_FullMethodName = "/services.ai_service.AIService/ListStores" AIService_InfoServer_FullMethodName = "/services.ai_service.AIService/InfoServer" @@ -67,6 +66,7 @@ type AIServiceClient interface { DelKey(ctx context.Context, in *query.DelKey, opts ...grpc.CallOption) (*server.Del, error) DelPred(ctx context.Context, in *query.DelPred, opts ...grpc.CallOption) (*server.Del, error) DropStore(ctx context.Context, in *query.DropStore, opts ...grpc.CallOption) (*server.Del, error) + DropSchema(ctx context.Context, in *query.DropSchema, opts ...grpc.CallOption) (*server.Del, error) // * Ancillary info methods * ListClients(ctx context.Context, in *query.ListClients, opts ...grpc.CallOption) (*server.ClientList, error) ListStores(ctx context.Context, in *query.ListStores, opts ...grpc.CallOption) (*server.StoreList, error) @@ -216,6 +216,16 @@ func (c *aIServiceClient) DropStore(ctx context.Context, in *query.DropStore, op return out, nil } +func (c *aIServiceClient) DropSchema(ctx context.Context, in *query.DropSchema, opts ...grpc.CallOption) (*server.Del, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(server.Del) + err := c.cc.Invoke(ctx, AIService_DropSchema_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *aIServiceClient) ListClients(ctx context.Context, in *query.ListClients, opts ...grpc.CallOption) (*server.ClientList, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(server.ClientList) @@ -307,6 +317,7 @@ type AIServiceServer interface { DelKey(context.Context, *query.DelKey) (*server.Del, error) DelPred(context.Context, *query.DelPred) (*server.Del, error) DropStore(context.Context, *query.DropStore) (*server.Del, error) + DropSchema(context.Context, *query.DropSchema) (*server.Del, error) // * Ancillary info methods * ListClients(context.Context, *query.ListClients) (*server.ClientList, error) ListStores(context.Context, *query.ListStores) (*server.StoreList, error) @@ -365,6 +376,9 @@ func (UnimplementedAIServiceServer) DelPred(context.Context, *query.DelPred) (*s func (UnimplementedAIServiceServer) DropStore(context.Context, *query.DropStore) (*server.Del, error) { return nil, status.Errorf(codes.Unimplemented, "method DropStore not implemented") } +func (UnimplementedAIServiceServer) DropSchema(context.Context, *query.DropSchema) (*server.Del, error) { + return nil, status.Errorf(codes.Unimplemented, "method DropSchema not implemented") +} func (UnimplementedAIServiceServer) ListClients(context.Context, *query.ListClients) (*server.ClientList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListClients not implemented") } @@ -641,6 +655,24 @@ func _AIService_DropStore_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _AIService_DropSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(query.DropSchema) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AIServiceServer).DropSchema(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AIService_DropSchema_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AIServiceServer).DropSchema(ctx, req.(*query.DropSchema)) + } + return interceptor(ctx, in, info, handler) +} + func _AIService_ListClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(query.ListClients) if err := dec(in); err != nil { @@ -826,6 +858,10 @@ var AIService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DropStore", Handler: _AIService_DropStore_Handler, }, + { + MethodName: "DropSchema", + Handler: _AIService_DropSchema_Handler, + }, { MethodName: "ListClients", Handler: _AIService_ListClients_Handler, diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go index 1248b6836..fdde54c26 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go @@ -7,15 +7,12 @@ package db_service import ( - reflect "reflect" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" - cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" ) const ( @@ -34,85 +31,82 @@ var file_services_db_service_proto_rawDesc = []byte{ 0x1a, 0x11, 0x64, 0x62, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x64, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x64, 0x62, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xec, 0x08, 0x0a, 0x09, 0x44, - 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0f, - 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x12, - 0x44, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x19, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x16, 0x2e, - 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x60, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, - 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, - 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, - 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, - 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x11, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, - 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x11, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x1a, - 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x69, 0x6d, 0x4e, 0x12, 0x34, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, - 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x1a, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x03, 0x53, 0x65, 0x74, - 0x12, 0x0d, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x1a, - 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x12, - 0x38, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x17, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, - 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x54, 0x0a, 0x1b, 0x44, 0x72, 0x6f, - 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x25, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, - 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, - 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, - 0x2a, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, 0x64, 0x62, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x2c, 0x0a, 0x07, 0x44, - 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x09, 0x44, 0x72, 0x6f, - 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x13, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0e, 0x2e, 0x64, 0x62, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x73, 0x1a, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x14, 0x2e, 0x64, - 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x54, 0x0a, - 0x0b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x23, - 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x2e, 0x64, 0x62, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x1a, 0x0f, 0x2e, 0x64, 0x62, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x08, - 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x1f, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, - 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, - 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x62, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x64, 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xca, 0x08, 0x0a, 0x09, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x0f, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x60, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, + 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x27, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, + 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x1a, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x34, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x14, 0x2e, + 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x0d, 0x2e, 0x64, 0x62, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x44, 0x72, 0x6f, + 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x2e, 0x64, 0x62, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x12, 0x54, 0x0a, 0x1b, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, + 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x25, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, + 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x2a, 0x0a, 0x06, 0x44, 0x65, 0x6c, + 0x4b, 0x65, 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, + 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x2c, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, + 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x50, + 0x72, 0x65, 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x09, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x12, 0x13, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, + 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, + 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x14, 0x2e, 0x64, 0x62, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x14, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x04, 0x50, + 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, + 0x69, 0x6e, 0x67, 0x1a, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x12, 0x1e, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, + 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x1a, 0x1f, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, + 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, + 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2f, 0x64, 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x64, + 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var file_services_db_service_proto_goTypes = []any{ @@ -129,10 +123,10 @@ var file_services_db_service_proto_goTypes = []any{ (*query.DelKey)(nil), // 10: db.query.DelKey (*query.DelPred)(nil), // 11: db.query.DelPred (*query.DropStore)(nil), // 12: db.query.DropStore - (*query.ListClients)(nil), // 13: db.query.ListClients - (*query.ListStores)(nil), // 14: db.query.ListStores - (*query.InfoServer)(nil), // 15: db.query.InfoServer - (*cluster.ClusterInfoQuery)(nil), // 16: shared.cluster.ClusterInfoQuery + (*query.DropSchema)(nil), // 13: db.query.DropSchema + (*query.ListClients)(nil), // 14: db.query.ListClients + (*query.ListStores)(nil), // 15: db.query.ListStores + (*query.InfoServer)(nil), // 16: db.query.InfoServer (*query.Ping)(nil), // 17: db.query.Ping (*pipeline.DBRequestPipeline)(nil), // 18: db.pipeline.DBRequestPipeline (*server.Unit)(nil), // 19: db.server.Unit @@ -145,9 +139,8 @@ var file_services_db_service_proto_goTypes = []any{ (*server.ClientList)(nil), // 26: db.server.ClientList (*server.StoreList)(nil), // 27: db.server.StoreList (*server.InfoServer)(nil), // 28: db.server.InfoServer - (*cluster.ClusterInfoResponse)(nil), // 29: shared.cluster.ClusterInfoResponse - (*server.Pong)(nil), // 30: db.server.Pong - (*pipeline.DBResponsePipeline)(nil), // 31: db.pipeline.DBResponsePipeline + (*server.Pong)(nil), // 29: db.server.Pong + (*pipeline.DBResponsePipeline)(nil), // 30: db.pipeline.DBResponsePipeline } var file_services_db_service_proto_depIdxs = []int32{ 0, // 0: services.db_service.DBService.CreateStore:input_type -> db.query.CreateStore @@ -163,10 +156,10 @@ var file_services_db_service_proto_depIdxs = []int32{ 10, // 10: services.db_service.DBService.DelKey:input_type -> db.query.DelKey 11, // 11: services.db_service.DBService.DelPred:input_type -> db.query.DelPred 12, // 12: services.db_service.DBService.DropStore:input_type -> db.query.DropStore - 13, // 13: services.db_service.DBService.ListClients:input_type -> db.query.ListClients - 14, // 14: services.db_service.DBService.ListStores:input_type -> db.query.ListStores - 15, // 15: services.db_service.DBService.InfoServer:input_type -> db.query.InfoServer - 16, // 16: services.db_service.DBService.ClusterInfo:input_type -> shared.cluster.ClusterInfoQuery + 13, // 13: services.db_service.DBService.DropSchema:input_type -> db.query.DropSchema + 14, // 14: services.db_service.DBService.ListClients:input_type -> db.query.ListClients + 15, // 15: services.db_service.DBService.ListStores:input_type -> db.query.ListStores + 16, // 16: services.db_service.DBService.InfoServer:input_type -> db.query.InfoServer 17, // 17: services.db_service.DBService.Ping:input_type -> db.query.Ping 18, // 18: services.db_service.DBService.Pipeline:input_type -> db.pipeline.DBRequestPipeline 19, // 19: services.db_service.DBService.CreateStore:output_type -> db.server.Unit @@ -182,12 +175,12 @@ var file_services_db_service_proto_depIdxs = []int32{ 25, // 29: services.db_service.DBService.DelKey:output_type -> db.server.Del 25, // 30: services.db_service.DBService.DelPred:output_type -> db.server.Del 25, // 31: services.db_service.DBService.DropStore:output_type -> db.server.Del - 26, // 32: services.db_service.DBService.ListClients:output_type -> db.server.ClientList - 27, // 33: services.db_service.DBService.ListStores:output_type -> db.server.StoreList - 28, // 34: services.db_service.DBService.InfoServer:output_type -> db.server.InfoServer - 29, // 35: services.db_service.DBService.ClusterInfo:output_type -> shared.cluster.ClusterInfoResponse - 30, // 36: services.db_service.DBService.Ping:output_type -> db.server.Pong - 31, // 37: services.db_service.DBService.Pipeline:output_type -> db.pipeline.DBResponsePipeline + 25, // 32: services.db_service.DBService.DropSchema:output_type -> db.server.Del + 26, // 33: services.db_service.DBService.ListClients:output_type -> db.server.ClientList + 27, // 34: services.db_service.DBService.ListStores:output_type -> db.server.StoreList + 28, // 35: services.db_service.DBService.InfoServer:output_type -> db.server.InfoServer + 29, // 36: services.db_service.DBService.Ping:output_type -> db.server.Pong + 30, // 37: services.db_service.DBService.Pipeline:output_type -> db.pipeline.DBResponsePipeline 19, // [19:38] is the sub-list for method output_type 0, // [0:19] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go index ce4b12bea..4c2ea2c50 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go @@ -8,15 +8,12 @@ package db_service import ( context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" - cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file @@ -38,10 +35,10 @@ const ( DBService_DelKey_FullMethodName = "/services.db_service.DBService/DelKey" DBService_DelPred_FullMethodName = "/services.db_service.DBService/DelPred" DBService_DropStore_FullMethodName = "/services.db_service.DBService/DropStore" + DBService_DropSchema_FullMethodName = "/services.db_service.DBService/DropSchema" DBService_ListClients_FullMethodName = "/services.db_service.DBService/ListClients" DBService_ListStores_FullMethodName = "/services.db_service.DBService/ListStores" DBService_InfoServer_FullMethodName = "/services.db_service.DBService/InfoServer" - DBService_ClusterInfo_FullMethodName = "/services.db_service.DBService/ClusterInfo" DBService_Ping_FullMethodName = "/services.db_service.DBService/Ping" DBService_Pipeline_FullMethodName = "/services.db_service.DBService/Pipeline" ) @@ -67,11 +64,11 @@ type DBServiceClient interface { DelKey(ctx context.Context, in *query.DelKey, opts ...grpc.CallOption) (*server.Del, error) DelPred(ctx context.Context, in *query.DelPred, opts ...grpc.CallOption) (*server.Del, error) DropStore(ctx context.Context, in *query.DropStore, opts ...grpc.CallOption) (*server.Del, error) + DropSchema(ctx context.Context, in *query.DropSchema, opts ...grpc.CallOption) (*server.Del, error) // * Ancillary info methods * ListClients(ctx context.Context, in *query.ListClients, opts ...grpc.CallOption) (*server.ClientList, error) ListStores(ctx context.Context, in *query.ListStores, opts ...grpc.CallOption) (*server.StoreList, error) InfoServer(ctx context.Context, in *query.InfoServer, opts ...grpc.CallOption) (*server.InfoServer, error) - ClusterInfo(ctx context.Context, in *cluster.ClusterInfoQuery, opts ...grpc.CallOption) (*cluster.ClusterInfoResponse, error) Ping(ctx context.Context, in *query.Ping, opts ...grpc.CallOption) (*server.Pong, error) // * Pipeline method for all methods * Pipeline(ctx context.Context, in *pipeline.DBRequestPipeline, opts ...grpc.CallOption) (*pipeline.DBResponsePipeline, error) @@ -215,6 +212,16 @@ func (c *dBServiceClient) DropStore(ctx context.Context, in *query.DropStore, op return out, nil } +func (c *dBServiceClient) DropSchema(ctx context.Context, in *query.DropSchema, opts ...grpc.CallOption) (*server.Del, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(server.Del) + err := c.cc.Invoke(ctx, DBService_DropSchema_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dBServiceClient) ListClients(ctx context.Context, in *query.ListClients, opts ...grpc.CallOption) (*server.ClientList, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(server.ClientList) @@ -245,16 +252,6 @@ func (c *dBServiceClient) InfoServer(ctx context.Context, in *query.InfoServer, return out, nil } -func (c *dBServiceClient) ClusterInfo(ctx context.Context, in *cluster.ClusterInfoQuery, opts ...grpc.CallOption) (*cluster.ClusterInfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(cluster.ClusterInfoResponse) - err := c.cc.Invoke(ctx, DBService_ClusterInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *dBServiceClient) Ping(ctx context.Context, in *query.Ping, opts ...grpc.CallOption) (*server.Pong, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(server.Pong) @@ -296,11 +293,11 @@ type DBServiceServer interface { DelKey(context.Context, *query.DelKey) (*server.Del, error) DelPred(context.Context, *query.DelPred) (*server.Del, error) DropStore(context.Context, *query.DropStore) (*server.Del, error) + DropSchema(context.Context, *query.DropSchema) (*server.Del, error) // * Ancillary info methods * ListClients(context.Context, *query.ListClients) (*server.ClientList, error) ListStores(context.Context, *query.ListStores) (*server.StoreList, error) InfoServer(context.Context, *query.InfoServer) (*server.InfoServer, error) - ClusterInfo(context.Context, *cluster.ClusterInfoQuery) (*cluster.ClusterInfoResponse, error) Ping(context.Context, *query.Ping) (*server.Pong, error) // * Pipeline method for all methods * Pipeline(context.Context, *pipeline.DBRequestPipeline) (*pipeline.DBResponsePipeline, error) @@ -353,6 +350,9 @@ func (UnimplementedDBServiceServer) DelPred(context.Context, *query.DelPred) (*s func (UnimplementedDBServiceServer) DropStore(context.Context, *query.DropStore) (*server.Del, error) { return nil, status.Errorf(codes.Unimplemented, "method DropStore not implemented") } +func (UnimplementedDBServiceServer) DropSchema(context.Context, *query.DropSchema) (*server.Del, error) { + return nil, status.Errorf(codes.Unimplemented, "method DropSchema not implemented") +} func (UnimplementedDBServiceServer) ListClients(context.Context, *query.ListClients) (*server.ClientList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListClients not implemented") } @@ -362,9 +362,6 @@ func (UnimplementedDBServiceServer) ListStores(context.Context, *query.ListStore func (UnimplementedDBServiceServer) InfoServer(context.Context, *query.InfoServer) (*server.InfoServer, error) { return nil, status.Errorf(codes.Unimplemented, "method InfoServer not implemented") } -func (UnimplementedDBServiceServer) ClusterInfo(context.Context, *cluster.ClusterInfoQuery) (*cluster.ClusterInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClusterInfo not implemented") -} func (UnimplementedDBServiceServer) Ping(context.Context, *query.Ping) (*server.Pong, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } @@ -626,6 +623,24 @@ func _DBService_DropStore_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _DBService_DropSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(query.DropSchema) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DBServiceServer).DropSchema(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DBService_DropSchema_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DBServiceServer).DropSchema(ctx, req.(*query.DropSchema)) + } + return interceptor(ctx, in, info, handler) +} + func _DBService_ListClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(query.ListClients) if err := dec(in); err != nil { @@ -680,24 +695,6 @@ func _DBService_InfoServer_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _DBService_ClusterInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(cluster.ClusterInfoQuery) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBServiceServer).ClusterInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBService_ClusterInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBServiceServer).ClusterInfo(ctx, req.(*cluster.ClusterInfoQuery)) - } - return interceptor(ctx, in, info, handler) -} - func _DBService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(query.Ping) if err := dec(in); err != nil { @@ -793,6 +790,10 @@ var DBService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DropStore", Handler: _DBService_DropStore_Handler, }, + { + MethodName: "DropSchema", + Handler: _DBService_DropSchema_Handler, + }, { MethodName: "ListClients", Handler: _DBService_ListClients_Handler, @@ -805,10 +806,6 @@ var DBService_ServiceDesc = grpc.ServiceDesc{ MethodName: "InfoServer", Handler: _DBService_InfoServer_Handler, }, - { - MethodName: "ClusterInfo", - Handler: _DBService_ClusterInfo_Handler, - }, { MethodName: "Ping", Handler: _DBService_Ping_Handler, diff --git a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go index 88f9580bf..5c7f1f49d 100644 --- a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go @@ -16,11 +16,10 @@ package cluster import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go index d5a440ea8..cb2e80638 100644 --- a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go @@ -7,13 +7,11 @@ package info import ( - reflect "reflect" - sync "sync" - + server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go index 289811655..aa9a9050d 100644 --- a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go +++ b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go @@ -7,11 +7,10 @@ package similarity import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/version/version.pb.go b/sdk/ahnlich-client-go/grpc/version/version.pb.go index 3207ab183..a7474bc7d 100644 --- a/sdk/ahnlich-client-go/grpc/version/version.pb.go +++ b/sdk/ahnlich-client-go/grpc/version/version.pb.go @@ -7,11 +7,10 @@ package version import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts b/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts index 43df2d1ed..81d259093 100644 --- a/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts @@ -38,3 +38,4 @@ proto3.util.setEnumType(ExecutionProvider, "ai.execution_provider.ExecutionProvi { no: 2, name: "DIRECT_ML" }, { no: 3, name: "CORE_ML" }, ]); + diff --git a/sdk/ahnlich-client-node/grpc/ai/models_pb.ts b/sdk/ahnlich-client-node/grpc/ai/models_pb.ts index 47f1db519..13df27bcb 100644 --- a/sdk/ahnlich-client-node/grpc/ai/models_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/models_pb.ts @@ -112,3 +112,4 @@ proto3.util.setEnumType(AIStoreInputType, "ai.models.AIStoreInputType", [ { no: 1, name: "IMAGE" }, { no: 2, name: "AUDIO" }, ]); + diff --git a/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts b/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts index 7741b427b..124007c5f 100644 --- a/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts @@ -3,50 +3,10 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { - ConvertStoreInputToEmbeddings, - CreateNonLinearAlgorithmIndex, - CreatePredIndex, - CreateStore, - DelKey, - DelPred, - DropNonLinearAlgorithmIndex, - DropPredIndex, - DropStore, - GetKey, - GetPred, - GetSimN, - GetStore, - InfoServer, - ListClients, - ListStores, - Ping, - PurgeStores, - Set, -} from "./query_pb.js"; -import { - AIStoreInfo, - ClientList, - CreateIndex, - Del, - Get, - GetSimN as GetSimN$1, - InfoServer as InfoServer$1, - Pong, - Set as Set$1, - StoreInputToEmbeddingsList, - StoreList, - Unit, -} from "./server_pb.js"; +import { ConvertStoreInputToEmbeddings, CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, PurgeStores, Set } from "./query_pb.js"; +import { AIStoreInfo, ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInputToEmbeddingsList, StoreList, Unit } from "./server_pb.js"; import { ErrorResponse } from "../shared/info_pb.js"; /** @@ -56,141 +16,127 @@ export class AIQuery extends Message { /** * @generated from oneof ai.pipeline.AIQuery.query */ - query: - | { - /** - * @generated from field: ai.query.CreateStore create_store = 1; - */ - value: CreateStore; - case: "createStore"; - } - | { - /** - * @generated from field: ai.query.GetPred get_pred = 2; - */ - value: GetPred; - case: "getPred"; - } - | { - /** - * @generated from field: ai.query.GetSimN get_sim_n = 3; - */ - value: GetSimN; - case: "getSimN"; - } - | { - /** - * @generated from field: ai.query.CreatePredIndex create_pred_index = 4; - */ - value: CreatePredIndex; - case: "createPredIndex"; - } - | { - /** - * @generated from field: ai.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 5; - */ - value: CreateNonLinearAlgorithmIndex; - case: "createNonLinearAlgorithmIndex"; - } - | { - /** - * @generated from field: ai.query.DropPredIndex drop_pred_index = 6; - */ - value: DropPredIndex; - case: "dropPredIndex"; - } - | { - /** - * @generated from field: ai.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 7; - */ - value: DropNonLinearAlgorithmIndex; - case: "dropNonLinearAlgorithmIndex"; - } - | { - /** - * @generated from field: ai.query.Set set = 8; - */ - value: Set; - case: "set"; - } - | { - /** - * @generated from field: ai.query.DelKey del_key = 9; - */ - value: DelKey; - case: "delKey"; - } - | { - /** - * @generated from field: ai.query.DropStore drop_store = 10; - */ - value: DropStore; - case: "dropStore"; - } - | { - /** - * @generated from field: ai.query.GetKey get_key = 11; - */ - value: GetKey; - case: "getKey"; - } - | { - /** - * @generated from field: ai.query.InfoServer info_server = 12; - */ - value: InfoServer; - case: "infoServer"; - } - | { - /** - * @generated from field: ai.query.ListClients list_clients = 13; - */ - value: ListClients; - case: "listClients"; - } - | { - /** - * @generated from field: ai.query.ListStores list_stores = 14; - */ - value: ListStores; - case: "listStores"; - } - | { - /** - * @generated from field: ai.query.PurgeStores purge_stores = 15; - */ - value: PurgeStores; - case: "purgeStores"; - } - | { - /** - * @generated from field: ai.query.Ping ping = 16; - */ - value: Ping; - case: "ping"; - } - | { - /** - * @generated from field: ai.query.ConvertStoreInputToEmbeddings convert_store_input_to_embeddings = 17; - */ - value: ConvertStoreInputToEmbeddings; - case: "convertStoreInputToEmbeddings"; - } - | { - /** - * @generated from field: ai.query.DelPred del_pred = 18; - */ - value: DelPred; - case: "delPred"; - } - | { - /** - * @generated from field: ai.query.GetStore get_store = 19; - */ - value: GetStore; - case: "getStore"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + query: { + /** + * @generated from field: ai.query.CreateStore create_store = 1; + */ + value: CreateStore; + case: "createStore"; + } | { + /** + * @generated from field: ai.query.GetPred get_pred = 2; + */ + value: GetPred; + case: "getPred"; + } | { + /** + * @generated from field: ai.query.GetSimN get_sim_n = 3; + */ + value: GetSimN; + case: "getSimN"; + } | { + /** + * @generated from field: ai.query.CreatePredIndex create_pred_index = 4; + */ + value: CreatePredIndex; + case: "createPredIndex"; + } | { + /** + * @generated from field: ai.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 5; + */ + value: CreateNonLinearAlgorithmIndex; + case: "createNonLinearAlgorithmIndex"; + } | { + /** + * @generated from field: ai.query.DropPredIndex drop_pred_index = 6; + */ + value: DropPredIndex; + case: "dropPredIndex"; + } | { + /** + * @generated from field: ai.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 7; + */ + value: DropNonLinearAlgorithmIndex; + case: "dropNonLinearAlgorithmIndex"; + } | { + /** + * @generated from field: ai.query.Set set = 8; + */ + value: Set; + case: "set"; + } | { + /** + * @generated from field: ai.query.DelKey del_key = 9; + */ + value: DelKey; + case: "delKey"; + } | { + /** + * @generated from field: ai.query.DropStore drop_store = 10; + */ + value: DropStore; + case: "dropStore"; + } | { + /** + * @generated from field: ai.query.GetKey get_key = 11; + */ + value: GetKey; + case: "getKey"; + } | { + /** + * @generated from field: ai.query.InfoServer info_server = 12; + */ + value: InfoServer; + case: "infoServer"; + } | { + /** + * @generated from field: ai.query.ListClients list_clients = 13; + */ + value: ListClients; + case: "listClients"; + } | { + /** + * @generated from field: ai.query.ListStores list_stores = 14; + */ + value: ListStores; + case: "listStores"; + } | { + /** + * @generated from field: ai.query.PurgeStores purge_stores = 15; + */ + value: PurgeStores; + case: "purgeStores"; + } | { + /** + * @generated from field: ai.query.Ping ping = 16; + */ + value: Ping; + case: "ping"; + } | { + /** + * @generated from field: ai.query.ConvertStoreInputToEmbeddings convert_store_input_to_embeddings = 17; + */ + value: ConvertStoreInputToEmbeddings; + case: "convertStoreInputToEmbeddings"; + } | { + /** + * @generated from field: ai.query.DelPred del_pred = 18; + */ + value: DelPred; + case: "delPred"; + } | { + /** + * @generated from field: ai.query.GetStore get_store = 19; + */ + value: GetStore; + case: "getStore"; + } | { + /** + * @generated from field: ai.query.DropSchema drop_schema = 20; + */ + value: DropSchema; + case: "dropSchema"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -204,21 +150,9 @@ export class AIQuery extends Message { { no: 2, name: "get_pred", kind: "message", T: GetPred, oneof: "query" }, { no: 3, name: "get_sim_n", kind: "message", T: GetSimN, oneof: "query" }, { no: 4, name: "create_pred_index", kind: "message", T: CreatePredIndex, oneof: "query" }, - { - no: 5, - name: "create_non_linear_algorithm_index", - kind: "message", - T: CreateNonLinearAlgorithmIndex, - oneof: "query", - }, + { no: 5, name: "create_non_linear_algorithm_index", kind: "message", T: CreateNonLinearAlgorithmIndex, oneof: "query" }, { no: 6, name: "drop_pred_index", kind: "message", T: DropPredIndex, oneof: "query" }, - { - no: 7, - name: "drop_non_linear_algorithm_index", - kind: "message", - T: DropNonLinearAlgorithmIndex, - oneof: "query", - }, + { no: 7, name: "drop_non_linear_algorithm_index", kind: "message", T: DropNonLinearAlgorithmIndex, oneof: "query" }, { no: 8, name: "set", kind: "message", T: Set, oneof: "query" }, { no: 9, name: "del_key", kind: "message", T: DelKey, oneof: "query" }, { no: 10, name: "drop_store", kind: "message", T: DropStore, oneof: "query" }, @@ -228,15 +162,10 @@ export class AIQuery extends Message { { no: 14, name: "list_stores", kind: "message", T: ListStores, oneof: "query" }, { no: 15, name: "purge_stores", kind: "message", T: PurgeStores, oneof: "query" }, { no: 16, name: "ping", kind: "message", T: Ping, oneof: "query" }, - { - no: 17, - name: "convert_store_input_to_embeddings", - kind: "message", - T: ConvertStoreInputToEmbeddings, - oneof: "query", - }, + { no: 17, name: "convert_store_input_to_embeddings", kind: "message", T: ConvertStoreInputToEmbeddings, oneof: "query" }, { no: 18, name: "del_pred", kind: "message", T: DelPred, oneof: "query" }, { no: 19, name: "get_store", kind: "message", T: GetStore, oneof: "query" }, + { no: 20, name: "drop_schema", kind: "message", T: DropSchema, oneof: "query" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AIQuery { @@ -251,10 +180,7 @@ export class AIQuery extends Message { return new AIQuery().fromJsonString(jsonString, options); } - static equals( - a: AIQuery | PlainMessage | undefined, - b: AIQuery | PlainMessage | undefined, - ): boolean { + static equals(a: AIQuery | PlainMessage | undefined, b: AIQuery | PlainMessage | undefined): boolean { return proto3.util.equals(AIQuery, a, b); } } @@ -291,10 +217,7 @@ export class AIRequestPipeline extends Message { return new AIRequestPipeline().fromJsonString(jsonString, options); } - static equals( - a: AIRequestPipeline | PlainMessage | undefined, - b: AIRequestPipeline | PlainMessage | undefined, - ): boolean { + static equals(a: AIRequestPipeline | PlainMessage | undefined, b: AIRequestPipeline | PlainMessage | undefined): boolean { return proto3.util.equals(AIRequestPipeline, a, b); } } @@ -306,99 +229,85 @@ export class AIServerResponse extends Message { /** * @generated from oneof ai.pipeline.AIServerResponse.response */ - response: - | { - /** - * @generated from field: ai.server.Unit unit = 1; - */ - value: Unit; - case: "unit"; - } - | { - /** - * @generated from field: ai.server.Pong pong = 2; - */ - value: Pong; - case: "pong"; - } - | { - /** - * @generated from field: ai.server.ClientList client_list = 3; - */ - value: ClientList; - case: "clientList"; - } - | { - /** - * @generated from field: ai.server.StoreList store_list = 4; - */ - value: StoreList; - case: "storeList"; - } - | { - /** - * @generated from field: ai.server.InfoServer info_server = 5; - */ - value: InfoServer$1; - case: "infoServer"; - } - | { - /** - * @generated from field: ai.server.Set set = 6; - */ - value: Set$1; - case: "set"; - } - | { - /** - * @generated from field: ai.server.Get get = 7; - */ - value: Get; - case: "get"; - } - | { - /** - * @generated from field: ai.server.GetSimN get_sim_n = 8; - */ - value: GetSimN$1; - case: "getSimN"; - } - | { - /** - * @generated from field: ai.server.Del del = 9; - */ - value: Del; - case: "del"; - } - | { - /** - * @generated from field: ai.server.CreateIndex create_index = 10; - */ - value: CreateIndex; - case: "createIndex"; - } - | { - /** - * @generated from field: shared.info.ErrorResponse error = 11; - */ - value: ErrorResponse; - case: "error"; - } - | { - /** - * @generated from field: ai.server.StoreInputToEmbeddingsList store_input_to_embeddings_list = 12; - */ - value: StoreInputToEmbeddingsList; - case: "storeInputToEmbeddingsList"; - } - | { - /** - * @generated from field: ai.server.AIStoreInfo store_info = 13; - */ - value: AIStoreInfo; - case: "storeInfo"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + response: { + /** + * @generated from field: ai.server.Unit unit = 1; + */ + value: Unit; + case: "unit"; + } | { + /** + * @generated from field: ai.server.Pong pong = 2; + */ + value: Pong; + case: "pong"; + } | { + /** + * @generated from field: ai.server.ClientList client_list = 3; + */ + value: ClientList; + case: "clientList"; + } | { + /** + * @generated from field: ai.server.StoreList store_list = 4; + */ + value: StoreList; + case: "storeList"; + } | { + /** + * @generated from field: ai.server.InfoServer info_server = 5; + */ + value: InfoServer$1; + case: "infoServer"; + } | { + /** + * @generated from field: ai.server.Set set = 6; + */ + value: Set$1; + case: "set"; + } | { + /** + * @generated from field: ai.server.Get get = 7; + */ + value: Get; + case: "get"; + } | { + /** + * @generated from field: ai.server.GetSimN get_sim_n = 8; + */ + value: GetSimN$1; + case: "getSimN"; + } | { + /** + * @generated from field: ai.server.Del del = 9; + */ + value: Del; + case: "del"; + } | { + /** + * @generated from field: ai.server.CreateIndex create_index = 10; + */ + value: CreateIndex; + case: "createIndex"; + } | { + /** + * @generated from field: shared.info.ErrorResponse error = 11; + */ + value: ErrorResponse; + case: "error"; + } | { + /** + * @generated from field: ai.server.StoreInputToEmbeddingsList store_input_to_embeddings_list = 12; + */ + value: StoreInputToEmbeddingsList; + case: "storeInputToEmbeddingsList"; + } | { + /** + * @generated from field: ai.server.AIStoreInfo store_info = 13; + */ + value: AIStoreInfo; + case: "storeInfo"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -419,13 +328,7 @@ export class AIServerResponse extends Message { { no: 9, name: "del", kind: "message", T: Del, oneof: "response" }, { no: 10, name: "create_index", kind: "message", T: CreateIndex, oneof: "response" }, { no: 11, name: "error", kind: "message", T: ErrorResponse, oneof: "response" }, - { - no: 12, - name: "store_input_to_embeddings_list", - kind: "message", - T: StoreInputToEmbeddingsList, - oneof: "response", - }, + { no: 12, name: "store_input_to_embeddings_list", kind: "message", T: StoreInputToEmbeddingsList, oneof: "response" }, { no: 13, name: "store_info", kind: "message", T: AIStoreInfo, oneof: "response" }, ]); @@ -441,10 +344,7 @@ export class AIServerResponse extends Message { return new AIServerResponse().fromJsonString(jsonString, options); } - static equals( - a: AIServerResponse | PlainMessage | undefined, - b: AIServerResponse | PlainMessage | undefined, - ): boolean { + static equals(a: AIServerResponse | PlainMessage | undefined, b: AIServerResponse | PlainMessage | undefined): boolean { return proto3.util.equals(AIServerResponse, a, b); } } @@ -477,17 +377,12 @@ export class AIResponsePipeline extends Message { return new AIResponsePipeline().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): AIResponsePipeline { + static fromJsonString(jsonString: string, options?: Partial): AIResponsePipeline { return new AIResponsePipeline().fromJsonString(jsonString, options); } - static equals( - a: AIResponsePipeline | PlainMessage | undefined, - b: AIResponsePipeline | PlainMessage | undefined, - ): boolean { + static equals(a: AIResponsePipeline | PlainMessage | undefined, b: AIResponsePipeline | PlainMessage | undefined): boolean { return proto3.util.equals(AIResponsePipeline, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts b/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts index 43262a11d..1fe496e4b 100644 --- a/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts @@ -24,3 +24,4 @@ proto3.util.setEnumType(PreprocessAction, "ai.preprocess.PreprocessAction", [ { no: 0, name: "NoPreprocessing" }, { no: 1, name: "ModelPreprocessing" }, ]); + diff --git a/sdk/ahnlich-client-node/grpc/ai/query_pb.ts b/sdk/ahnlich-client-node/grpc/ai/query_pb.ts index c291c2f43..cd3a91bdc 100644 --- a/sdk/ahnlich-client-node/grpc/ai/query_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/query_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { AIModel } from "./models_pb.js"; import { NonLinearAlgorithm, NonLinearIndex } from "../algorithm/nonlinear_pb.js"; @@ -80,6 +73,13 @@ export class CreateStore extends Message { */ storeOriginal = false; + /** + * Optional schema/namespace for the store. Defaults to "public". + * + * @generated from field: optional string schema = 8; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -95,6 +95,7 @@ export class CreateStore extends Message { { no: 5, name: "non_linear_indices", kind: "message", T: NonLinearIndex, repeated: true }, { no: 6, name: "error_if_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 7, name: "store_original", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 8, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateStore { @@ -109,10 +110,7 @@ export class CreateStore extends Message { return new CreateStore().fromJsonString(jsonString, options); } - static equals( - a: CreateStore | PlainMessage | undefined, - b: CreateStore | PlainMessage | undefined, - ): boolean { + static equals(a: CreateStore | PlainMessage | undefined, b: CreateStore | PlainMessage | undefined): boolean { return proto3.util.equals(CreateStore, a, b); } } @@ -162,10 +160,7 @@ export class GetPred extends Message { return new GetPred().fromJsonString(jsonString, options); } - static equals( - a: GetPred | PlainMessage | undefined, - b: GetPred | PlainMessage | undefined, - ): boolean { + static equals(a: GetPred | PlainMessage | undefined, b: GetPred | PlainMessage | undefined): boolean { return proto3.util.equals(GetPred, a, b); } } @@ -246,20 +241,8 @@ export class GetSimN extends Message { { no: 4, name: "closest_n", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 5, name: "algorithm", kind: "enum", T: proto3.getEnumType(Algorithm) }, { no: 6, name: "preprocess_action", kind: "enum", T: proto3.getEnumType(PreprocessAction) }, - { - no: 7, - name: "execution_provider", - kind: "enum", - T: proto3.getEnumType(ExecutionProvider), - opt: true, - }, - { - no: 8, - name: "model_params", - kind: "map", - K: 9 /* ScalarType.STRING */, - V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, - }, + { no: 7, name: "execution_provider", kind: "enum", T: proto3.getEnumType(ExecutionProvider), opt: true }, + { no: 8, name: "model_params", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSimN { @@ -274,10 +257,7 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals( - a: GetSimN | PlainMessage | undefined, - b: GetSimN | PlainMessage | undefined, - ): boolean { + static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -326,10 +306,7 @@ export class CreatePredIndex extends Message { return new CreatePredIndex().fromJsonString(jsonString, options); } - static equals( - a: CreatePredIndex | PlainMessage | undefined, - b: CreatePredIndex | PlainMessage | undefined, - ): boolean { + static equals(a: CreatePredIndex | PlainMessage | undefined, b: CreatePredIndex | PlainMessage | undefined): boolean { return proto3.util.equals(CreatePredIndex, a, b); } } @@ -366,31 +343,19 @@ export class CreateNonLinearAlgorithmIndex extends Message, - ): CreateNonLinearAlgorithmIndex { + static fromBinary(bytes: Uint8Array, options?: Partial): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): CreateNonLinearAlgorithmIndex { + static fromJson(jsonValue: JsonValue, options?: Partial): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): CreateNonLinearAlgorithmIndex { + static fromJsonString(jsonString: string, options?: Partial): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals( - a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, - b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, - ): boolean { + static equals(a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { return proto3.util.equals(CreateNonLinearAlgorithmIndex, a, b); } } @@ -448,10 +413,7 @@ export class DropPredIndex extends Message { return new DropPredIndex().fromJsonString(jsonString, options); } - static equals( - a: DropPredIndex | PlainMessage | undefined, - b: DropPredIndex | PlainMessage | undefined, - ): boolean { + static equals(a: DropPredIndex | PlainMessage | undefined, b: DropPredIndex | PlainMessage | undefined): boolean { return proto3.util.equals(DropPredIndex, a, b); } } @@ -493,41 +455,23 @@ export class DropNonLinearAlgorithmIndex extends Message [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { - no: 2, - name: "non_linear_indices", - kind: "enum", - T: proto3.getEnumType(NonLinearAlgorithm), - repeated: true, - }, + { no: 2, name: "non_linear_indices", kind: "enum", T: proto3.getEnumType(NonLinearAlgorithm), repeated: true }, { no: 3, name: "error_if_not_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); - static fromBinary( - bytes: Uint8Array, - options?: Partial, - ): DropNonLinearAlgorithmIndex { + static fromBinary(bytes: Uint8Array, options?: Partial): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): DropNonLinearAlgorithmIndex { + static fromJson(jsonValue: JsonValue, options?: Partial): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): DropNonLinearAlgorithmIndex { + static fromJsonString(jsonString: string, options?: Partial): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals( - a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, - b: DropNonLinearAlgorithmIndex | PlainMessage | undefined, - ): boolean { + static equals(a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, b: DropNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { return proto3.util.equals(DropNonLinearAlgorithmIndex, a, b); } } @@ -577,10 +521,7 @@ export class DelKey extends Message { return new DelKey().fromJsonString(jsonString, options); } - static equals( - a: DelKey | PlainMessage | undefined, - b: DelKey | PlainMessage | undefined, - ): boolean { + static equals(a: DelKey | PlainMessage | undefined, b: DelKey | PlainMessage | undefined): boolean { return proto3.util.equals(DelKey, a, b); } } @@ -631,10 +572,7 @@ export class DelPred extends Message { return new DelPred().fromJsonString(jsonString, options); } - static equals( - a: DelPred | PlainMessage | undefined, - b: DelPred | PlainMessage | undefined, - ): boolean { + static equals(a: DelPred | PlainMessage | undefined, b: DelPred | PlainMessage | undefined): boolean { return proto3.util.equals(DelPred, a, b); } } @@ -660,6 +598,13 @@ export class DropStore extends Message { */ errorIfNotExists = false; + /** + * Optional schema/namespace for the store. Defaults to "public". + * + * @generated from field: optional string schema = 3; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -670,6 +615,7 @@ export class DropStore extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "error_if_not_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DropStore { @@ -684,10 +630,7 @@ export class DropStore extends Message { return new DropStore().fromJsonString(jsonString, options); } - static equals( - a: DropStore | PlainMessage | undefined, - b: DropStore | PlainMessage | undefined, - ): boolean { + static equals(a: DropStore | PlainMessage | undefined, b: DropStore | PlainMessage | undefined): boolean { return proto3.util.equals(DropStore, a, b); } } @@ -736,10 +679,7 @@ export class GetKey extends Message { return new GetKey().fromJsonString(jsonString, options); } - static equals( - a: GetKey | PlainMessage | undefined, - b: GetKey | PlainMessage | undefined, - ): boolean { + static equals(a: GetKey | PlainMessage | undefined, b: GetKey | PlainMessage | undefined): boolean { return proto3.util.equals(GetKey, a, b); } } @@ -757,7 +697,8 @@ export class InfoServer extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.InfoServer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): InfoServer { return new InfoServer().fromBinary(bytes, options); @@ -771,10 +712,7 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals( - a: InfoServer | PlainMessage | undefined, - b: InfoServer | PlainMessage | undefined, - ): boolean { + static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -792,7 +730,8 @@ export class ListClients extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.ListClients"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListClients { return new ListClients().fromBinary(bytes, options); @@ -806,20 +745,24 @@ export class ListClients extends Message { return new ListClients().fromJsonString(jsonString, options); } - static equals( - a: ListClients | PlainMessage | undefined, - b: ListClients | PlainMessage | undefined, - ): boolean { + static equals(a: ListClients | PlainMessage | undefined, b: ListClients | PlainMessage | undefined): boolean { return proto3.util.equals(ListClients, a, b); } } /** - * Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. - * * @generated from message ai.query.ListStores */ export class ListStores extends Message { + /** + * Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. + * + * Optional schema/namespace to filter stores. If unset, lists all schemas. + * + * @generated from field: optional string schema = 1; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -827,7 +770,9 @@ export class ListStores extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.ListStores"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListStores { return new ListStores().fromBinary(bytes, options); @@ -841,10 +786,7 @@ export class ListStores extends Message { return new ListStores().fromJsonString(jsonString, options); } - static equals( - a: ListStores | PlainMessage | undefined, - b: ListStores | PlainMessage | undefined, - ): boolean { + static equals(a: ListStores | PlainMessage | undefined, b: ListStores | PlainMessage | undefined): boolean { return proto3.util.equals(ListStores, a, b); } } @@ -862,6 +804,13 @@ export class GetStore extends Message { */ store = ""; + /** + * Optional schema/namespace for the store. Defaults to "public". + * + * @generated from field: optional string schema = 2; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -871,6 +820,7 @@ export class GetStore extends Message { static readonly typeName = "ai.query.GetStore"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetStore { @@ -885,14 +835,52 @@ export class GetStore extends Message { return new GetStore().fromJsonString(jsonString, options); } - static equals( - a: GetStore | PlainMessage | undefined, - b: GetStore | PlainMessage | undefined, - ): boolean { + static equals(a: GetStore | PlainMessage | undefined, b: GetStore | PlainMessage | undefined): boolean { return proto3.util.equals(GetStore, a, b); } } +/** + * @generated from message ai.query.DropSchema + */ +export class DropSchema extends Message { + /** + * Drops an entire schema and all stores within it. Cannot drop the "public" default schema. + * + * The name of the schema to drop. + * + * @generated from field: string schema = 1; + */ + schema = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ai.query.DropSchema"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DropSchema { + return new DropSchema().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DropSchema { + return new DropSchema().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DropSchema { + return new DropSchema().fromJsonString(jsonString, options); + } + + static equals(a: DropSchema | PlainMessage | undefined, b: DropSchema | PlainMessage | undefined): boolean { + return proto3.util.equals(DropSchema, a, b); + } +} + /** * Purges (deletes) all stores on the server, effectively destroying all stored data * @@ -906,7 +894,8 @@ export class PurgeStores extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.PurgeStores"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): PurgeStores { return new PurgeStores().fromBinary(bytes, options); @@ -920,10 +909,7 @@ export class PurgeStores extends Message { return new PurgeStores().fromJsonString(jsonString, options); } - static equals( - a: PurgeStores | PlainMessage | undefined, - b: PurgeStores | PlainMessage | undefined, - ): boolean { + static equals(a: PurgeStores | PlainMessage | undefined, b: PurgeStores | PlainMessage | undefined): boolean { return proto3.util.equals(PurgeStores, a, b); } } @@ -941,7 +927,8 @@ export class Ping extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.Ping"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Ping { return new Ping().fromBinary(bytes, options); @@ -955,10 +942,7 @@ export class Ping extends Message { return new Ping().fromJsonString(jsonString, options); } - static equals( - a: Ping | PlainMessage | undefined, - b: Ping | PlainMessage | undefined, - ): boolean { + static equals(a: Ping | PlainMessage | undefined, b: Ping | PlainMessage | undefined): boolean { return proto3.util.equals(Ping, a, b); } } @@ -1016,20 +1000,8 @@ export class Set extends Message { { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "inputs", kind: "message", T: AiStoreEntry, repeated: true }, { no: 3, name: "preprocess_action", kind: "enum", T: proto3.getEnumType(PreprocessAction) }, - { - no: 4, - name: "execution_provider", - kind: "enum", - T: proto3.getEnumType(ExecutionProvider), - opt: true, - }, - { - no: 5, - name: "model_params", - kind: "map", - K: 9 /* ScalarType.STRING */, - V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, - }, + { no: 4, name: "execution_provider", kind: "enum", T: proto3.getEnumType(ExecutionProvider), opt: true }, + { no: 5, name: "model_params", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Set { @@ -1044,10 +1016,7 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals( - a: Set | PlainMessage | undefined, - b: Set | PlainMessage | undefined, - ): boolean { + static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { return proto3.util.equals(Set, a, b); } } @@ -1095,48 +1064,25 @@ export class ConvertStoreInputToEmbeddings extends Message [ { no: 1, name: "store_inputs", kind: "message", T: StoreInput, repeated: true }, - { - no: 2, - name: "preprocess_action", - kind: "enum", - T: proto3.getEnumType(PreprocessAction), - opt: true, - }, + { no: 2, name: "preprocess_action", kind: "enum", T: proto3.getEnumType(PreprocessAction), opt: true }, { no: 3, name: "model", kind: "enum", T: proto3.getEnumType(AIModel) }, - { - no: 4, - name: "model_params", - kind: "map", - K: 9 /* ScalarType.STRING */, - V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, - }, + { no: 4, name: "model_params", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, ]); - static fromBinary( - bytes: Uint8Array, - options?: Partial, - ): ConvertStoreInputToEmbeddings { + static fromBinary(bytes: Uint8Array, options?: Partial): ConvertStoreInputToEmbeddings { return new ConvertStoreInputToEmbeddings().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): ConvertStoreInputToEmbeddings { + static fromJson(jsonValue: JsonValue, options?: Partial): ConvertStoreInputToEmbeddings { return new ConvertStoreInputToEmbeddings().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): ConvertStoreInputToEmbeddings { + static fromJsonString(jsonString: string, options?: Partial): ConvertStoreInputToEmbeddings { return new ConvertStoreInputToEmbeddings().fromJsonString(jsonString, options); } - static equals( - a: ConvertStoreInputToEmbeddings | PlainMessage | undefined, - b: ConvertStoreInputToEmbeddings | PlainMessage | undefined, - ): boolean { + static equals(a: ConvertStoreInputToEmbeddings | PlainMessage | undefined, b: ConvertStoreInputToEmbeddings | PlainMessage | undefined): boolean { return proto3.util.equals(ConvertStoreInputToEmbeddings, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/ai/server_pb.ts b/sdk/ahnlich-client-node/grpc/ai/server_pb.ts index 35eb22f0e..1002aae6c 100644 --- a/sdk/ahnlich-client-node/grpc/ai/server_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/server_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ConnectedClient } from "../client_pb.js"; import { ServerInfo, StoreUpsert } from "../shared/info_pb.js"; @@ -30,7 +23,8 @@ export class Unit extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.server.Unit"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Unit { return new Unit().fromBinary(bytes, options); @@ -44,10 +38,7 @@ export class Unit extends Message { return new Unit().fromJsonString(jsonString, options); } - static equals( - a: Unit | PlainMessage | undefined, - b: Unit | PlainMessage | undefined, - ): boolean { + static equals(a: Unit | PlainMessage | undefined, b: Unit | PlainMessage | undefined): boolean { return proto3.util.equals(Unit, a, b); } } @@ -63,7 +54,8 @@ export class Pong extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.server.Pong"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Pong { return new Pong().fromBinary(bytes, options); @@ -77,10 +69,7 @@ export class Pong extends Message { return new Pong().fromJsonString(jsonString, options); } - static equals( - a: Pong | PlainMessage | undefined, - b: Pong | PlainMessage | undefined, - ): boolean { + static equals(a: Pong | PlainMessage | undefined, b: Pong | PlainMessage | undefined): boolean { return proto3.util.equals(Pong, a, b); } } @@ -117,10 +106,7 @@ export class ClientList extends Message { return new ClientList().fromJsonString(jsonString, options); } - static equals( - a: ClientList | PlainMessage | undefined, - b: ClientList | PlainMessage | undefined, - ): boolean { + static equals(a: ClientList | PlainMessage | undefined, b: ClientList | PlainMessage | undefined): boolean { return proto3.util.equals(ClientList, a, b); } } @@ -157,10 +143,7 @@ export class StoreList extends Message { return new StoreList().fromJsonString(jsonString, options); } - static equals( - a: StoreList | PlainMessage | undefined, - b: StoreList | PlainMessage | undefined, - ): boolean { + static equals(a: StoreList | PlainMessage | undefined, b: StoreList | PlainMessage | undefined): boolean { return proto3.util.equals(StoreList, a, b); } } @@ -197,10 +180,7 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals( - a: InfoServer | PlainMessage | undefined, - b: InfoServer | PlainMessage | undefined, - ): boolean { + static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -237,10 +217,7 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals( - a: Set | PlainMessage | undefined, - b: Set | PlainMessage | undefined, - ): boolean { + static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { return proto3.util.equals(Set, a, b); } } @@ -283,10 +260,7 @@ export class GetEntry extends Message { return new GetEntry().fromJsonString(jsonString, options); } - static equals( - a: GetEntry | PlainMessage | undefined, - b: GetEntry | PlainMessage | undefined, - ): boolean { + static equals(a: GetEntry | PlainMessage | undefined, b: GetEntry | PlainMessage | undefined): boolean { return proto3.util.equals(GetEntry, a, b); } } @@ -323,10 +297,7 @@ export class Get extends Message { return new Get().fromJsonString(jsonString, options); } - static equals( - a: Get | PlainMessage | undefined, - b: Get | PlainMessage | undefined, - ): boolean { + static equals(a: Get | PlainMessage | undefined, b: Get | PlainMessage | undefined): boolean { return proto3.util.equals(Get, a, b); } } @@ -375,10 +346,7 @@ export class GetSimNEntry extends Message { return new GetSimNEntry().fromJsonString(jsonString, options); } - static equals( - a: GetSimNEntry | PlainMessage | undefined, - b: GetSimNEntry | PlainMessage | undefined, - ): boolean { + static equals(a: GetSimNEntry | PlainMessage | undefined, b: GetSimNEntry | PlainMessage | undefined): boolean { return proto3.util.equals(GetSimNEntry, a, b); } } @@ -415,10 +383,7 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals( - a: GetSimN | PlainMessage | undefined, - b: GetSimN | PlainMessage | undefined, - ): boolean { + static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -455,10 +420,7 @@ export class Del extends Message { return new Del().fromJsonString(jsonString, options); } - static equals( - a: Del | PlainMessage | undefined, - b: Del | PlainMessage | undefined, - ): boolean { + static equals(a: Del | PlainMessage | undefined, b: Del | PlainMessage | undefined): boolean { return proto3.util.equals(Del, a, b); } } @@ -495,10 +457,7 @@ export class CreateIndex extends Message { return new CreateIndex().fromJsonString(jsonString, options); } - static equals( - a: CreateIndex | PlainMessage | undefined, - b: CreateIndex | PlainMessage | undefined, - ): boolean { + static equals(a: CreateIndex | PlainMessage | undefined, b: CreateIndex | PlainMessage | undefined): boolean { return proto3.util.equals(CreateIndex, a, b); } } @@ -554,13 +513,7 @@ export class AIStoreInfo extends Message { { no: 2, name: "query_model", kind: "enum", T: proto3.getEnumType(AIModel) }, { no: 3, name: "index_model", kind: "enum", T: proto3.getEnumType(AIModel) }, { no: 4, name: "embedding_size", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { - no: 5, - name: "predicate_indices", - kind: "scalar", - T: 9 /* ScalarType.STRING */, - repeated: true, - }, + { no: 5, name: "predicate_indices", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 6, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 7, name: "db_info", kind: "message", T: StoreInfo, opt: true }, ]); @@ -577,10 +530,7 @@ export class AIStoreInfo extends Message { return new AIStoreInfo().fromJsonString(jsonString, options); } - static equals( - a: AIStoreInfo | PlainMessage | undefined, - b: AIStoreInfo | PlainMessage | undefined, - ): boolean { + static equals(a: AIStoreInfo | PlainMessage | undefined, b: AIStoreInfo | PlainMessage | undefined): boolean { return proto3.util.equals(AIStoreInfo, a, b); } } @@ -611,10 +561,7 @@ export class EmbeddingWithMetadata extends Message { { no: 2, name: "metadata", kind: "message", T: StoreValue, opt: true }, ]); - static fromBinary( - bytes: Uint8Array, - options?: Partial, - ): EmbeddingWithMetadata { + static fromBinary(bytes: Uint8Array, options?: Partial): EmbeddingWithMetadata { return new EmbeddingWithMetadata().fromBinary(bytes, options); } @@ -622,17 +569,11 @@ export class EmbeddingWithMetadata extends Message { return new EmbeddingWithMetadata().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): EmbeddingWithMetadata { + static fromJsonString(jsonString: string, options?: Partial): EmbeddingWithMetadata { return new EmbeddingWithMetadata().fromJsonString(jsonString, options); } - static equals( - a: EmbeddingWithMetadata | PlainMessage | undefined, - b: EmbeddingWithMetadata | PlainMessage | undefined, - ): boolean { + static equals(a: EmbeddingWithMetadata | PlainMessage | undefined, b: EmbeddingWithMetadata | PlainMessage | undefined): boolean { return proto3.util.equals(EmbeddingWithMetadata, a, b); } } @@ -669,10 +610,7 @@ export class MultipleEmbedding extends Message { return new MultipleEmbedding().fromJsonString(jsonString, options); } - static equals( - a: MultipleEmbedding | PlainMessage | undefined, - b: MultipleEmbedding | PlainMessage | undefined, - ): boolean { + static equals(a: MultipleEmbedding | PlainMessage | undefined, b: MultipleEmbedding | PlainMessage | undefined): boolean { return proto3.util.equals(MultipleEmbedding, a, b); } } @@ -689,22 +627,19 @@ export class SingleInputToEmbedding extends Message { /** * @generated from oneof ai.server.SingleInputToEmbedding.variant */ - variant: - | { - /** - * @generated from field: ai.server.MultipleEmbedding multiple = 2; - */ - value: MultipleEmbedding; - case: "multiple"; - } - | { - /** - * @generated from field: ai.server.EmbeddingWithMetadata single = 3; - */ - value: EmbeddingWithMetadata; - case: "single"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + variant: { + /** + * @generated from field: ai.server.MultipleEmbedding multiple = 2; + */ + value: MultipleEmbedding; + case: "multiple"; + } | { + /** + * @generated from field: ai.server.EmbeddingWithMetadata single = 3; + */ + value: EmbeddingWithMetadata; + case: "single"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -719,31 +654,19 @@ export class SingleInputToEmbedding extends Message { { no: 3, name: "single", kind: "message", T: EmbeddingWithMetadata, oneof: "variant" }, ]); - static fromBinary( - bytes: Uint8Array, - options?: Partial, - ): SingleInputToEmbedding { + static fromBinary(bytes: Uint8Array, options?: Partial): SingleInputToEmbedding { return new SingleInputToEmbedding().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): SingleInputToEmbedding { + static fromJson(jsonValue: JsonValue, options?: Partial): SingleInputToEmbedding { return new SingleInputToEmbedding().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): SingleInputToEmbedding { + static fromJsonString(jsonString: string, options?: Partial): SingleInputToEmbedding { return new SingleInputToEmbedding().fromJsonString(jsonString, options); } - static equals( - a: SingleInputToEmbedding | PlainMessage | undefined, - b: SingleInputToEmbedding | PlainMessage | undefined, - ): boolean { + static equals(a: SingleInputToEmbedding | PlainMessage | undefined, b: SingleInputToEmbedding | PlainMessage | undefined): boolean { return proto3.util.equals(SingleInputToEmbedding, a, b); } } @@ -768,31 +691,20 @@ export class StoreInputToEmbeddingsList extends Message, - ): StoreInputToEmbeddingsList { + static fromBinary(bytes: Uint8Array, options?: Partial): StoreInputToEmbeddingsList { return new StoreInputToEmbeddingsList().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): StoreInputToEmbeddingsList { + static fromJson(jsonValue: JsonValue, options?: Partial): StoreInputToEmbeddingsList { return new StoreInputToEmbeddingsList().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): StoreInputToEmbeddingsList { + static fromJsonString(jsonString: string, options?: Partial): StoreInputToEmbeddingsList { return new StoreInputToEmbeddingsList().fromJsonString(jsonString, options); } - static equals( - a: StoreInputToEmbeddingsList | PlainMessage | undefined, - b: StoreInputToEmbeddingsList | PlainMessage | undefined, - ): boolean { + static equals(a: StoreInputToEmbeddingsList | PlainMessage | undefined, b: StoreInputToEmbeddingsList | PlainMessage | undefined): boolean { return proto3.util.equals(StoreInputToEmbeddingsList, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts b/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts index f750689e6..329010f94 100644 --- a/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts +++ b/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts @@ -68,3 +68,4 @@ proto3.util.setEnumType(DistanceMetric, "algorithm.algorithms.DistanceMetric", [ { no: 1, name: "DotProduct" }, { no: 2, name: "Cosine" }, ]); + diff --git a/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts b/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts index 6f772961f..6092e12f7 100644 --- a/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts +++ b/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import { DistanceMetric } from "./algorithm_pb.js"; @@ -78,28 +71,10 @@ export class HNSWConfig extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "distance", kind: "enum", T: proto3.getEnumType(DistanceMetric), opt: true }, { no: 2, name: "ef_construction", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { - no: 3, - name: "maximum_connections", - kind: "scalar", - T: 13 /* ScalarType.UINT32 */, - opt: true, - }, - { - no: 4, - name: "maximum_connections_zero", - kind: "scalar", - T: 13 /* ScalarType.UINT32 */, - opt: true, - }, + { no: 3, name: "maximum_connections", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + { no: 4, name: "maximum_connections_zero", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, { no: 5, name: "extend_candidates", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { - no: 6, - name: "keep_pruned_connections", - kind: "scalar", - T: 8 /* ScalarType.BOOL */, - opt: true, - }, + { no: 6, name: "keep_pruned_connections", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): HNSWConfig { @@ -114,10 +89,7 @@ export class HNSWConfig extends Message { return new HNSWConfig().fromJsonString(jsonString, options); } - static equals( - a: HNSWConfig | PlainMessage | undefined, - b: HNSWConfig | PlainMessage | undefined, - ): boolean { + static equals(a: HNSWConfig | PlainMessage | undefined, b: HNSWConfig | PlainMessage | undefined): boolean { return proto3.util.equals(HNSWConfig, a, b); } } @@ -133,7 +105,8 @@ export class KDTreeConfig extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "algorithm.nonlinear.KDTreeConfig"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): KDTreeConfig { return new KDTreeConfig().fromBinary(bytes, options); @@ -147,10 +120,7 @@ export class KDTreeConfig extends Message { return new KDTreeConfig().fromJsonString(jsonString, options); } - static equals( - a: KDTreeConfig | PlainMessage | undefined, - b: KDTreeConfig | PlainMessage | undefined, - ): boolean { + static equals(a: KDTreeConfig | PlainMessage | undefined, b: KDTreeConfig | PlainMessage | undefined): boolean { return proto3.util.equals(KDTreeConfig, a, b); } } @@ -162,22 +132,19 @@ export class NonLinearIndex extends Message { /** * @generated from oneof algorithm.nonlinear.NonLinearIndex.index */ - index: - | { - /** - * @generated from field: algorithm.nonlinear.HNSWConfig hnsw = 1; - */ - value: HNSWConfig; - case: "hnsw"; - } - | { - /** - * @generated from field: algorithm.nonlinear.KDTreeConfig kdtree = 2; - */ - value: KDTreeConfig; - case: "kdtree"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + index: { + /** + * @generated from field: algorithm.nonlinear.HNSWConfig hnsw = 1; + */ + value: HNSWConfig; + case: "hnsw"; + } | { + /** + * @generated from field: algorithm.nonlinear.KDTreeConfig kdtree = 2; + */ + value: KDTreeConfig; + case: "kdtree"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -203,10 +170,8 @@ export class NonLinearIndex extends Message { return new NonLinearIndex().fromJsonString(jsonString, options); } - static equals( - a: NonLinearIndex | PlainMessage | undefined, - b: NonLinearIndex | PlainMessage | undefined, - ): boolean { + static equals(a: NonLinearIndex | PlainMessage | undefined, b: NonLinearIndex | PlainMessage | undefined): boolean { return proto3.util.equals(NonLinearIndex, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/client_pb.ts b/sdk/ahnlich-client-node/grpc/client_pb.ts index f9e655ab9..2743f9a0d 100644 --- a/sdk/ahnlich-client-node/grpc/client_pb.ts +++ b/sdk/ahnlich-client-node/grpc/client_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -51,10 +44,8 @@ export class ConnectedClient extends Message { return new ConnectedClient().fromJsonString(jsonString, options); } - static equals( - a: ConnectedClient | PlainMessage | undefined, - b: ConnectedClient | PlainMessage | undefined, - ): boolean { + static equals(a: ConnectedClient | PlainMessage | undefined, b: ConnectedClient | PlainMessage | undefined): boolean { return proto3.util.equals(ConnectedClient, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts b/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts index 77685eee3..78f6a94cc 100644 --- a/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts @@ -3,48 +3,10 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { - CreateNonLinearAlgorithmIndex, - CreatePredIndex, - CreateStore, - DelKey, - DelPred, - DropNonLinearAlgorithmIndex, - DropPredIndex, - DropStore, - GetKey, - GetPred, - GetSimN, - GetStore, - InfoServer, - ListClients, - ListStores, - Ping, - Set, -} from "./query_pb.js"; -import { ClusterInfoQuery, ClusterInfoResponse } from "../shared/cluster_pb.js"; -import { - ClientList, - CreateIndex, - Del, - Get, - GetSimN as GetSimN$1, - InfoServer as InfoServer$1, - Pong, - Set as Set$1, - StoreInfo, - StoreList, - Unit, -} from "./server_pb.js"; +import { CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, Set } from "./query_pb.js"; +import { ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInfo, StoreList, Unit } from "./server_pb.js"; import { ErrorResponse } from "../shared/info_pb.js"; /** @@ -54,134 +16,115 @@ export class DBQuery extends Message { /** * @generated from oneof db.pipeline.DBQuery.query */ - query: - | { - /** - * @generated from field: db.query.CreateStore create_store = 1; - */ - value: CreateStore; - case: "createStore"; - } - | { - /** - * @generated from field: db.query.GetKey get_key = 2; - */ - value: GetKey; - case: "getKey"; - } - | { - /** - * @generated from field: db.query.GetPred get_pred = 3; - */ - value: GetPred; - case: "getPred"; - } - | { - /** - * @generated from field: db.query.GetSimN get_sim_n = 4; - */ - value: GetSimN; - case: "getSimN"; - } - | { - /** - * @generated from field: db.query.CreatePredIndex create_pred_index = 5; - */ - value: CreatePredIndex; - case: "createPredIndex"; - } - | { - /** - * @generated from field: db.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 6; - */ - value: CreateNonLinearAlgorithmIndex; - case: "createNonLinearAlgorithmIndex"; - } - | { - /** - * @generated from field: db.query.DropPredIndex drop_pred_index = 7; - */ - value: DropPredIndex; - case: "dropPredIndex"; - } - | { - /** - * @generated from field: db.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 8; - */ - value: DropNonLinearAlgorithmIndex; - case: "dropNonLinearAlgorithmIndex"; - } - | { - /** - * @generated from field: db.query.Set set = 9; - */ - value: Set; - case: "set"; - } - | { - /** - * @generated from field: db.query.DelKey del_key = 10; - */ - value: DelKey; - case: "delKey"; - } - | { - /** - * @generated from field: db.query.DelPred del_pred = 11; - */ - value: DelPred; - case: "delPred"; - } - | { - /** - * @generated from field: db.query.DropStore drop_store = 12; - */ - value: DropStore; - case: "dropStore"; - } - | { - /** - * @generated from field: db.query.InfoServer info_server = 13; - */ - value: InfoServer; - case: "infoServer"; - } - | { - /** - * @generated from field: db.query.ListStores list_stores = 14; - */ - value: ListStores; - case: "listStores"; - } - | { - /** - * @generated from field: db.query.ListClients list_clients = 15; - */ - value: ListClients; - case: "listClients"; - } - | { - /** - * @generated from field: db.query.Ping ping = 16; - */ - value: Ping; - case: "ping"; - } - | { - /** - * @generated from field: db.query.GetStore get_store = 17; - */ - value: GetStore; - case: "getStore"; - } - | { - /** - * @generated from field: shared.cluster.ClusterInfoQuery cluster_info = 18; - */ - value: ClusterInfoQuery; - case: "clusterInfo"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + query: { + /** + * @generated from field: db.query.CreateStore create_store = 1; + */ + value: CreateStore; + case: "createStore"; + } | { + /** + * @generated from field: db.query.GetKey get_key = 2; + */ + value: GetKey; + case: "getKey"; + } | { + /** + * @generated from field: db.query.GetPred get_pred = 3; + */ + value: GetPred; + case: "getPred"; + } | { + /** + * @generated from field: db.query.GetSimN get_sim_n = 4; + */ + value: GetSimN; + case: "getSimN"; + } | { + /** + * @generated from field: db.query.CreatePredIndex create_pred_index = 5; + */ + value: CreatePredIndex; + case: "createPredIndex"; + } | { + /** + * @generated from field: db.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 6; + */ + value: CreateNonLinearAlgorithmIndex; + case: "createNonLinearAlgorithmIndex"; + } | { + /** + * @generated from field: db.query.DropPredIndex drop_pred_index = 7; + */ + value: DropPredIndex; + case: "dropPredIndex"; + } | { + /** + * @generated from field: db.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 8; + */ + value: DropNonLinearAlgorithmIndex; + case: "dropNonLinearAlgorithmIndex"; + } | { + /** + * @generated from field: db.query.Set set = 9; + */ + value: Set; + case: "set"; + } | { + /** + * @generated from field: db.query.DelKey del_key = 10; + */ + value: DelKey; + case: "delKey"; + } | { + /** + * @generated from field: db.query.DelPred del_pred = 11; + */ + value: DelPred; + case: "delPred"; + } | { + /** + * @generated from field: db.query.DropStore drop_store = 12; + */ + value: DropStore; + case: "dropStore"; + } | { + /** + * @generated from field: db.query.InfoServer info_server = 13; + */ + value: InfoServer; + case: "infoServer"; + } | { + /** + * @generated from field: db.query.ListStores list_stores = 14; + */ + value: ListStores; + case: "listStores"; + } | { + /** + * @generated from field: db.query.ListClients list_clients = 15; + */ + value: ListClients; + case: "listClients"; + } | { + /** + * @generated from field: db.query.Ping ping = 16; + */ + value: Ping; + case: "ping"; + } | { + /** + * @generated from field: db.query.GetStore get_store = 17; + */ + value: GetStore; + case: "getStore"; + } | { + /** + * @generated from field: db.query.DropSchema drop_schema = 18; + */ + value: DropSchema; + case: "dropSchema"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -196,21 +139,9 @@ export class DBQuery extends Message { { no: 3, name: "get_pred", kind: "message", T: GetPred, oneof: "query" }, { no: 4, name: "get_sim_n", kind: "message", T: GetSimN, oneof: "query" }, { no: 5, name: "create_pred_index", kind: "message", T: CreatePredIndex, oneof: "query" }, - { - no: 6, - name: "create_non_linear_algorithm_index", - kind: "message", - T: CreateNonLinearAlgorithmIndex, - oneof: "query", - }, + { no: 6, name: "create_non_linear_algorithm_index", kind: "message", T: CreateNonLinearAlgorithmIndex, oneof: "query" }, { no: 7, name: "drop_pred_index", kind: "message", T: DropPredIndex, oneof: "query" }, - { - no: 8, - name: "drop_non_linear_algorithm_index", - kind: "message", - T: DropNonLinearAlgorithmIndex, - oneof: "query", - }, + { no: 8, name: "drop_non_linear_algorithm_index", kind: "message", T: DropNonLinearAlgorithmIndex, oneof: "query" }, { no: 9, name: "set", kind: "message", T: Set, oneof: "query" }, { no: 10, name: "del_key", kind: "message", T: DelKey, oneof: "query" }, { no: 11, name: "del_pred", kind: "message", T: DelPred, oneof: "query" }, @@ -220,7 +151,7 @@ export class DBQuery extends Message { { no: 15, name: "list_clients", kind: "message", T: ListClients, oneof: "query" }, { no: 16, name: "ping", kind: "message", T: Ping, oneof: "query" }, { no: 17, name: "get_store", kind: "message", T: GetStore, oneof: "query" }, - { no: 18, name: "cluster_info", kind: "message", T: ClusterInfoQuery, oneof: "query" }, + { no: 18, name: "drop_schema", kind: "message", T: DropSchema, oneof: "query" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DBQuery { @@ -235,10 +166,7 @@ export class DBQuery extends Message { return new DBQuery().fromJsonString(jsonString, options); } - static equals( - a: DBQuery | PlainMessage | undefined, - b: DBQuery | PlainMessage | undefined, - ): boolean { + static equals(a: DBQuery | PlainMessage | undefined, b: DBQuery | PlainMessage | undefined): boolean { return proto3.util.equals(DBQuery, a, b); } } @@ -275,10 +203,7 @@ export class DBRequestPipeline extends Message { return new DBRequestPipeline().fromJsonString(jsonString, options); } - static equals( - a: DBRequestPipeline | PlainMessage | undefined, - b: DBRequestPipeline | PlainMessage | undefined, - ): boolean { + static equals(a: DBRequestPipeline | PlainMessage | undefined, b: DBRequestPipeline | PlainMessage | undefined): boolean { return proto3.util.equals(DBRequestPipeline, a, b); } } @@ -290,99 +215,79 @@ export class DBServerResponse extends Message { /** * @generated from oneof db.pipeline.DBServerResponse.response */ - response: - | { - /** - * @generated from field: db.server.Unit unit = 1; - */ - value: Unit; - case: "unit"; - } - | { - /** - * @generated from field: db.server.Pong pong = 2; - */ - value: Pong; - case: "pong"; - } - | { - /** - * @generated from field: db.server.ClientList client_list = 3; - */ - value: ClientList; - case: "clientList"; - } - | { - /** - * @generated from field: db.server.StoreList store_list = 4; - */ - value: StoreList; - case: "storeList"; - } - | { - /** - * @generated from field: db.server.InfoServer info_server = 5; - */ - value: InfoServer$1; - case: "infoServer"; - } - | { - /** - * @generated from field: db.server.Set set = 6; - */ - value: Set$1; - case: "set"; - } - | { - /** - * @generated from field: db.server.Get get = 7; - */ - value: Get; - case: "get"; - } - | { - /** - * @generated from field: db.server.GetSimN get_sim_n = 8; - */ - value: GetSimN$1; - case: "getSimN"; - } - | { - /** - * @generated from field: db.server.Del del = 9; - */ - value: Del; - case: "del"; - } - | { - /** - * @generated from field: db.server.CreateIndex create_index = 10; - */ - value: CreateIndex; - case: "createIndex"; - } - | { - /** - * @generated from field: shared.info.ErrorResponse error = 11; - */ - value: ErrorResponse; - case: "error"; - } - | { - /** - * @generated from field: db.server.StoreInfo store_info = 12; - */ - value: StoreInfo; - case: "storeInfo"; - } - | { - /** - * @generated from field: shared.cluster.ClusterInfoResponse cluster_info = 13; - */ - value: ClusterInfoResponse; - case: "clusterInfo"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + response: { + /** + * @generated from field: db.server.Unit unit = 1; + */ + value: Unit; + case: "unit"; + } | { + /** + * @generated from field: db.server.Pong pong = 2; + */ + value: Pong; + case: "pong"; + } | { + /** + * @generated from field: db.server.ClientList client_list = 3; + */ + value: ClientList; + case: "clientList"; + } | { + /** + * @generated from field: db.server.StoreList store_list = 4; + */ + value: StoreList; + case: "storeList"; + } | { + /** + * @generated from field: db.server.InfoServer info_server = 5; + */ + value: InfoServer$1; + case: "infoServer"; + } | { + /** + * @generated from field: db.server.Set set = 6; + */ + value: Set$1; + case: "set"; + } | { + /** + * @generated from field: db.server.Get get = 7; + */ + value: Get; + case: "get"; + } | { + /** + * @generated from field: db.server.GetSimN get_sim_n = 8; + */ + value: GetSimN$1; + case: "getSimN"; + } | { + /** + * @generated from field: db.server.Del del = 9; + */ + value: Del; + case: "del"; + } | { + /** + * @generated from field: db.server.CreateIndex create_index = 10; + */ + value: CreateIndex; + case: "createIndex"; + } | { + /** + * @generated from field: shared.info.ErrorResponse error = 11; + */ + value: ErrorResponse; + case: "error"; + } | { + /** + * @generated from field: db.server.StoreInfo store_info = 12; + */ + value: StoreInfo; + case: "storeInfo"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -404,7 +309,6 @@ export class DBServerResponse extends Message { { no: 10, name: "create_index", kind: "message", T: CreateIndex, oneof: "response" }, { no: 11, name: "error", kind: "message", T: ErrorResponse, oneof: "response" }, { no: 12, name: "store_info", kind: "message", T: StoreInfo, oneof: "response" }, - { no: 13, name: "cluster_info", kind: "message", T: ClusterInfoResponse, oneof: "response" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DBServerResponse { @@ -419,10 +323,7 @@ export class DBServerResponse extends Message { return new DBServerResponse().fromJsonString(jsonString, options); } - static equals( - a: DBServerResponse | PlainMessage | undefined, - b: DBServerResponse | PlainMessage | undefined, - ): boolean { + static equals(a: DBServerResponse | PlainMessage | undefined, b: DBServerResponse | PlainMessage | undefined): boolean { return proto3.util.equals(DBServerResponse, a, b); } } @@ -455,17 +356,12 @@ export class DBResponsePipeline extends Message { return new DBResponsePipeline().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): DBResponsePipeline { + static fromJsonString(jsonString: string, options?: Partial): DBResponsePipeline { return new DBResponsePipeline().fromJsonString(jsonString, options); } - static equals( - a: DBResponsePipeline | PlainMessage | undefined, - b: DBResponsePipeline | PlainMessage | undefined, - ): boolean { + static equals(a: DBResponsePipeline | PlainMessage | undefined, b: DBResponsePipeline | PlainMessage | undefined): boolean { return proto3.util.equals(DBResponsePipeline, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/db/query_pb.ts b/sdk/ahnlich-client-node/grpc/db/query_pb.ts index e996b0eba..d09502dd9 100644 --- a/sdk/ahnlich-client-node/grpc/db/query_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/query_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { NonLinearAlgorithm, NonLinearIndex } from "../algorithm/nonlinear_pb.js"; import { DbStoreEntry, StoreKey } from "../keyval_pb.js"; @@ -59,6 +52,13 @@ export class CreateStore extends Message { */ errorIfExists = false; + /** + * Optional schema/namespace for the store. Defaults to "public". + * + * @generated from field: optional string schema = 6; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -69,15 +69,10 @@ export class CreateStore extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { - no: 3, - name: "create_predicates", - kind: "scalar", - T: 9 /* ScalarType.STRING */, - repeated: true, - }, + { no: 3, name: "create_predicates", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 4, name: "non_linear_indices", kind: "message", T: NonLinearIndex, repeated: true }, { no: 5, name: "error_if_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateStore { @@ -92,10 +87,7 @@ export class CreateStore extends Message { return new CreateStore().fromJsonString(jsonString, options); } - static equals( - a: CreateStore | PlainMessage | undefined, - b: CreateStore | PlainMessage | undefined, - ): boolean { + static equals(a: CreateStore | PlainMessage | undefined, b: CreateStore | PlainMessage | undefined): boolean { return proto3.util.equals(CreateStore, a, b); } } @@ -144,10 +136,7 @@ export class GetKey extends Message { return new GetKey().fromJsonString(jsonString, options); } - static equals( - a: GetKey | PlainMessage | undefined, - b: GetKey | PlainMessage | undefined, - ): boolean { + static equals(a: GetKey | PlainMessage | undefined, b: GetKey | PlainMessage | undefined): boolean { return proto3.util.equals(GetKey, a, b); } } @@ -196,10 +185,7 @@ export class GetPred extends Message { return new GetPred().fromJsonString(jsonString, options); } - static equals( - a: GetPred | PlainMessage | undefined, - b: GetPred | PlainMessage | undefined, - ): boolean { + static equals(a: GetPred | PlainMessage | undefined, b: GetPred | PlainMessage | undefined): boolean { return proto3.util.equals(GetPred, a, b); } } @@ -274,10 +260,7 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals( - a: GetSimN | PlainMessage | undefined, - b: GetSimN | PlainMessage | undefined, - ): boolean { + static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -327,10 +310,7 @@ export class CreatePredIndex extends Message { return new CreatePredIndex().fromJsonString(jsonString, options); } - static equals( - a: CreatePredIndex | PlainMessage | undefined, - b: CreatePredIndex | PlainMessage | undefined, - ): boolean { + static equals(a: CreatePredIndex | PlainMessage | undefined, b: CreatePredIndex | PlainMessage | undefined): boolean { return proto3.util.equals(CreatePredIndex, a, b); } } @@ -368,31 +348,19 @@ export class CreateNonLinearAlgorithmIndex extends Message, - ): CreateNonLinearAlgorithmIndex { + static fromBinary(bytes: Uint8Array, options?: Partial): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): CreateNonLinearAlgorithmIndex { + static fromJson(jsonValue: JsonValue, options?: Partial): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): CreateNonLinearAlgorithmIndex { + static fromJsonString(jsonString: string, options?: Partial): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals( - a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, - b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, - ): boolean { + static equals(a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { return proto3.util.equals(CreateNonLinearAlgorithmIndex, a, b); } } @@ -450,10 +418,7 @@ export class DropPredIndex extends Message { return new DropPredIndex().fromJsonString(jsonString, options); } - static equals( - a: DropPredIndex | PlainMessage | undefined, - b: DropPredIndex | PlainMessage | undefined, - ): boolean { + static equals(a: DropPredIndex | PlainMessage | undefined, b: DropPredIndex | PlainMessage | undefined): boolean { return proto3.util.equals(DropPredIndex, a, b); } } @@ -495,41 +460,23 @@ export class DropNonLinearAlgorithmIndex extends Message [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { - no: 2, - name: "non_linear_indices", - kind: "enum", - T: proto3.getEnumType(NonLinearAlgorithm), - repeated: true, - }, + { no: 2, name: "non_linear_indices", kind: "enum", T: proto3.getEnumType(NonLinearAlgorithm), repeated: true }, { no: 3, name: "error_if_not_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); - static fromBinary( - bytes: Uint8Array, - options?: Partial, - ): DropNonLinearAlgorithmIndex { + static fromBinary(bytes: Uint8Array, options?: Partial): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson( - jsonValue: JsonValue, - options?: Partial, - ): DropNonLinearAlgorithmIndex { + static fromJson(jsonValue: JsonValue, options?: Partial): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): DropNonLinearAlgorithmIndex { + static fromJsonString(jsonString: string, options?: Partial): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals( - a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, - b: DropNonLinearAlgorithmIndex | PlainMessage | undefined, - ): boolean { + static equals(a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, b: DropNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { return proto3.util.equals(DropNonLinearAlgorithmIndex, a, b); } } @@ -579,10 +526,7 @@ export class DelKey extends Message { return new DelKey().fromJsonString(jsonString, options); } - static equals( - a: DelKey | PlainMessage | undefined, - b: DelKey | PlainMessage | undefined, - ): boolean { + static equals(a: DelKey | PlainMessage | undefined, b: DelKey | PlainMessage | undefined): boolean { return proto3.util.equals(DelKey, a, b); } } @@ -632,10 +576,7 @@ export class DelPred extends Message { return new DelPred().fromJsonString(jsonString, options); } - static equals( - a: DelPred | PlainMessage | undefined, - b: DelPred | PlainMessage | undefined, - ): boolean { + static equals(a: DelPred | PlainMessage | undefined, b: DelPred | PlainMessage | undefined): boolean { return proto3.util.equals(DelPred, a, b); } } @@ -661,6 +602,13 @@ export class DropStore extends Message { */ errorIfNotExists = false; + /** + * Optional schema/namespace for the store. Defaults to "public". + * + * @generated from field: optional string schema = 3; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -671,6 +619,7 @@ export class DropStore extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "error_if_not_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DropStore { @@ -685,10 +634,7 @@ export class DropStore extends Message { return new DropStore().fromJsonString(jsonString, options); } - static equals( - a: DropStore | PlainMessage | undefined, - b: DropStore | PlainMessage | undefined, - ): boolean { + static equals(a: DropStore | PlainMessage | undefined, b: DropStore | PlainMessage | undefined): boolean { return proto3.util.equals(DropStore, a, b); } } @@ -706,7 +652,8 @@ export class InfoServer extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.InfoServer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): InfoServer { return new InfoServer().fromBinary(bytes, options); @@ -720,10 +667,7 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals( - a: InfoServer | PlainMessage | undefined, - b: InfoServer | PlainMessage | undefined, - ): boolean { + static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -734,6 +678,13 @@ export class InfoServer extends Message { * @generated from message db.query.ListStores */ export class ListStores extends Message { + /** + * Optional schema/namespace to filter stores. If unset, lists all schemas. + * + * @generated from field: optional string schema = 1; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -741,7 +692,9 @@ export class ListStores extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.ListStores"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListStores { return new ListStores().fromBinary(bytes, options); @@ -755,10 +708,7 @@ export class ListStores extends Message { return new ListStores().fromJsonString(jsonString, options); } - static equals( - a: ListStores | PlainMessage | undefined, - b: ListStores | PlainMessage | undefined, - ): boolean { + static equals(a: ListStores | PlainMessage | undefined, b: ListStores | PlainMessage | undefined): boolean { return proto3.util.equals(ListStores, a, b); } } @@ -776,7 +726,8 @@ export class ListClients extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.ListClients"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListClients { return new ListClients().fromBinary(bytes, options); @@ -790,10 +741,7 @@ export class ListClients extends Message { return new ListClients().fromJsonString(jsonString, options); } - static equals( - a: ListClients | PlainMessage | undefined, - b: ListClients | PlainMessage | undefined, - ): boolean { + static equals(a: ListClients | PlainMessage | undefined, b: ListClients | PlainMessage | undefined): boolean { return proto3.util.equals(ListClients, a, b); } } @@ -811,7 +759,8 @@ export class Ping extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.Ping"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Ping { return new Ping().fromBinary(bytes, options); @@ -825,10 +774,7 @@ export class Ping extends Message { return new Ping().fromJsonString(jsonString, options); } - static equals( - a: Ping | PlainMessage | undefined, - b: Ping | PlainMessage | undefined, - ): boolean { + static equals(a: Ping | PlainMessage | undefined, b: Ping | PlainMessage | undefined): boolean { return proto3.util.equals(Ping, a, b); } } @@ -846,6 +792,13 @@ export class GetStore extends Message { */ store = ""; + /** + * Optional schema/namespace for the store. Defaults to "public". + * + * @generated from field: optional string schema = 2; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -855,6 +808,7 @@ export class GetStore extends Message { static readonly typeName = "db.query.GetStore"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetStore { @@ -869,14 +823,53 @@ export class GetStore extends Message { return new GetStore().fromJsonString(jsonString, options); } - static equals( - a: GetStore | PlainMessage | undefined, - b: GetStore | PlainMessage | undefined, - ): boolean { + static equals(a: GetStore | PlainMessage | undefined, b: GetStore | PlainMessage | undefined): boolean { return proto3.util.equals(GetStore, a, b); } } +/** + * Drops an entire schema and all stores within it. + * Cannot drop the "public" default schema. + * + * @generated from message db.query.DropSchema + */ +export class DropSchema extends Message { + /** + * The name of the schema to drop. + * + * @generated from field: string schema = 1; + */ + schema = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "db.query.DropSchema"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DropSchema { + return new DropSchema().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DropSchema { + return new DropSchema().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DropSchema { + return new DropSchema().fromJsonString(jsonString, options); + } + + static equals(a: DropSchema | PlainMessage | undefined, b: DropSchema | PlainMessage | undefined): boolean { + return proto3.util.equals(DropSchema, a, b); + } +} + /** * A request to set multiple key-value entries in the store. * Validation is done for each vector before updating the store. @@ -922,10 +915,8 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals( - a: Set | PlainMessage | undefined, - b: Set | PlainMessage | undefined, - ): boolean { + static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { return proto3.util.equals(Set, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/db/server_pb.ts b/sdk/ahnlich-client-node/grpc/db/server_pb.ts index a7200e94b..caff23318 100644 --- a/sdk/ahnlich-client-node/grpc/db/server_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/server_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ConnectedClient } from "../client_pb.js"; import { ServerInfo, StoreUpsert } from "../shared/info_pb.js"; @@ -29,7 +22,8 @@ export class Unit extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.server.Unit"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Unit { return new Unit().fromBinary(bytes, options); @@ -43,10 +37,7 @@ export class Unit extends Message { return new Unit().fromJsonString(jsonString, options); } - static equals( - a: Unit | PlainMessage | undefined, - b: Unit | PlainMessage | undefined, - ): boolean { + static equals(a: Unit | PlainMessage | undefined, b: Unit | PlainMessage | undefined): boolean { return proto3.util.equals(Unit, a, b); } } @@ -62,7 +53,8 @@ export class Pong extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.server.Pong"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): Pong { return new Pong().fromBinary(bytes, options); @@ -76,10 +68,7 @@ export class Pong extends Message { return new Pong().fromJsonString(jsonString, options); } - static equals( - a: Pong | PlainMessage | undefined, - b: Pong | PlainMessage | undefined, - ): boolean { + static equals(a: Pong | PlainMessage | undefined, b: Pong | PlainMessage | undefined): boolean { return proto3.util.equals(Pong, a, b); } } @@ -116,10 +105,7 @@ export class ClientList extends Message { return new ClientList().fromJsonString(jsonString, options); } - static equals( - a: ClientList | PlainMessage | undefined, - b: ClientList | PlainMessage | undefined, - ): boolean { + static equals(a: ClientList | PlainMessage | undefined, b: ClientList | PlainMessage | undefined): boolean { return proto3.util.equals(ClientList, a, b); } } @@ -156,10 +142,7 @@ export class StoreList extends Message { return new StoreList().fromJsonString(jsonString, options); } - static equals( - a: StoreList | PlainMessage | undefined, - b: StoreList | PlainMessage | undefined, - ): boolean { + static equals(a: StoreList | PlainMessage | undefined, b: StoreList | PlainMessage | undefined): boolean { return proto3.util.equals(StoreList, a, b); } } @@ -196,10 +179,7 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals( - a: InfoServer | PlainMessage | undefined, - b: InfoServer | PlainMessage | undefined, - ): boolean { + static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -236,10 +216,7 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals( - a: Set | PlainMessage | undefined, - b: Set | PlainMessage | undefined, - ): boolean { + static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { return proto3.util.equals(Set, a, b); } } @@ -276,10 +253,7 @@ export class Get extends Message { return new Get().fromJsonString(jsonString, options); } - static equals( - a: Get | PlainMessage | undefined, - b: Get | PlainMessage | undefined, - ): boolean { + static equals(a: Get | PlainMessage | undefined, b: Get | PlainMessage | undefined): boolean { return proto3.util.equals(Get, a, b); } } @@ -328,10 +302,7 @@ export class GetSimNEntry extends Message { return new GetSimNEntry().fromJsonString(jsonString, options); } - static equals( - a: GetSimNEntry | PlainMessage | undefined, - b: GetSimNEntry | PlainMessage | undefined, - ): boolean { + static equals(a: GetSimNEntry | PlainMessage | undefined, b: GetSimNEntry | PlainMessage | undefined): boolean { return proto3.util.equals(GetSimNEntry, a, b); } } @@ -368,10 +339,7 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals( - a: GetSimN | PlainMessage | undefined, - b: GetSimN | PlainMessage | undefined, - ): boolean { + static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -408,10 +376,7 @@ export class Del extends Message { return new Del().fromJsonString(jsonString, options); } - static equals( - a: Del | PlainMessage | undefined, - b: Del | PlainMessage | undefined, - ): boolean { + static equals(a: Del | PlainMessage | undefined, b: Del | PlainMessage | undefined): boolean { return proto3.util.equals(Del, a, b); } } @@ -448,10 +413,7 @@ export class CreateIndex extends Message { return new CreateIndex().fromJsonString(jsonString, options); } - static equals( - a: CreateIndex | PlainMessage | undefined, - b: CreateIndex | PlainMessage | undefined, - ): boolean { + static equals(a: CreateIndex | PlainMessage | undefined, b: CreateIndex | PlainMessage | undefined): boolean { return proto3.util.equals(CreateIndex, a, b); } } @@ -463,85 +425,73 @@ export class ServerResponse extends Message { /** * @generated from oneof db.server.ServerResponse.response */ - response: - | { - /** - * @generated from field: db.server.Unit unit = 1; - */ - value: Unit; - case: "unit"; - } - | { - /** - * @generated from field: db.server.Pong pong = 2; - */ - value: Pong; - case: "pong"; - } - | { - /** - * @generated from field: db.server.ClientList client_list = 3; - */ - value: ClientList; - case: "clientList"; - } - | { - /** - * @generated from field: db.server.StoreList store_list = 4; - */ - value: StoreList; - case: "storeList"; - } - | { - /** - * @generated from field: db.server.InfoServer info_server = 5; - */ - value: InfoServer; - case: "infoServer"; - } - | { - /** - * @generated from field: db.server.Set set = 6; - */ - value: Set; - case: "set"; - } - | { - /** - * @generated from field: db.server.Get get = 7; - */ - value: Get; - case: "get"; - } - | { - /** - * @generated from field: db.server.GetSimN get_sim_n = 8; - */ - value: GetSimN; - case: "getSimN"; - } - | { - /** - * @generated from field: db.server.Del del = 9; - */ - value: Del; - case: "del"; - } - | { - /** - * @generated from field: db.server.CreateIndex create_index = 10; - */ - value: CreateIndex; - case: "createIndex"; - } - | { - /** - * @generated from field: db.server.StoreInfo store_info = 11; - */ - value: StoreInfo; - case: "storeInfo"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + response: { + /** + * @generated from field: db.server.Unit unit = 1; + */ + value: Unit; + case: "unit"; + } | { + /** + * @generated from field: db.server.Pong pong = 2; + */ + value: Pong; + case: "pong"; + } | { + /** + * @generated from field: db.server.ClientList client_list = 3; + */ + value: ClientList; + case: "clientList"; + } | { + /** + * @generated from field: db.server.StoreList store_list = 4; + */ + value: StoreList; + case: "storeList"; + } | { + /** + * @generated from field: db.server.InfoServer info_server = 5; + */ + value: InfoServer; + case: "infoServer"; + } | { + /** + * @generated from field: db.server.Set set = 6; + */ + value: Set; + case: "set"; + } | { + /** + * @generated from field: db.server.Get get = 7; + */ + value: Get; + case: "get"; + } | { + /** + * @generated from field: db.server.GetSimN get_sim_n = 8; + */ + value: GetSimN; + case: "getSimN"; + } | { + /** + * @generated from field: db.server.Del del = 9; + */ + value: Del; + case: "del"; + } | { + /** + * @generated from field: db.server.CreateIndex create_index = 10; + */ + value: CreateIndex; + case: "createIndex"; + } | { + /** + * @generated from field: db.server.StoreInfo store_info = 11; + */ + value: StoreInfo; + case: "storeInfo"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -576,10 +526,7 @@ export class ServerResponse extends Message { return new ServerResponse().fromJsonString(jsonString, options); } - static equals( - a: ServerResponse | PlainMessage | undefined, - b: ServerResponse | PlainMessage | undefined, - ): boolean { + static equals(a: ServerResponse | PlainMessage | undefined, b: ServerResponse | PlainMessage | undefined): boolean { return proto3.util.equals(ServerResponse, a, b); } } @@ -630,13 +577,7 @@ export class StoreInfo extends Message { { no: 2, name: "len", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "size_in_bytes", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 4, name: "non_linear_indices", kind: "message", T: NonLinearIndex, repeated: true }, - { - no: 5, - name: "predicate_indices", - kind: "scalar", - T: 9 /* ScalarType.STRING */, - repeated: true, - }, + { no: 5, name: "predicate_indices", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 6, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); @@ -652,10 +593,8 @@ export class StoreInfo extends Message { return new StoreInfo().fromJsonString(jsonString, options); } - static equals( - a: StoreInfo | PlainMessage | undefined, - b: StoreInfo | PlainMessage | undefined, - ): boolean { + static equals(a: StoreInfo | PlainMessage | undefined, b: StoreInfo | PlainMessage | undefined): boolean { return proto3.util.equals(StoreInfo, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/keyval_pb.ts b/sdk/ahnlich-client-node/grpc/keyval_pb.ts index 10e2b5dad..b3ba0b0f1 100644 --- a/sdk/ahnlich-client-node/grpc/keyval_pb.ts +++ b/sdk/ahnlich-client-node/grpc/keyval_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import { MetadataValue } from "./metadata_pb.js"; @@ -46,10 +39,7 @@ export class StoreName extends Message { return new StoreName().fromJsonString(jsonString, options); } - static equals( - a: StoreName | PlainMessage | undefined, - b: StoreName | PlainMessage | undefined, - ): boolean { + static equals(a: StoreName | PlainMessage | undefined, b: StoreName | PlainMessage | undefined): boolean { return proto3.util.equals(StoreName, a, b); } } @@ -86,10 +76,7 @@ export class StoreKey extends Message { return new StoreKey().fromJsonString(jsonString, options); } - static equals( - a: StoreKey | PlainMessage | undefined, - b: StoreKey | PlainMessage | undefined, - ): boolean { + static equals(a: StoreKey | PlainMessage | undefined, b: StoreKey | PlainMessage | undefined): boolean { return proto3.util.equals(StoreKey, a, b); } } @@ -101,29 +88,25 @@ export class StoreInput extends Message { /** * @generated from oneof keyval.StoreInput.value */ - value: - | { - /** - * @generated from field: string raw_string = 2; - */ - value: string; - case: "rawString"; - } - | { - /** - * @generated from field: bytes image = 3; - */ - value: Uint8Array; - case: "image"; - } - | { - /** - * @generated from field: bytes audio = 4; - */ - value: Uint8Array; - case: "audio"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + value: { + /** + * @generated from field: string raw_string = 2; + */ + value: string; + case: "rawString"; + } | { + /** + * @generated from field: bytes image = 3; + */ + value: Uint8Array; + case: "image"; + } | { + /** + * @generated from field: bytes audio = 4; + */ + value: Uint8Array; + case: "audio"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -150,10 +133,7 @@ export class StoreInput extends Message { return new StoreInput().fromJsonString(jsonString, options); } - static equals( - a: StoreInput | PlainMessage | undefined, - b: StoreInput | PlainMessage | undefined, - ): boolean { + static equals(a: StoreInput | PlainMessage | undefined, b: StoreInput | PlainMessage | undefined): boolean { return proto3.util.equals(StoreInput, a, b); } } @@ -198,10 +178,7 @@ export class DbStoreEntry extends Message { return new DbStoreEntry().fromJsonString(jsonString, options); } - static equals( - a: DbStoreEntry | PlainMessage | undefined, - b: DbStoreEntry | PlainMessage | undefined, - ): boolean { + static equals(a: DbStoreEntry | PlainMessage | undefined, b: DbStoreEntry | PlainMessage | undefined): boolean { return proto3.util.equals(DbStoreEntry, a, b); } } @@ -246,10 +223,7 @@ export class AiStoreEntry extends Message { return new AiStoreEntry().fromJsonString(jsonString, options); } - static equals( - a: AiStoreEntry | PlainMessage | undefined, - b: AiStoreEntry | PlainMessage | undefined, - ): boolean { + static equals(a: AiStoreEntry | PlainMessage | undefined, b: AiStoreEntry | PlainMessage | undefined): boolean { return proto3.util.equals(AiStoreEntry, a, b); } } @@ -271,13 +245,7 @@ export class StoreValue extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "keyval.StoreValue"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { - no: 1, - name: "value", - kind: "map", - K: 9 /* ScalarType.STRING */, - V: { kind: "message", T: MetadataValue }, - }, + { no: 1, name: "value", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: MetadataValue} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): StoreValue { @@ -292,10 +260,8 @@ export class StoreValue extends Message { return new StoreValue().fromJsonString(jsonString, options); } - static equals( - a: StoreValue | PlainMessage | undefined, - b: StoreValue | PlainMessage | undefined, - ): boolean { + static equals(a: StoreValue | PlainMessage | undefined, b: StoreValue | PlainMessage | undefined): boolean { return proto3.util.equals(StoreValue, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/metadata_pb.ts b/sdk/ahnlich-client-node/grpc/metadata_pb.ts index 10099ca54..12fa50c5f 100644 --- a/sdk/ahnlich-client-node/grpc/metadata_pb.ts +++ b/sdk/ahnlich-client-node/grpc/metadata_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -20,29 +13,25 @@ export class MetadataValue extends Message { /** * @generated from oneof metadata.MetadataValue.value */ - value: - | { - /** - * @generated from field: string raw_string = 2; - */ - value: string; - case: "rawString"; - } - | { - /** - * @generated from field: bytes image = 3; - */ - value: Uint8Array; - case: "image"; - } - | { - /** - * @generated from field: bytes audio = 4; - */ - value: Uint8Array; - case: "audio"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + value: { + /** + * @generated from field: string raw_string = 2; + */ + value: string; + case: "rawString"; + } | { + /** + * @generated from field: bytes image = 3; + */ + value: Uint8Array; + case: "image"; + } | { + /** + * @generated from field: bytes audio = 4; + */ + value: Uint8Array; + case: "audio"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -69,10 +58,8 @@ export class MetadataValue extends Message { return new MetadataValue().fromJsonString(jsonString, options); } - static equals( - a: MetadataValue | PlainMessage | undefined, - b: MetadataValue | PlainMessage | undefined, - ): boolean { + static equals(a: MetadataValue | PlainMessage | undefined, b: MetadataValue | PlainMessage | undefined): boolean { return proto3.util.equals(MetadataValue, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/predicate_pb.ts b/sdk/ahnlich-client-node/grpc/predicate_pb.ts index 9711f2b6f..7d27139de 100644 --- a/sdk/ahnlich-client-node/grpc/predicate_pb.ts +++ b/sdk/ahnlich-client-node/grpc/predicate_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import { MetadataValue } from "./metadata_pb.js"; @@ -21,36 +14,31 @@ export class Predicate extends Message { /** * @generated from oneof predicates.Predicate.kind */ - kind: - | { - /** - * @generated from field: predicates.Equals equals = 1; - */ - value: Equals; - case: "equals"; - } - | { - /** - * @generated from field: predicates.NotEquals not_equals = 2; - */ - value: NotEquals; - case: "notEquals"; - } - | { - /** - * @generated from field: predicates.In in = 3; - */ - value: In; - case: "in"; - } - | { - /** - * @generated from field: predicates.NotIn not_in = 4; - */ - value: NotIn; - case: "notIn"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + kind: { + /** + * @generated from field: predicates.Equals equals = 1; + */ + value: Equals; + case: "equals"; + } | { + /** + * @generated from field: predicates.NotEquals not_equals = 2; + */ + value: NotEquals; + case: "notEquals"; + } | { + /** + * @generated from field: predicates.In in = 3; + */ + value: In; + case: "in"; + } | { + /** + * @generated from field: predicates.NotIn not_in = 4; + */ + value: NotIn; + case: "notIn"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -78,10 +66,7 @@ export class Predicate extends Message { return new Predicate().fromJsonString(jsonString, options); } - static equals( - a: Predicate | PlainMessage | undefined, - b: Predicate | PlainMessage | undefined, - ): boolean { + static equals(a: Predicate | PlainMessage | undefined, b: Predicate | PlainMessage | undefined): boolean { return proto3.util.equals(Predicate, a, b); } } @@ -124,10 +109,7 @@ export class Equals extends Message { return new Equals().fromJsonString(jsonString, options); } - static equals( - a: Equals | PlainMessage | undefined, - b: Equals | PlainMessage | undefined, - ): boolean { + static equals(a: Equals | PlainMessage | undefined, b: Equals | PlainMessage | undefined): boolean { return proto3.util.equals(Equals, a, b); } } @@ -170,10 +152,7 @@ export class NotEquals extends Message { return new NotEquals().fromJsonString(jsonString, options); } - static equals( - a: NotEquals | PlainMessage | undefined, - b: NotEquals | PlainMessage | undefined, - ): boolean { + static equals(a: NotEquals | PlainMessage | undefined, b: NotEquals | PlainMessage | undefined): boolean { return proto3.util.equals(NotEquals, a, b); } } @@ -216,10 +195,7 @@ export class In extends Message { return new In().fromJsonString(jsonString, options); } - static equals( - a: In | PlainMessage | undefined, - b: In | PlainMessage | undefined, - ): boolean { + static equals(a: In | PlainMessage | undefined, b: In | PlainMessage | undefined): boolean { return proto3.util.equals(In, a, b); } } @@ -262,10 +238,7 @@ export class NotIn extends Message { return new NotIn().fromJsonString(jsonString, options); } - static equals( - a: NotIn | PlainMessage | undefined, - b: NotIn | PlainMessage | undefined, - ): boolean { + static equals(a: NotIn | PlainMessage | undefined, b: NotIn | PlainMessage | undefined): boolean { return proto3.util.equals(NotIn, a, b); } } @@ -277,29 +250,25 @@ export class PredicateCondition extends Message { /** * @generated from oneof predicates.PredicateCondition.kind */ - kind: - | { - /** - * @generated from field: predicates.Predicate value = 1; - */ - value: Predicate; - case: "value"; - } - | { - /** - * @generated from field: predicates.AndCondition and = 2; - */ - value: AndCondition; - case: "and"; - } - | { - /** - * @generated from field: predicates.OrCondition or = 3; - */ - value: OrCondition; - case: "or"; - } - | { case: undefined; value?: undefined } = { case: undefined }; + kind: { + /** + * @generated from field: predicates.Predicate value = 1; + */ + value: Predicate; + case: "value"; + } | { + /** + * @generated from field: predicates.AndCondition and = 2; + */ + value: AndCondition; + case: "and"; + } | { + /** + * @generated from field: predicates.OrCondition or = 3; + */ + value: OrCondition; + case: "or"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -322,17 +291,11 @@ export class PredicateCondition extends Message { return new PredicateCondition().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): PredicateCondition { + static fromJsonString(jsonString: string, options?: Partial): PredicateCondition { return new PredicateCondition().fromJsonString(jsonString, options); } - static equals( - a: PredicateCondition | PlainMessage | undefined, - b: PredicateCondition | PlainMessage | undefined, - ): boolean { + static equals(a: PredicateCondition | PlainMessage | undefined, b: PredicateCondition | PlainMessage | undefined): boolean { return proto3.util.equals(PredicateCondition, a, b); } } @@ -375,10 +338,7 @@ export class AndCondition extends Message { return new AndCondition().fromJsonString(jsonString, options); } - static equals( - a: AndCondition | PlainMessage | undefined, - b: AndCondition | PlainMessage | undefined, - ): boolean { + static equals(a: AndCondition | PlainMessage | undefined, b: AndCondition | PlainMessage | undefined): boolean { return proto3.util.equals(AndCondition, a, b); } } @@ -421,10 +381,8 @@ export class OrCondition extends Message { return new OrCondition().fromJsonString(jsonString, options); } - static equals( - a: OrCondition | PlainMessage | undefined, - b: OrCondition | PlainMessage | undefined, - ): boolean { + static equals(a: OrCondition | PlainMessage | undefined, b: OrCondition | PlainMessage | undefined): boolean { return proto3.util.equals(OrCondition, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/server_types_pb.ts b/sdk/ahnlich-client-node/grpc/server_types_pb.ts index d7bd23cb1..3853b0be4 100644 --- a/sdk/ahnlich-client-node/grpc/server_types_pb.ts +++ b/sdk/ahnlich-client-node/grpc/server_types_pb.ts @@ -24,3 +24,4 @@ proto3.util.setEnumType(ServerType, "server_types.ServerType", [ { no: 0, name: "AI" }, { no: 1, name: "Database" }, ]); + diff --git a/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts b/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts index 2910499ee..88304338a 100644 --- a/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts +++ b/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts @@ -3,41 +3,8 @@ /* eslint-disable */ // @ts-nocheck -import { - ConvertStoreInputToEmbeddings, - CreateNonLinearAlgorithmIndex, - CreatePredIndex, - CreateStore, - DelKey, - DelPred, - DropNonLinearAlgorithmIndex, - DropPredIndex, - DropStore, - GetKey, - GetPred, - GetSimN, - GetStore, - InfoServer, - ListClients, - ListStores, - Ping, - PurgeStores, - Set, -} from "../ai/query_pb.js"; -import { - AIStoreInfo, - ClientList, - CreateIndex, - Del, - Get, - GetSimN as GetSimN$1, - InfoServer as InfoServer$1, - Pong, - Set as Set$1, - StoreInputToEmbeddingsList, - StoreList, - Unit, -} from "../ai/server_pb.js"; +import { ConvertStoreInputToEmbeddings, CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, PurgeStores, Set } from "../ai/query_pb.js"; +import { AIStoreInfo, ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInputToEmbeddingsList, StoreList, Unit } from "../ai/server_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; import { AIRequestPipeline, AIResponsePipeline } from "../ai/pipeline_pb.js"; @@ -172,6 +139,15 @@ export const AIService = { O: Del, kind: MethodKind.Unary, }, + /** + * @generated from rpc services.ai_service.AIService.DropSchema + */ + dropSchema: { + name: "DropSchema", + I: DropSchema, + O: Del, + kind: MethodKind.Unary, + }, /** * * Ancillary info methods * * @@ -239,5 +215,6 @@ export const AIService = { O: AIResponsePipeline, kind: MethodKind.Unary, }, - }, + } } as const; + diff --git a/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts b/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts index 358a86e0b..f25a55024 100644 --- a/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts +++ b/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts @@ -3,38 +3,8 @@ /* eslint-disable */ // @ts-nocheck -import { - CreateNonLinearAlgorithmIndex, - CreatePredIndex, - CreateStore, - DelKey, - DelPred, - DropNonLinearAlgorithmIndex, - DropPredIndex, - DropStore, - GetKey, - GetPred, - GetSimN, - GetStore, - InfoServer, - ListClients, - ListStores, - Ping, - Set, -} from "../db/query_pb.js"; -import { - ClientList, - CreateIndex, - Del, - Get, - GetSimN as GetSimN$1, - InfoServer as InfoServer$1, - Pong, - Set as Set$1, - StoreInfo, - StoreList, - Unit, -} from "../db/server_pb.js"; +import { CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, Set } from "../db/query_pb.js"; +import { ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInfo, StoreList, Unit } from "../db/server_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; import { ClusterInfoQuery, ClusterInfoResponse } from "../shared/cluster_pb.js"; import { DBRequestPipeline, DBResponsePipeline } from "../db/pipeline_pb.js"; @@ -170,6 +140,15 @@ export const DBService = { O: Del, kind: MethodKind.Unary, }, + /** + * @generated from rpc services.db_service.DBService.DropSchema + */ + dropSchema: { + name: "DropSchema", + I: DropSchema, + O: Del, + kind: MethodKind.Unary, + }, /** * * Ancillary info methods * * @@ -228,5 +207,6 @@ export const DBService = { O: DBResponsePipeline, kind: MethodKind.Unary, }, - }, + } } as const; + diff --git a/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts b/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts index 78a3ae0c6..df0d76460 100644 --- a/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts +++ b/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts @@ -12,14 +12,7 @@ // additions to db.query / db.server / ai.query / ai.server land in the // milestones that actually wire them up (M2 for DB, M4 for AI). -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; /** @@ -152,10 +145,7 @@ export class ClusterNode extends Message { return new ClusterNode().fromJsonString(jsonString, options); } - static equals( - a: ClusterNode | PlainMessage | undefined, - b: ClusterNode | PlainMessage | undefined, - ): boolean { + static equals(a: ClusterNode | PlainMessage | undefined, b: ClusterNode | PlainMessage | undefined): boolean { return proto3.util.equals(ClusterNode, a, b); } } @@ -171,7 +161,8 @@ export class ClusterInfoQuery extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "shared.cluster.ClusterInfoQuery"; - static readonly fields: FieldList = proto3.util.newFieldList(() => []); + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); static fromBinary(bytes: Uint8Array, options?: Partial): ClusterInfoQuery { return new ClusterInfoQuery().fromBinary(bytes, options); @@ -185,10 +176,7 @@ export class ClusterInfoQuery extends Message { return new ClusterInfoQuery().fromJsonString(jsonString, options); } - static equals( - a: ClusterInfoQuery | PlainMessage | undefined, - b: ClusterInfoQuery | PlainMessage | undefined, - ): boolean { + static equals(a: ClusterInfoQuery | PlainMessage | undefined, b: ClusterInfoQuery | PlainMessage | undefined): boolean { return proto3.util.equals(ClusterInfoQuery, a, b); } } @@ -221,17 +209,12 @@ export class ClusterInfoResponse extends Message { return new ClusterInfoResponse().fromJson(jsonValue, options); } - static fromJsonString( - jsonString: string, - options?: Partial, - ): ClusterInfoResponse { + static fromJsonString(jsonString: string, options?: Partial): ClusterInfoResponse { return new ClusterInfoResponse().fromJsonString(jsonString, options); } - static equals( - a: ClusterInfoResponse | PlainMessage | undefined, - b: ClusterInfoResponse | PlainMessage | undefined, - ): boolean { + static equals(a: ClusterInfoResponse | PlainMessage | undefined, b: ClusterInfoResponse | PlainMessage | undefined): boolean { return proto3.util.equals(ClusterInfoResponse, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/shared/info_pb.ts b/sdk/ahnlich-client-node/grpc/shared/info_pb.ts index ab4effab4..ac4876300 100644 --- a/sdk/ahnlich-client-node/grpc/shared/info_pb.ts +++ b/sdk/ahnlich-client-node/grpc/shared/info_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ServerType } from "../server_types_pb.js"; @@ -70,10 +63,7 @@ export class ServerInfo extends Message { return new ServerInfo().fromJsonString(jsonString, options); } - static equals( - a: ServerInfo | PlainMessage | undefined, - b: ServerInfo | PlainMessage | undefined, - ): boolean { + static equals(a: ServerInfo | PlainMessage | undefined, b: ServerInfo | PlainMessage | undefined): boolean { return proto3.util.equals(ServerInfo, a, b); } } @@ -116,10 +106,7 @@ export class StoreUpsert extends Message { return new StoreUpsert().fromJsonString(jsonString, options); } - static equals( - a: StoreUpsert | PlainMessage | undefined, - b: StoreUpsert | PlainMessage | undefined, - ): boolean { + static equals(a: StoreUpsert | PlainMessage | undefined, b: StoreUpsert | PlainMessage | undefined): boolean { return proto3.util.equals(StoreUpsert, a, b); } } @@ -162,10 +149,8 @@ export class ErrorResponse extends Message { return new ErrorResponse().fromJsonString(jsonString, options); } - static equals( - a: ErrorResponse | PlainMessage | undefined, - b: ErrorResponse | PlainMessage | undefined, - ): boolean { + static equals(a: ErrorResponse | PlainMessage | undefined, b: ErrorResponse | PlainMessage | undefined): boolean { return proto3.util.equals(ErrorResponse, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/similarity_pb.ts b/sdk/ahnlich-client-node/grpc/similarity_pb.ts index 469d3f87c..89df61cb1 100644 --- a/sdk/ahnlich-client-node/grpc/similarity_pb.ts +++ b/sdk/ahnlich-client-node/grpc/similarity_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -45,10 +38,8 @@ export class Similarity extends Message { return new Similarity().fromJsonString(jsonString, options); } - static equals( - a: Similarity | PlainMessage | undefined, - b: Similarity | PlainMessage | undefined, - ): boolean { + static equals(a: Similarity | PlainMessage | undefined, b: Similarity | PlainMessage | undefined): boolean { return proto3.util.equals(Similarity, a, b); } } + diff --git a/sdk/ahnlich-client-node/grpc/version_pb.ts b/sdk/ahnlich-client-node/grpc/version_pb.ts index a26ce00af..8915e2a90 100644 --- a/sdk/ahnlich-client-node/grpc/version_pb.ts +++ b/sdk/ahnlich-client-node/grpc/version_pb.ts @@ -3,14 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { - BinaryReadOptions, - FieldList, - JsonReadOptions, - JsonValue, - PartialMessage, - PlainMessage, -} from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -59,10 +52,8 @@ export class Version extends Message { return new Version().fromJsonString(jsonString, options); } - static equals( - a: Version | PlainMessage | undefined, - b: Version | PlainMessage | undefined, - ): boolean { + static equals(a: Version | PlainMessage | undefined, b: Version | PlainMessage | undefined): boolean { return proto3.util.equals(Version, a, b); } } + diff --git a/sdk/ahnlich-client-node/package-lock.json b/sdk/ahnlich-client-node/package-lock.json index 539dc3bc9..e1522b19f 100644 --- a/sdk/ahnlich-client-node/package-lock.json +++ b/sdk/ahnlich-client-node/package-lock.json @@ -1,12 +1,12 @@ { "name": "@deven96/ahnlich-client-node", - "version": "0.0.1", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@deven96/ahnlich-client-node", - "version": "0.0.1", + "version": "0.3.0", "dependencies": { "@connectrpc/connect": "^1.7.0", "@connectrpc/connect-node": "^1.7.0" diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py index 0e7bdce31..31e4e3bf9 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py @@ -9,8 +9,10 @@ import betterproto from ...shared import info as __shared_info__ -from .. import query as _query__ -from .. import server as _server__ +from .. import ( + query as _query__, + server as _server__, +) @dataclass(eq=False, repr=False) @@ -44,6 +46,7 @@ class AiQuery(betterproto.Message): ) del_pred: "_query__.DelPred" = betterproto.message_field(18, group="query") get_store: "_query__.GetStore" = betterproto.message_field(19, group="query") + drop_schema: "_query__.DropSchema" = betterproto.message_field(20, group="query") @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py index 588c93f9a..efca863b5 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py @@ -4,17 +4,27 @@ # This file has been @generated from dataclasses import dataclass -from typing import Dict, List, Optional +from typing import ( + Dict, + List, + Optional, +) import betterproto -from ... import keyval as __keyval__ -from ... import predicates as __predicates__ -from ...algorithm import algorithms as __algorithm_algorithms__ -from ...algorithm import nonlinear as __algorithm_nonlinear__ -from .. import execution_provider as _execution_provider__ -from .. import models as _models__ -from .. import preprocess as _preprocess__ +from ... import ( + keyval as __keyval__, + predicates as __predicates__, +) +from ...algorithm import ( + algorithms as __algorithm_algorithms__, + nonlinear as __algorithm_nonlinear__, +) +from .. import ( + execution_provider as _execution_provider__, + models as _models__, + preprocess as _preprocess__, +) @dataclass(eq=False, repr=False) @@ -37,6 +47,7 @@ class CreateStore(betterproto.Message): ) error_if_exists: bool = betterproto.bool_field(6) store_original: bool = betterproto.bool_field(7) + schema: Optional[str] = betterproto.string_field(8, optional=True) @dataclass(eq=False, repr=False) @@ -152,6 +163,7 @@ class DropStore(betterproto.Message): """ error_if_not_exists: bool = betterproto.bool_field(2) + schema: Optional[str] = betterproto.string_field(3, optional=True) @dataclass(eq=False, repr=False) @@ -176,7 +188,10 @@ class ListClients(betterproto.Message): @dataclass(eq=False, repr=False) class ListStores(betterproto.Message): - pass + schema: Optional[str] = betterproto.string_field(1, optional=True) + """ + Lists all stores on the server along with details like store size, embedding dimensions, AI models, etc. + """ @dataclass(eq=False, repr=False) @@ -186,6 +201,16 @@ class GetStore(betterproto.Message): Gets detailed information about a specific store by name. Returns an error if the store does not exist. """ + schema: Optional[str] = betterproto.string_field(2, optional=True) + + +@dataclass(eq=False, repr=False) +class DropSchema(betterproto.Message): + schema: str = betterproto.string_field(1) + """ + Drops an entire schema and all stores within it. Cannot drop the "public" default schema. + """ + @dataclass(eq=False, repr=False) class PurgeStores(betterproto.Message): diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py index 3a127c314..b450dc912 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py @@ -4,13 +4,18 @@ # This file has been @generated from dataclasses import dataclass -from typing import List, Optional +from typing import ( + List, + Optional, +) import betterproto -from ... import client as __client__ -from ... import keyval as __keyval__ -from ... import similarity as __similarity__ +from ... import ( + client as __client__, + keyval as __keyval__, + similarity as __similarity__, +) from ...db import server as __db_server__ from ...shared import info as __shared_info__ from .. import models as _models__ diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py index 51a8d190d..342678c5c 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py @@ -8,10 +8,11 @@ import betterproto -from ...shared import cluster as __shared_cluster__ from ...shared import info as __shared_info__ -from .. import query as _query__ -from .. import server as _server__ +from .. import ( + query as _query__, + server as _server__, +) @dataclass(eq=False, repr=False) @@ -41,9 +42,7 @@ class DbQuery(betterproto.Message): list_clients: "_query__.ListClients" = betterproto.message_field(15, group="query") ping: "_query__.Ping" = betterproto.message_field(16, group="query") get_store: "_query__.GetStore" = betterproto.message_field(17, group="query") - cluster_info: "__shared_cluster__.ClusterInfoQuery" = betterproto.message_field( - 18, group="query" - ) + drop_schema: "_query__.DropSchema" = betterproto.message_field(18, group="query") @dataclass(eq=False, repr=False) @@ -69,9 +68,6 @@ class DbServerResponse(betterproto.Message): 11, group="response" ) store_info: "_server__.StoreInfo" = betterproto.message_field(12, group="response") - cluster_info: "__shared_cluster__.ClusterInfoResponse" = betterproto.message_field( - 13, group="response" - ) @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py index 4ac775b4e..28d8510e6 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py @@ -4,14 +4,21 @@ # This file has been @generated from dataclasses import dataclass -from typing import List +from typing import ( + List, + Optional, +) import betterproto -from ... import keyval as __keyval__ -from ... import predicates as __predicates__ -from ...algorithm import algorithms as __algorithm_algorithms__ -from ...algorithm import nonlinear as __algorithm_nonlinear__ +from ... import ( + keyval as __keyval__, + predicates as __predicates__, +) +from ...algorithm import ( + algorithms as __algorithm_algorithms__, + nonlinear as __algorithm_nonlinear__, +) @dataclass(eq=False, repr=False) @@ -28,6 +35,7 @@ class CreateStore(betterproto.Message): betterproto.message_field(4) ) error_if_exists: bool = betterproto.bool_field(5) + schema: Optional[str] = betterproto.string_field(6, optional=True) @dataclass(eq=False, repr=False) @@ -144,6 +152,7 @@ class DropStore(betterproto.Message): store: str = betterproto.string_field(1) error_if_not_exists: bool = betterproto.bool_field(2) + schema: Optional[str] = betterproto.string_field(3, optional=True) @dataclass(eq=False, repr=False) @@ -159,7 +168,7 @@ class ListStores(betterproto.Message): A request to list all the stores on the server, along with their size or length. """ - pass + schema: Optional[str] = betterproto.string_field(1, optional=True) @dataclass(eq=False, repr=False) @@ -183,6 +192,17 @@ class GetStore(betterproto.Message): """ store: str = betterproto.string_field(1) + schema: Optional[str] = betterproto.string_field(2, optional=True) + + +@dataclass(eq=False, repr=False) +class DropSchema(betterproto.Message): + """ + Drops an entire schema and all stores within it. + Cannot drop the "public" default schema. + """ + + schema: str = betterproto.string_field(1) @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py index f09a8a4f4..ba34ae10f 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py @@ -8,9 +8,11 @@ import betterproto -from ... import client as __client__ -from ... import keyval as __keyval__ -from ... import similarity as __similarity__ +from ... import ( + client as __client__, + keyval as __keyval__, + similarity as __similarity__, +) from ...algorithm import nonlinear as __algorithm_nonlinear__ from ...shared import info as __shared_info__ diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py index afbaa28bf..365305de7 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py @@ -4,7 +4,10 @@ # This file has been @generated from dataclasses import dataclass -from typing import Dict, List +from typing import ( + Dict, + List, +) import betterproto diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py index b47828b65..e1ef80837 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py @@ -4,15 +4,21 @@ # This file has been @generated from dataclasses import dataclass -from typing import TYPE_CHECKING, Dict, Optional +from typing import ( + TYPE_CHECKING, + Dict, + Optional, +) import betterproto import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ...ai import pipeline as __ai_pipeline__ -from ...ai import query as __ai_query__ -from ...ai import server as __ai_server__ +from ...ai import ( + pipeline as __ai_pipeline__, + query as __ai_query__, + server as __ai_server__, +) if TYPE_CHECKING: import grpclib.server @@ -242,6 +248,23 @@ async def drop_store( metadata=metadata, ) + async def drop_schema( + self, + ai_query_drop_schema: "__ai_query__.DropSchema", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "__ai_server__.Del": + return await self._unary_unary( + "/services.ai_service.AIService/DropSchema", + ai_query_drop_schema, + __ai_server__.Del, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def list_clients( self, ai_query_list_clients: "__ai_query__.ListClients", @@ -429,6 +452,11 @@ async def drop_store( ) -> "__ai_server__.Del": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def drop_schema( + self, ai_query_drop_schema: "__ai_query__.DropSchema" + ) -> "__ai_server__.Del": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def list_clients( self, ai_query_list_clients: "__ai_query__.ListClients" ) -> "__ai_server__.ClientList": @@ -561,6 +589,14 @@ async def __rpc_drop_store( response = await self.drop_store(request) await stream.send_message(response) + async def __rpc_drop_schema( + self, + stream: "grpclib.server.Stream[__ai_query__.DropSchema, __ai_server__.Del]", + ) -> None: + request = await stream.recv_message() + response = await self.drop_schema(request) + await stream.send_message(response) + async def __rpc_list_clients( self, stream: "grpclib.server.Stream[__ai_query__.ListClients, __ai_server__.ClientList]", @@ -696,6 +732,12 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: __ai_query__.DropStore, __ai_server__.Del, ), + "/services.ai_service.AIService/DropSchema": grpclib.const.Handler( + self.__rpc_drop_schema, + grpclib.const.Cardinality.UNARY_UNARY, + __ai_query__.DropSchema, + __ai_server__.Del, + ), "/services.ai_service.AIService/ListClients": grpclib.const.Handler( self.__rpc_list_clients, grpclib.const.Cardinality.UNARY_UNARY, diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py index cc8a071fc..a233a8e14 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py @@ -4,16 +4,21 @@ # This file has been @generated from dataclasses import dataclass -from typing import TYPE_CHECKING, Dict, Optional +from typing import ( + TYPE_CHECKING, + Dict, + Optional, +) import betterproto import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ...db import pipeline as __db_pipeline__ -from ...db import query as __db_query__ -from ...db import server as __db_server__ -from ...shared import cluster as __shared_cluster__ +from ...db import ( + pipeline as __db_pipeline__, + query as __db_query__, + server as __db_server__, +) if TYPE_CHECKING: import grpclib.server @@ -243,6 +248,23 @@ async def drop_store( metadata=metadata, ) + async def drop_schema( + self, + db_query_drop_schema: "__db_query__.DropSchema", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "__db_server__.Del": + return await self._unary_unary( + "/services.db_service.DBService/DropSchema", + db_query_drop_schema, + __db_server__.Del, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def list_clients( self, db_query_list_clients: "__db_query__.ListClients", @@ -294,23 +316,6 @@ async def info_server( metadata=metadata, ) - async def cluster_info( - self, - shared_cluster_cluster_info_query: "__shared_cluster__.ClusterInfoQuery", - *, - timeout: Optional[float] = None, - deadline: Optional["Deadline"] = None, - metadata: Optional["MetadataLike"] = None - ) -> "__shared_cluster__.ClusterInfoResponse": - return await self._unary_unary( - "/services.db_service.DBService/ClusterInfo", - shared_cluster_cluster_info_query, - __shared_cluster__.ClusterInfoResponse, - timeout=timeout, - deadline=deadline, - metadata=metadata, - ) - async def ping( self, db_query_ping: "__db_query__.Ping", @@ -413,6 +418,11 @@ async def drop_store( ) -> "__db_server__.Del": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def drop_schema( + self, db_query_drop_schema: "__db_query__.DropSchema" + ) -> "__db_server__.Del": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def list_clients( self, db_query_list_clients: "__db_query__.ListClients" ) -> "__db_server__.ClientList": @@ -428,11 +438,6 @@ async def info_server( ) -> "__db_server__.InfoServer": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def cluster_info( - self, shared_cluster_cluster_info_query: "__shared_cluster__.ClusterInfoQuery" - ) -> "__shared_cluster__.ClusterInfoResponse": - raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def ping(self, db_query_ping: "__db_query__.Ping") -> "__db_server__.Pong": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -539,6 +544,14 @@ async def __rpc_drop_store( response = await self.drop_store(request) await stream.send_message(response) + async def __rpc_drop_schema( + self, + stream: "grpclib.server.Stream[__db_query__.DropSchema, __db_server__.Del]", + ) -> None: + request = await stream.recv_message() + response = await self.drop_schema(request) + await stream.send_message(response) + async def __rpc_list_clients( self, stream: "grpclib.server.Stream[__db_query__.ListClients, __db_server__.ClientList]", @@ -563,14 +576,6 @@ async def __rpc_info_server( response = await self.info_server(request) await stream.send_message(response) - async def __rpc_cluster_info( - self, - stream: "grpclib.server.Stream[__shared_cluster__.ClusterInfoQuery, __shared_cluster__.ClusterInfoResponse]", - ) -> None: - request = await stream.recv_message() - response = await self.cluster_info(request) - await stream.send_message(response) - async def __rpc_ping( self, stream: "grpclib.server.Stream[__db_query__.Ping, __db_server__.Pong]" ) -> None: @@ -666,6 +671,12 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: __db_query__.DropStore, __db_server__.Del, ), + "/services.db_service.DBService/DropSchema": grpclib.const.Handler( + self.__rpc_drop_schema, + grpclib.const.Cardinality.UNARY_UNARY, + __db_query__.DropSchema, + __db_server__.Del, + ), "/services.db_service.DBService/ListClients": grpclib.const.Handler( self.__rpc_list_clients, grpclib.const.Cardinality.UNARY_UNARY, @@ -684,12 +695,6 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: __db_query__.InfoServer, __db_server__.InfoServer, ), - "/services.db_service.DBService/ClusterInfo": grpclib.const.Handler( - self.__rpc_cluster_info, - grpclib.const.Cardinality.UNARY_UNARY, - __shared_cluster__.ClusterInfoQuery, - __shared_cluster__.ClusterInfoResponse, - ), "/services.db_service.DBService/Ping": grpclib.const.Handler( self.__rpc_ping, grpclib.const.Cardinality.UNARY_UNARY, diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py index 3e0189a0b..f2ee11faa 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py @@ -4,7 +4,10 @@ # This file has been @generated from dataclasses import dataclass -from typing import List, Optional +from typing import ( + List, + Optional, +) import betterproto diff --git a/sdk/ahnlich-client-py/build_fixed.py b/sdk/ahnlich-client-py/build_fixed.py new file mode 100644 index 000000000..05b8f86f7 --- /dev/null +++ b/sdk/ahnlich-client-py/build_fixed.py @@ -0,0 +1,31 @@ +import os +import pathlib +import sys + +from grpc_tools import protoc + +PROTO_DIR = "../../protos/" +OUT_DIR = "./ahnlich_client_py/grpc/" + +# Ensure the output directory exists +pathlib.Path(OUT_DIR).mkdir(parents=True, exist_ok=True) + + +def generate_from_protos(): + proto_files = [str(p) for p in pathlib.Path(PROTO_DIR).rglob("*.proto")] + if not proto_files: + print("No .proto files found.") + return + + command = [ + "grpc_tools.protoc", + f"--proto_path={PROTO_DIR}", + f"--python_betterproto_out={OUT_DIR}", + ] + proto_files + + if protoc.main(command) != 0: + raise RuntimeError("Protobuf compilation failed") + + +if __name__ == "__main__": + generate_from_protos() From 511105f03576cf5a695c9f97b3853dc0cbf3a726 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Mon, 15 Jun 2026 10:03:38 +0100 Subject: [PATCH 10/28] style: format regenerated SDK stubs to pass CI lint checks - Go: goimports + gofmt - Node: prettier - Python: isort import sorting --- .../execution_provider.pb.go | 5 +- .../grpc/ai/models/models.pb.go | 5 +- .../grpc/ai/pipeline/pipeline.pb.go | 10 +- .../grpc/ai/preprocess/preprocess.pb.go | 5 +- .../grpc/ai/query/query.pb.go | 10 +- .../grpc/ai/server/server.pb.go | 10 +- .../grpc/algorithm/algorithms/algorithm.pb.go | 5 +- .../grpc/algorithm/nonlinear/nonlinear.pb.go | 8 +- .../grpc/client/client.pb.go | 5 +- .../grpc/db/pipeline/pipeline.pb.go | 10 +- .../grpc/db/query/query.pb.go | 10 +- .../grpc/db/server/server.pb.go | 10 +- .../grpc/keyval/keyval.pb.go | 8 +- .../grpc/metadata/metadata.pb.go | 5 +- .../grpc/predicates/predicate.pb.go | 8 +- .../grpc/server_types/server_types.pb.go | 5 +- .../grpc/services/ai_service/ai_service.pb.go | 8 +- .../services/ai_service/ai_service_grpc.pb.go | 8 +- .../grpc/services/db_service/db_service.pb.go | 8 +- .../services/db_service/db_service_grpc.pb.go | 8 +- .../grpc/shared/cluster/cluster.pb.go | 5 +- .../grpc/shared/info/info.pb.go | 8 +- .../grpc/similarity/similarity.pb.go | 5 +- .../grpc/version/version.pb.go | 5 +- .../grpc/ai/execution_provider_pb.ts | 1 - sdk/ahnlich-client-node/grpc/ai/models_pb.ts | 1 - .../grpc/ai/pipeline_pb.ts | 540 +++++++++++------- .../grpc/ai/preprocess_pb.ts | 1 - sdk/ahnlich-client-node/grpc/ai/query_pb.ts | 223 ++++++-- sdk/ahnlich-client-node/grpc/ai/server_pb.ts | 178 ++++-- .../grpc/algorithm/algorithm_pb.ts | 1 - .../grpc/algorithm/nonlinear_pb.ts | 81 ++- sdk/ahnlich-client-node/grpc/client_pb.ts | 15 +- .../grpc/db/pipeline_pb.ts | 482 +++++++++------- sdk/ahnlich-client-node/grpc/db/query_pb.ts | 155 +++-- sdk/ahnlich-client-node/grpc/db/server_pb.ts | 235 +++++--- sdk/ahnlich-client-node/grpc/keyval_pb.ts | 90 ++- sdk/ahnlich-client-node/grpc/metadata_pb.ts | 57 +- sdk/ahnlich-client-node/grpc/predicate_pb.ts | 152 +++-- .../grpc/server_types_pb.ts | 1 - .../grpc/services/ai_service_connect.ts | 41 +- .../grpc/services/db_service_connect.ts | 38 +- .../grpc/shared/cluster_pb.ts | 33 +- .../grpc/shared/info_pb.ts | 25 +- sdk/ahnlich-client-node/grpc/similarity_pb.ts | 15 +- sdk/ahnlich-client-node/grpc/version_pb.ts | 15 +- .../grpc/ai/pipeline/__init__.py | 6 +- .../grpc/ai/query/__init__.py | 26 +- .../grpc/ai/server/__init__.py | 13 +- .../grpc/db/pipeline/__init__.py | 6 +- .../grpc/db/query/__init__.py | 17 +- .../grpc/db/server/__init__.py | 8 +- .../ahnlich_client_py/grpc/keyval/__init__.py | 5 +- .../grpc/services/ai_service/__init__.py | 14 +- .../grpc/services/db_service/__init__.py | 14 +- .../grpc/shared/cluster/__init__.py | 5 +- 56 files changed, 1739 insertions(+), 929 deletions(-) diff --git a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go index 4d0345415..407d18760 100644 --- a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go @@ -7,10 +7,11 @@ package execution_provider import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go index a7b8afbf1..6e1dc787a 100644 --- a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go @@ -7,10 +7,11 @@ package models import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go index 77fe5b270..a14bc4cfd 100644 --- a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go @@ -7,13 +7,15 @@ package pipeline import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go index 49c0b0ae8..b57a656f9 100644 --- a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go @@ -7,10 +7,11 @@ package preprocess import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go index 4e5c1f783..6437b74f0 100644 --- a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go @@ -7,6 +7,12 @@ package query import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + execution_provider "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/execution_provider" models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" preprocess "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/preprocess" @@ -14,10 +20,6 @@ import ( nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go index ee7e72e70..64ea1dabf 100644 --- a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go @@ -7,6 +7,12 @@ package server import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" @@ -14,10 +20,6 @@ import ( _ "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go index 190f0ccc3..42a32c2f7 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go @@ -7,10 +7,11 @@ package algorithms import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go index 90d3139d6..26e5b0bab 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go @@ -7,11 +7,13 @@ package nonlinear import ( - algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/client/client.pb.go b/sdk/ahnlich-client-go/grpc/client/client.pb.go index c8473bfe1..9e9d3b259 100644 --- a/sdk/ahnlich-client-go/grpc/client/client.pb.go +++ b/sdk/ahnlich-client-go/grpc/client/client.pb.go @@ -7,10 +7,11 @@ package client import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go index 4bb4d5aca..8a21d9037 100644 --- a/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go @@ -7,13 +7,15 @@ package pipeline import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go index 616666020..51ce5ae88 100644 --- a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go @@ -7,14 +7,16 @@ package query import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go index 85fdb727a..49d0ce65a 100644 --- a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go @@ -7,15 +7,17 @@ package server import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go index 791f70701..5469e84ea 100644 --- a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go +++ b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go @@ -7,11 +7,13 @@ package keyval import ( - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go index e94e96adf..c33154adb 100644 --- a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go +++ b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go @@ -7,10 +7,11 @@ package metadata import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go index 7accab29c..a3b1f7276 100644 --- a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go +++ b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go @@ -7,11 +7,13 @@ package predicates import ( - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go index 6acf33906..fac3e2773 100644 --- a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go +++ b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go @@ -7,10 +7,11 @@ package server_types import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go index 1d5ccbfb8..b130cfc8c 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go @@ -7,12 +7,14 @@ package ai_service import ( + reflect "reflect" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go index 9f9e0332c..70554e958 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go @@ -8,12 +8,14 @@ package ai_service import ( context "context" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" - query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" - server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" + query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" + server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" ) // This is a compile-time assertion to ensure that this generated file diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go index fdde54c26..b6ee2cf89 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go @@ -7,12 +7,14 @@ package db_service import ( + reflect "reflect" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go index 4c2ea2c50..a7b44a42e 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go @@ -8,12 +8,14 @@ package db_service import ( context "context" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" - query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" - server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" + query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" + server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" ) // This is a compile-time assertion to ensure that this generated file diff --git a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go index 5c7f1f49d..88f9580bf 100644 --- a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go @@ -16,10 +16,11 @@ package cluster import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go index cb2e80638..d5a440ea8 100644 --- a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go @@ -7,11 +7,13 @@ package info import ( - server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go index aa9a9050d..289811655 100644 --- a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go +++ b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go @@ -7,10 +7,11 @@ package similarity import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/version/version.pb.go b/sdk/ahnlich-client-go/grpc/version/version.pb.go index a7474bc7d..3207ab183 100644 --- a/sdk/ahnlich-client-go/grpc/version/version.pb.go +++ b/sdk/ahnlich-client-go/grpc/version/version.pb.go @@ -7,10 +7,11 @@ package version import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts b/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts index 81d259093..43df2d1ed 100644 --- a/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/execution_provider_pb.ts @@ -38,4 +38,3 @@ proto3.util.setEnumType(ExecutionProvider, "ai.execution_provider.ExecutionProvi { no: 2, name: "DIRECT_ML" }, { no: 3, name: "CORE_ML" }, ]); - diff --git a/sdk/ahnlich-client-node/grpc/ai/models_pb.ts b/sdk/ahnlich-client-node/grpc/ai/models_pb.ts index 13df27bcb..47f1db519 100644 --- a/sdk/ahnlich-client-node/grpc/ai/models_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/models_pb.ts @@ -112,4 +112,3 @@ proto3.util.setEnumType(AIStoreInputType, "ai.models.AIStoreInputType", [ { no: 1, name: "IMAGE" }, { no: 2, name: "AUDIO" }, ]); - diff --git a/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts b/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts index 124007c5f..84f736f25 100644 --- a/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/pipeline_pb.ts @@ -3,10 +3,51 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { ConvertStoreInputToEmbeddings, CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, PurgeStores, Set } from "./query_pb.js"; -import { AIStoreInfo, ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInputToEmbeddingsList, StoreList, Unit } from "./server_pb.js"; +import { + ConvertStoreInputToEmbeddings, + CreateNonLinearAlgorithmIndex, + CreatePredIndex, + CreateStore, + DelKey, + DelPred, + DropNonLinearAlgorithmIndex, + DropPredIndex, + DropSchema, + DropStore, + GetKey, + GetPred, + GetSimN, + GetStore, + InfoServer, + ListClients, + ListStores, + Ping, + PurgeStores, + Set, +} from "./query_pb.js"; +import { + AIStoreInfo, + ClientList, + CreateIndex, + Del, + Get, + GetSimN as GetSimN$1, + InfoServer as InfoServer$1, + Pong, + Set as Set$1, + StoreInputToEmbeddingsList, + StoreList, + Unit, +} from "./server_pb.js"; import { ErrorResponse } from "../shared/info_pb.js"; /** @@ -16,127 +57,148 @@ export class AIQuery extends Message { /** * @generated from oneof ai.pipeline.AIQuery.query */ - query: { - /** - * @generated from field: ai.query.CreateStore create_store = 1; - */ - value: CreateStore; - case: "createStore"; - } | { - /** - * @generated from field: ai.query.GetPred get_pred = 2; - */ - value: GetPred; - case: "getPred"; - } | { - /** - * @generated from field: ai.query.GetSimN get_sim_n = 3; - */ - value: GetSimN; - case: "getSimN"; - } | { - /** - * @generated from field: ai.query.CreatePredIndex create_pred_index = 4; - */ - value: CreatePredIndex; - case: "createPredIndex"; - } | { - /** - * @generated from field: ai.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 5; - */ - value: CreateNonLinearAlgorithmIndex; - case: "createNonLinearAlgorithmIndex"; - } | { - /** - * @generated from field: ai.query.DropPredIndex drop_pred_index = 6; - */ - value: DropPredIndex; - case: "dropPredIndex"; - } | { - /** - * @generated from field: ai.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 7; - */ - value: DropNonLinearAlgorithmIndex; - case: "dropNonLinearAlgorithmIndex"; - } | { - /** - * @generated from field: ai.query.Set set = 8; - */ - value: Set; - case: "set"; - } | { - /** - * @generated from field: ai.query.DelKey del_key = 9; - */ - value: DelKey; - case: "delKey"; - } | { - /** - * @generated from field: ai.query.DropStore drop_store = 10; - */ - value: DropStore; - case: "dropStore"; - } | { - /** - * @generated from field: ai.query.GetKey get_key = 11; - */ - value: GetKey; - case: "getKey"; - } | { - /** - * @generated from field: ai.query.InfoServer info_server = 12; - */ - value: InfoServer; - case: "infoServer"; - } | { - /** - * @generated from field: ai.query.ListClients list_clients = 13; - */ - value: ListClients; - case: "listClients"; - } | { - /** - * @generated from field: ai.query.ListStores list_stores = 14; - */ - value: ListStores; - case: "listStores"; - } | { - /** - * @generated from field: ai.query.PurgeStores purge_stores = 15; - */ - value: PurgeStores; - case: "purgeStores"; - } | { - /** - * @generated from field: ai.query.Ping ping = 16; - */ - value: Ping; - case: "ping"; - } | { - /** - * @generated from field: ai.query.ConvertStoreInputToEmbeddings convert_store_input_to_embeddings = 17; - */ - value: ConvertStoreInputToEmbeddings; - case: "convertStoreInputToEmbeddings"; - } | { - /** - * @generated from field: ai.query.DelPred del_pred = 18; - */ - value: DelPred; - case: "delPred"; - } | { - /** - * @generated from field: ai.query.GetStore get_store = 19; - */ - value: GetStore; - case: "getStore"; - } | { - /** - * @generated from field: ai.query.DropSchema drop_schema = 20; - */ - value: DropSchema; - case: "dropSchema"; - } | { case: undefined; value?: undefined } = { case: undefined }; + query: + | { + /** + * @generated from field: ai.query.CreateStore create_store = 1; + */ + value: CreateStore; + case: "createStore"; + } + | { + /** + * @generated from field: ai.query.GetPred get_pred = 2; + */ + value: GetPred; + case: "getPred"; + } + | { + /** + * @generated from field: ai.query.GetSimN get_sim_n = 3; + */ + value: GetSimN; + case: "getSimN"; + } + | { + /** + * @generated from field: ai.query.CreatePredIndex create_pred_index = 4; + */ + value: CreatePredIndex; + case: "createPredIndex"; + } + | { + /** + * @generated from field: ai.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 5; + */ + value: CreateNonLinearAlgorithmIndex; + case: "createNonLinearAlgorithmIndex"; + } + | { + /** + * @generated from field: ai.query.DropPredIndex drop_pred_index = 6; + */ + value: DropPredIndex; + case: "dropPredIndex"; + } + | { + /** + * @generated from field: ai.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 7; + */ + value: DropNonLinearAlgorithmIndex; + case: "dropNonLinearAlgorithmIndex"; + } + | { + /** + * @generated from field: ai.query.Set set = 8; + */ + value: Set; + case: "set"; + } + | { + /** + * @generated from field: ai.query.DelKey del_key = 9; + */ + value: DelKey; + case: "delKey"; + } + | { + /** + * @generated from field: ai.query.DropStore drop_store = 10; + */ + value: DropStore; + case: "dropStore"; + } + | { + /** + * @generated from field: ai.query.GetKey get_key = 11; + */ + value: GetKey; + case: "getKey"; + } + | { + /** + * @generated from field: ai.query.InfoServer info_server = 12; + */ + value: InfoServer; + case: "infoServer"; + } + | { + /** + * @generated from field: ai.query.ListClients list_clients = 13; + */ + value: ListClients; + case: "listClients"; + } + | { + /** + * @generated from field: ai.query.ListStores list_stores = 14; + */ + value: ListStores; + case: "listStores"; + } + | { + /** + * @generated from field: ai.query.PurgeStores purge_stores = 15; + */ + value: PurgeStores; + case: "purgeStores"; + } + | { + /** + * @generated from field: ai.query.Ping ping = 16; + */ + value: Ping; + case: "ping"; + } + | { + /** + * @generated from field: ai.query.ConvertStoreInputToEmbeddings convert_store_input_to_embeddings = 17; + */ + value: ConvertStoreInputToEmbeddings; + case: "convertStoreInputToEmbeddings"; + } + | { + /** + * @generated from field: ai.query.DelPred del_pred = 18; + */ + value: DelPred; + case: "delPred"; + } + | { + /** + * @generated from field: ai.query.GetStore get_store = 19; + */ + value: GetStore; + case: "getStore"; + } + | { + /** + * @generated from field: ai.query.DropSchema drop_schema = 20; + */ + value: DropSchema; + case: "dropSchema"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -150,9 +212,21 @@ export class AIQuery extends Message { { no: 2, name: "get_pred", kind: "message", T: GetPred, oneof: "query" }, { no: 3, name: "get_sim_n", kind: "message", T: GetSimN, oneof: "query" }, { no: 4, name: "create_pred_index", kind: "message", T: CreatePredIndex, oneof: "query" }, - { no: 5, name: "create_non_linear_algorithm_index", kind: "message", T: CreateNonLinearAlgorithmIndex, oneof: "query" }, + { + no: 5, + name: "create_non_linear_algorithm_index", + kind: "message", + T: CreateNonLinearAlgorithmIndex, + oneof: "query", + }, { no: 6, name: "drop_pred_index", kind: "message", T: DropPredIndex, oneof: "query" }, - { no: 7, name: "drop_non_linear_algorithm_index", kind: "message", T: DropNonLinearAlgorithmIndex, oneof: "query" }, + { + no: 7, + name: "drop_non_linear_algorithm_index", + kind: "message", + T: DropNonLinearAlgorithmIndex, + oneof: "query", + }, { no: 8, name: "set", kind: "message", T: Set, oneof: "query" }, { no: 9, name: "del_key", kind: "message", T: DelKey, oneof: "query" }, { no: 10, name: "drop_store", kind: "message", T: DropStore, oneof: "query" }, @@ -162,7 +236,13 @@ export class AIQuery extends Message { { no: 14, name: "list_stores", kind: "message", T: ListStores, oneof: "query" }, { no: 15, name: "purge_stores", kind: "message", T: PurgeStores, oneof: "query" }, { no: 16, name: "ping", kind: "message", T: Ping, oneof: "query" }, - { no: 17, name: "convert_store_input_to_embeddings", kind: "message", T: ConvertStoreInputToEmbeddings, oneof: "query" }, + { + no: 17, + name: "convert_store_input_to_embeddings", + kind: "message", + T: ConvertStoreInputToEmbeddings, + oneof: "query", + }, { no: 18, name: "del_pred", kind: "message", T: DelPred, oneof: "query" }, { no: 19, name: "get_store", kind: "message", T: GetStore, oneof: "query" }, { no: 20, name: "drop_schema", kind: "message", T: DropSchema, oneof: "query" }, @@ -180,7 +260,10 @@ export class AIQuery extends Message { return new AIQuery().fromJsonString(jsonString, options); } - static equals(a: AIQuery | PlainMessage | undefined, b: AIQuery | PlainMessage | undefined): boolean { + static equals( + a: AIQuery | PlainMessage | undefined, + b: AIQuery | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AIQuery, a, b); } } @@ -217,7 +300,10 @@ export class AIRequestPipeline extends Message { return new AIRequestPipeline().fromJsonString(jsonString, options); } - static equals(a: AIRequestPipeline | PlainMessage | undefined, b: AIRequestPipeline | PlainMessage | undefined): boolean { + static equals( + a: AIRequestPipeline | PlainMessage | undefined, + b: AIRequestPipeline | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AIRequestPipeline, a, b); } } @@ -229,85 +315,99 @@ export class AIServerResponse extends Message { /** * @generated from oneof ai.pipeline.AIServerResponse.response */ - response: { - /** - * @generated from field: ai.server.Unit unit = 1; - */ - value: Unit; - case: "unit"; - } | { - /** - * @generated from field: ai.server.Pong pong = 2; - */ - value: Pong; - case: "pong"; - } | { - /** - * @generated from field: ai.server.ClientList client_list = 3; - */ - value: ClientList; - case: "clientList"; - } | { - /** - * @generated from field: ai.server.StoreList store_list = 4; - */ - value: StoreList; - case: "storeList"; - } | { - /** - * @generated from field: ai.server.InfoServer info_server = 5; - */ - value: InfoServer$1; - case: "infoServer"; - } | { - /** - * @generated from field: ai.server.Set set = 6; - */ - value: Set$1; - case: "set"; - } | { - /** - * @generated from field: ai.server.Get get = 7; - */ - value: Get; - case: "get"; - } | { - /** - * @generated from field: ai.server.GetSimN get_sim_n = 8; - */ - value: GetSimN$1; - case: "getSimN"; - } | { - /** - * @generated from field: ai.server.Del del = 9; - */ - value: Del; - case: "del"; - } | { - /** - * @generated from field: ai.server.CreateIndex create_index = 10; - */ - value: CreateIndex; - case: "createIndex"; - } | { - /** - * @generated from field: shared.info.ErrorResponse error = 11; - */ - value: ErrorResponse; - case: "error"; - } | { - /** - * @generated from field: ai.server.StoreInputToEmbeddingsList store_input_to_embeddings_list = 12; - */ - value: StoreInputToEmbeddingsList; - case: "storeInputToEmbeddingsList"; - } | { - /** - * @generated from field: ai.server.AIStoreInfo store_info = 13; - */ - value: AIStoreInfo; - case: "storeInfo"; - } | { case: undefined; value?: undefined } = { case: undefined }; + response: + | { + /** + * @generated from field: ai.server.Unit unit = 1; + */ + value: Unit; + case: "unit"; + } + | { + /** + * @generated from field: ai.server.Pong pong = 2; + */ + value: Pong; + case: "pong"; + } + | { + /** + * @generated from field: ai.server.ClientList client_list = 3; + */ + value: ClientList; + case: "clientList"; + } + | { + /** + * @generated from field: ai.server.StoreList store_list = 4; + */ + value: StoreList; + case: "storeList"; + } + | { + /** + * @generated from field: ai.server.InfoServer info_server = 5; + */ + value: InfoServer$1; + case: "infoServer"; + } + | { + /** + * @generated from field: ai.server.Set set = 6; + */ + value: Set$1; + case: "set"; + } + | { + /** + * @generated from field: ai.server.Get get = 7; + */ + value: Get; + case: "get"; + } + | { + /** + * @generated from field: ai.server.GetSimN get_sim_n = 8; + */ + value: GetSimN$1; + case: "getSimN"; + } + | { + /** + * @generated from field: ai.server.Del del = 9; + */ + value: Del; + case: "del"; + } + | { + /** + * @generated from field: ai.server.CreateIndex create_index = 10; + */ + value: CreateIndex; + case: "createIndex"; + } + | { + /** + * @generated from field: shared.info.ErrorResponse error = 11; + */ + value: ErrorResponse; + case: "error"; + } + | { + /** + * @generated from field: ai.server.StoreInputToEmbeddingsList store_input_to_embeddings_list = 12; + */ + value: StoreInputToEmbeddingsList; + case: "storeInputToEmbeddingsList"; + } + | { + /** + * @generated from field: ai.server.AIStoreInfo store_info = 13; + */ + value: AIStoreInfo; + case: "storeInfo"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -328,7 +428,13 @@ export class AIServerResponse extends Message { { no: 9, name: "del", kind: "message", T: Del, oneof: "response" }, { no: 10, name: "create_index", kind: "message", T: CreateIndex, oneof: "response" }, { no: 11, name: "error", kind: "message", T: ErrorResponse, oneof: "response" }, - { no: 12, name: "store_input_to_embeddings_list", kind: "message", T: StoreInputToEmbeddingsList, oneof: "response" }, + { + no: 12, + name: "store_input_to_embeddings_list", + kind: "message", + T: StoreInputToEmbeddingsList, + oneof: "response", + }, { no: 13, name: "store_info", kind: "message", T: AIStoreInfo, oneof: "response" }, ]); @@ -344,7 +450,10 @@ export class AIServerResponse extends Message { return new AIServerResponse().fromJsonString(jsonString, options); } - static equals(a: AIServerResponse | PlainMessage | undefined, b: AIServerResponse | PlainMessage | undefined): boolean { + static equals( + a: AIServerResponse | PlainMessage | undefined, + b: AIServerResponse | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AIServerResponse, a, b); } } @@ -377,12 +486,17 @@ export class AIResponsePipeline extends Message { return new AIResponsePipeline().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): AIResponsePipeline { + static fromJsonString( + jsonString: string, + options?: Partial, + ): AIResponsePipeline { return new AIResponsePipeline().fromJsonString(jsonString, options); } - static equals(a: AIResponsePipeline | PlainMessage | undefined, b: AIResponsePipeline | PlainMessage | undefined): boolean { + static equals( + a: AIResponsePipeline | PlainMessage | undefined, + b: AIResponsePipeline | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AIResponsePipeline, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts b/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts index 1fe496e4b..43262a11d 100644 --- a/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/preprocess_pb.ts @@ -24,4 +24,3 @@ proto3.util.setEnumType(PreprocessAction, "ai.preprocess.PreprocessAction", [ { no: 0, name: "NoPreprocessing" }, { no: 1, name: "ModelPreprocessing" }, ]); - diff --git a/sdk/ahnlich-client-node/grpc/ai/query_pb.ts b/sdk/ahnlich-client-node/grpc/ai/query_pb.ts index cd3a91bdc..cad629d2e 100644 --- a/sdk/ahnlich-client-node/grpc/ai/query_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/query_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { AIModel } from "./models_pb.js"; import { NonLinearAlgorithm, NonLinearIndex } from "../algorithm/nonlinear_pb.js"; @@ -110,7 +117,10 @@ export class CreateStore extends Message { return new CreateStore().fromJsonString(jsonString, options); } - static equals(a: CreateStore | PlainMessage | undefined, b: CreateStore | PlainMessage | undefined): boolean { + static equals( + a: CreateStore | PlainMessage | undefined, + b: CreateStore | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreateStore, a, b); } } @@ -160,7 +170,10 @@ export class GetPred extends Message { return new GetPred().fromJsonString(jsonString, options); } - static equals(a: GetPred | PlainMessage | undefined, b: GetPred | PlainMessage | undefined): boolean { + static equals( + a: GetPred | PlainMessage | undefined, + b: GetPred | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetPred, a, b); } } @@ -241,8 +254,20 @@ export class GetSimN extends Message { { no: 4, name: "closest_n", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 5, name: "algorithm", kind: "enum", T: proto3.getEnumType(Algorithm) }, { no: 6, name: "preprocess_action", kind: "enum", T: proto3.getEnumType(PreprocessAction) }, - { no: 7, name: "execution_provider", kind: "enum", T: proto3.getEnumType(ExecutionProvider), opt: true }, - { no: 8, name: "model_params", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { + no: 7, + name: "execution_provider", + kind: "enum", + T: proto3.getEnumType(ExecutionProvider), + opt: true, + }, + { + no: 8, + name: "model_params", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSimN { @@ -257,7 +282,10 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { + static equals( + a: GetSimN | PlainMessage | undefined, + b: GetSimN | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -306,7 +334,10 @@ export class CreatePredIndex extends Message { return new CreatePredIndex().fromJsonString(jsonString, options); } - static equals(a: CreatePredIndex | PlainMessage | undefined, b: CreatePredIndex | PlainMessage | undefined): boolean { + static equals( + a: CreatePredIndex | PlainMessage | undefined, + b: CreatePredIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreatePredIndex, a, b); } } @@ -343,19 +374,31 @@ export class CreateNonLinearAlgorithmIndex extends Message): CreateNonLinearAlgorithmIndex { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): CreateNonLinearAlgorithmIndex { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): CreateNonLinearAlgorithmIndex { + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals(a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { + static equals( + a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, + b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreateNonLinearAlgorithmIndex, a, b); } } @@ -413,7 +456,10 @@ export class DropPredIndex extends Message { return new DropPredIndex().fromJsonString(jsonString, options); } - static equals(a: DropPredIndex | PlainMessage | undefined, b: DropPredIndex | PlainMessage | undefined): boolean { + static equals( + a: DropPredIndex | PlainMessage | undefined, + b: DropPredIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropPredIndex, a, b); } } @@ -455,23 +501,41 @@ export class DropNonLinearAlgorithmIndex extends Message [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "non_linear_indices", kind: "enum", T: proto3.getEnumType(NonLinearAlgorithm), repeated: true }, + { + no: 2, + name: "non_linear_indices", + kind: "enum", + T: proto3.getEnumType(NonLinearAlgorithm), + repeated: true, + }, { no: 3, name: "error_if_not_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): DropNonLinearAlgorithmIndex { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): DropNonLinearAlgorithmIndex { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): DropNonLinearAlgorithmIndex { + static fromJsonString( + jsonString: string, + options?: Partial, + ): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals(a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, b: DropNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { + static equals( + a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, + b: DropNonLinearAlgorithmIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropNonLinearAlgorithmIndex, a, b); } } @@ -521,7 +585,10 @@ export class DelKey extends Message { return new DelKey().fromJsonString(jsonString, options); } - static equals(a: DelKey | PlainMessage | undefined, b: DelKey | PlainMessage | undefined): boolean { + static equals( + a: DelKey | PlainMessage | undefined, + b: DelKey | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DelKey, a, b); } } @@ -572,7 +639,10 @@ export class DelPred extends Message { return new DelPred().fromJsonString(jsonString, options); } - static equals(a: DelPred | PlainMessage | undefined, b: DelPred | PlainMessage | undefined): boolean { + static equals( + a: DelPred | PlainMessage | undefined, + b: DelPred | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DelPred, a, b); } } @@ -630,7 +700,10 @@ export class DropStore extends Message { return new DropStore().fromJsonString(jsonString, options); } - static equals(a: DropStore | PlainMessage | undefined, b: DropStore | PlainMessage | undefined): boolean { + static equals( + a: DropStore | PlainMessage | undefined, + b: DropStore | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropStore, a, b); } } @@ -679,7 +752,10 @@ export class GetKey extends Message { return new GetKey().fromJsonString(jsonString, options); } - static equals(a: GetKey | PlainMessage | undefined, b: GetKey | PlainMessage | undefined): boolean { + static equals( + a: GetKey | PlainMessage | undefined, + b: GetKey | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetKey, a, b); } } @@ -697,8 +773,7 @@ export class InfoServer extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.InfoServer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): InfoServer { return new InfoServer().fromBinary(bytes, options); @@ -712,7 +787,10 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { + static equals( + a: InfoServer | PlainMessage | undefined, + b: InfoServer | PlainMessage | undefined, + ): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -730,8 +808,7 @@ export class ListClients extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.ListClients"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): ListClients { return new ListClients().fromBinary(bytes, options); @@ -745,7 +822,10 @@ export class ListClients extends Message { return new ListClients().fromJsonString(jsonString, options); } - static equals(a: ListClients | PlainMessage | undefined, b: ListClients | PlainMessage | undefined): boolean { + static equals( + a: ListClients | PlainMessage | undefined, + b: ListClients | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ListClients, a, b); } } @@ -786,7 +866,10 @@ export class ListStores extends Message { return new ListStores().fromJsonString(jsonString, options); } - static equals(a: ListStores | PlainMessage | undefined, b: ListStores | PlainMessage | undefined): boolean { + static equals( + a: ListStores | PlainMessage | undefined, + b: ListStores | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ListStores, a, b); } } @@ -835,7 +918,10 @@ export class GetStore extends Message { return new GetStore().fromJsonString(jsonString, options); } - static equals(a: GetStore | PlainMessage | undefined, b: GetStore | PlainMessage | undefined): boolean { + static equals( + a: GetStore | PlainMessage | undefined, + b: GetStore | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetStore, a, b); } } @@ -876,7 +962,10 @@ export class DropSchema extends Message { return new DropSchema().fromJsonString(jsonString, options); } - static equals(a: DropSchema | PlainMessage | undefined, b: DropSchema | PlainMessage | undefined): boolean { + static equals( + a: DropSchema | PlainMessage | undefined, + b: DropSchema | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropSchema, a, b); } } @@ -894,8 +983,7 @@ export class PurgeStores extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.PurgeStores"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): PurgeStores { return new PurgeStores().fromBinary(bytes, options); @@ -909,7 +997,10 @@ export class PurgeStores extends Message { return new PurgeStores().fromJsonString(jsonString, options); } - static equals(a: PurgeStores | PlainMessage | undefined, b: PurgeStores | PlainMessage | undefined): boolean { + static equals( + a: PurgeStores | PlainMessage | undefined, + b: PurgeStores | PlainMessage | undefined, + ): boolean { return proto3.util.equals(PurgeStores, a, b); } } @@ -927,8 +1018,7 @@ export class Ping extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.query.Ping"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): Ping { return new Ping().fromBinary(bytes, options); @@ -942,7 +1032,10 @@ export class Ping extends Message { return new Ping().fromJsonString(jsonString, options); } - static equals(a: Ping | PlainMessage | undefined, b: Ping | PlainMessage | undefined): boolean { + static equals( + a: Ping | PlainMessage | undefined, + b: Ping | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Ping, a, b); } } @@ -1000,8 +1093,20 @@ export class Set extends Message { { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "inputs", kind: "message", T: AiStoreEntry, repeated: true }, { no: 3, name: "preprocess_action", kind: "enum", T: proto3.getEnumType(PreprocessAction) }, - { no: 4, name: "execution_provider", kind: "enum", T: proto3.getEnumType(ExecutionProvider), opt: true }, - { no: 5, name: "model_params", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { + no: 4, + name: "execution_provider", + kind: "enum", + T: proto3.getEnumType(ExecutionProvider), + opt: true, + }, + { + no: 5, + name: "model_params", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Set { @@ -1016,7 +1121,10 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { + static equals( + a: Set | PlainMessage | undefined, + b: Set | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Set, a, b); } } @@ -1064,25 +1172,48 @@ export class ConvertStoreInputToEmbeddings extends Message [ { no: 1, name: "store_inputs", kind: "message", T: StoreInput, repeated: true }, - { no: 2, name: "preprocess_action", kind: "enum", T: proto3.getEnumType(PreprocessAction), opt: true }, + { + no: 2, + name: "preprocess_action", + kind: "enum", + T: proto3.getEnumType(PreprocessAction), + opt: true, + }, { no: 3, name: "model", kind: "enum", T: proto3.getEnumType(AIModel) }, - { no: 4, name: "model_params", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { + no: 4, + name: "model_params", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): ConvertStoreInputToEmbeddings { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): ConvertStoreInputToEmbeddings { return new ConvertStoreInputToEmbeddings().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): ConvertStoreInputToEmbeddings { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): ConvertStoreInputToEmbeddings { return new ConvertStoreInputToEmbeddings().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): ConvertStoreInputToEmbeddings { + static fromJsonString( + jsonString: string, + options?: Partial, + ): ConvertStoreInputToEmbeddings { return new ConvertStoreInputToEmbeddings().fromJsonString(jsonString, options); } - static equals(a: ConvertStoreInputToEmbeddings | PlainMessage | undefined, b: ConvertStoreInputToEmbeddings | PlainMessage | undefined): boolean { + static equals( + a: ConvertStoreInputToEmbeddings | PlainMessage | undefined, + b: ConvertStoreInputToEmbeddings | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ConvertStoreInputToEmbeddings, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/ai/server_pb.ts b/sdk/ahnlich-client-node/grpc/ai/server_pb.ts index 1002aae6c..35eb22f0e 100644 --- a/sdk/ahnlich-client-node/grpc/ai/server_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/server_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ConnectedClient } from "../client_pb.js"; import { ServerInfo, StoreUpsert } from "../shared/info_pb.js"; @@ -23,8 +30,7 @@ export class Unit extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.server.Unit"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): Unit { return new Unit().fromBinary(bytes, options); @@ -38,7 +44,10 @@ export class Unit extends Message { return new Unit().fromJsonString(jsonString, options); } - static equals(a: Unit | PlainMessage | undefined, b: Unit | PlainMessage | undefined): boolean { + static equals( + a: Unit | PlainMessage | undefined, + b: Unit | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Unit, a, b); } } @@ -54,8 +63,7 @@ export class Pong extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ai.server.Pong"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): Pong { return new Pong().fromBinary(bytes, options); @@ -69,7 +77,10 @@ export class Pong extends Message { return new Pong().fromJsonString(jsonString, options); } - static equals(a: Pong | PlainMessage | undefined, b: Pong | PlainMessage | undefined): boolean { + static equals( + a: Pong | PlainMessage | undefined, + b: Pong | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Pong, a, b); } } @@ -106,7 +117,10 @@ export class ClientList extends Message { return new ClientList().fromJsonString(jsonString, options); } - static equals(a: ClientList | PlainMessage | undefined, b: ClientList | PlainMessage | undefined): boolean { + static equals( + a: ClientList | PlainMessage | undefined, + b: ClientList | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ClientList, a, b); } } @@ -143,7 +157,10 @@ export class StoreList extends Message { return new StoreList().fromJsonString(jsonString, options); } - static equals(a: StoreList | PlainMessage | undefined, b: StoreList | PlainMessage | undefined): boolean { + static equals( + a: StoreList | PlainMessage | undefined, + b: StoreList | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreList, a, b); } } @@ -180,7 +197,10 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { + static equals( + a: InfoServer | PlainMessage | undefined, + b: InfoServer | PlainMessage | undefined, + ): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -217,7 +237,10 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { + static equals( + a: Set | PlainMessage | undefined, + b: Set | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Set, a, b); } } @@ -260,7 +283,10 @@ export class GetEntry extends Message { return new GetEntry().fromJsonString(jsonString, options); } - static equals(a: GetEntry | PlainMessage | undefined, b: GetEntry | PlainMessage | undefined): boolean { + static equals( + a: GetEntry | PlainMessage | undefined, + b: GetEntry | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetEntry, a, b); } } @@ -297,7 +323,10 @@ export class Get extends Message { return new Get().fromJsonString(jsonString, options); } - static equals(a: Get | PlainMessage | undefined, b: Get | PlainMessage | undefined): boolean { + static equals( + a: Get | PlainMessage | undefined, + b: Get | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Get, a, b); } } @@ -346,7 +375,10 @@ export class GetSimNEntry extends Message { return new GetSimNEntry().fromJsonString(jsonString, options); } - static equals(a: GetSimNEntry | PlainMessage | undefined, b: GetSimNEntry | PlainMessage | undefined): boolean { + static equals( + a: GetSimNEntry | PlainMessage | undefined, + b: GetSimNEntry | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetSimNEntry, a, b); } } @@ -383,7 +415,10 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { + static equals( + a: GetSimN | PlainMessage | undefined, + b: GetSimN | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -420,7 +455,10 @@ export class Del extends Message { return new Del().fromJsonString(jsonString, options); } - static equals(a: Del | PlainMessage | undefined, b: Del | PlainMessage | undefined): boolean { + static equals( + a: Del | PlainMessage | undefined, + b: Del | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Del, a, b); } } @@ -457,7 +495,10 @@ export class CreateIndex extends Message { return new CreateIndex().fromJsonString(jsonString, options); } - static equals(a: CreateIndex | PlainMessage | undefined, b: CreateIndex | PlainMessage | undefined): boolean { + static equals( + a: CreateIndex | PlainMessage | undefined, + b: CreateIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreateIndex, a, b); } } @@ -513,7 +554,13 @@ export class AIStoreInfo extends Message { { no: 2, name: "query_model", kind: "enum", T: proto3.getEnumType(AIModel) }, { no: 3, name: "index_model", kind: "enum", T: proto3.getEnumType(AIModel) }, { no: 4, name: "embedding_size", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 5, name: "predicate_indices", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { + no: 5, + name: "predicate_indices", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, { no: 6, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 7, name: "db_info", kind: "message", T: StoreInfo, opt: true }, ]); @@ -530,7 +577,10 @@ export class AIStoreInfo extends Message { return new AIStoreInfo().fromJsonString(jsonString, options); } - static equals(a: AIStoreInfo | PlainMessage | undefined, b: AIStoreInfo | PlainMessage | undefined): boolean { + static equals( + a: AIStoreInfo | PlainMessage | undefined, + b: AIStoreInfo | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AIStoreInfo, a, b); } } @@ -561,7 +611,10 @@ export class EmbeddingWithMetadata extends Message { { no: 2, name: "metadata", kind: "message", T: StoreValue, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): EmbeddingWithMetadata { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): EmbeddingWithMetadata { return new EmbeddingWithMetadata().fromBinary(bytes, options); } @@ -569,11 +622,17 @@ export class EmbeddingWithMetadata extends Message { return new EmbeddingWithMetadata().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): EmbeddingWithMetadata { + static fromJsonString( + jsonString: string, + options?: Partial, + ): EmbeddingWithMetadata { return new EmbeddingWithMetadata().fromJsonString(jsonString, options); } - static equals(a: EmbeddingWithMetadata | PlainMessage | undefined, b: EmbeddingWithMetadata | PlainMessage | undefined): boolean { + static equals( + a: EmbeddingWithMetadata | PlainMessage | undefined, + b: EmbeddingWithMetadata | PlainMessage | undefined, + ): boolean { return proto3.util.equals(EmbeddingWithMetadata, a, b); } } @@ -610,7 +669,10 @@ export class MultipleEmbedding extends Message { return new MultipleEmbedding().fromJsonString(jsonString, options); } - static equals(a: MultipleEmbedding | PlainMessage | undefined, b: MultipleEmbedding | PlainMessage | undefined): boolean { + static equals( + a: MultipleEmbedding | PlainMessage | undefined, + b: MultipleEmbedding | PlainMessage | undefined, + ): boolean { return proto3.util.equals(MultipleEmbedding, a, b); } } @@ -627,19 +689,22 @@ export class SingleInputToEmbedding extends Message { /** * @generated from oneof ai.server.SingleInputToEmbedding.variant */ - variant: { - /** - * @generated from field: ai.server.MultipleEmbedding multiple = 2; - */ - value: MultipleEmbedding; - case: "multiple"; - } | { - /** - * @generated from field: ai.server.EmbeddingWithMetadata single = 3; - */ - value: EmbeddingWithMetadata; - case: "single"; - } | { case: undefined; value?: undefined } = { case: undefined }; + variant: + | { + /** + * @generated from field: ai.server.MultipleEmbedding multiple = 2; + */ + value: MultipleEmbedding; + case: "multiple"; + } + | { + /** + * @generated from field: ai.server.EmbeddingWithMetadata single = 3; + */ + value: EmbeddingWithMetadata; + case: "single"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -654,19 +719,31 @@ export class SingleInputToEmbedding extends Message { { no: 3, name: "single", kind: "message", T: EmbeddingWithMetadata, oneof: "variant" }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): SingleInputToEmbedding { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): SingleInputToEmbedding { return new SingleInputToEmbedding().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): SingleInputToEmbedding { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): SingleInputToEmbedding { return new SingleInputToEmbedding().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): SingleInputToEmbedding { + static fromJsonString( + jsonString: string, + options?: Partial, + ): SingleInputToEmbedding { return new SingleInputToEmbedding().fromJsonString(jsonString, options); } - static equals(a: SingleInputToEmbedding | PlainMessage | undefined, b: SingleInputToEmbedding | PlainMessage | undefined): boolean { + static equals( + a: SingleInputToEmbedding | PlainMessage | undefined, + b: SingleInputToEmbedding | PlainMessage | undefined, + ): boolean { return proto3.util.equals(SingleInputToEmbedding, a, b); } } @@ -691,20 +768,31 @@ export class StoreInputToEmbeddingsList extends Message): StoreInputToEmbeddingsList { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): StoreInputToEmbeddingsList { return new StoreInputToEmbeddingsList().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): StoreInputToEmbeddingsList { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): StoreInputToEmbeddingsList { return new StoreInputToEmbeddingsList().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): StoreInputToEmbeddingsList { + static fromJsonString( + jsonString: string, + options?: Partial, + ): StoreInputToEmbeddingsList { return new StoreInputToEmbeddingsList().fromJsonString(jsonString, options); } - static equals(a: StoreInputToEmbeddingsList | PlainMessage | undefined, b: StoreInputToEmbeddingsList | PlainMessage | undefined): boolean { + static equals( + a: StoreInputToEmbeddingsList | PlainMessage | undefined, + b: StoreInputToEmbeddingsList | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreInputToEmbeddingsList, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts b/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts index 329010f94..f750689e6 100644 --- a/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts +++ b/sdk/ahnlich-client-node/grpc/algorithm/algorithm_pb.ts @@ -68,4 +68,3 @@ proto3.util.setEnumType(DistanceMetric, "algorithm.algorithms.DistanceMetric", [ { no: 1, name: "DotProduct" }, { no: 2, name: "Cosine" }, ]); - diff --git a/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts b/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts index 6092e12f7..6f772961f 100644 --- a/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts +++ b/sdk/ahnlich-client-node/grpc/algorithm/nonlinear_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import { DistanceMetric } from "./algorithm_pb.js"; @@ -71,10 +78,28 @@ export class HNSWConfig extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "distance", kind: "enum", T: proto3.getEnumType(DistanceMetric), opt: true }, { no: 2, name: "ef_construction", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 3, name: "maximum_connections", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 4, name: "maximum_connections_zero", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + { + no: 3, + name: "maximum_connections", + kind: "scalar", + T: 13 /* ScalarType.UINT32 */, + opt: true, + }, + { + no: 4, + name: "maximum_connections_zero", + kind: "scalar", + T: 13 /* ScalarType.UINT32 */, + opt: true, + }, { no: 5, name: "extend_candidates", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 6, name: "keep_pruned_connections", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { + no: 6, + name: "keep_pruned_connections", + kind: "scalar", + T: 8 /* ScalarType.BOOL */, + opt: true, + }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): HNSWConfig { @@ -89,7 +114,10 @@ export class HNSWConfig extends Message { return new HNSWConfig().fromJsonString(jsonString, options); } - static equals(a: HNSWConfig | PlainMessage | undefined, b: HNSWConfig | PlainMessage | undefined): boolean { + static equals( + a: HNSWConfig | PlainMessage | undefined, + b: HNSWConfig | PlainMessage | undefined, + ): boolean { return proto3.util.equals(HNSWConfig, a, b); } } @@ -105,8 +133,7 @@ export class KDTreeConfig extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "algorithm.nonlinear.KDTreeConfig"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): KDTreeConfig { return new KDTreeConfig().fromBinary(bytes, options); @@ -120,7 +147,10 @@ export class KDTreeConfig extends Message { return new KDTreeConfig().fromJsonString(jsonString, options); } - static equals(a: KDTreeConfig | PlainMessage | undefined, b: KDTreeConfig | PlainMessage | undefined): boolean { + static equals( + a: KDTreeConfig | PlainMessage | undefined, + b: KDTreeConfig | PlainMessage | undefined, + ): boolean { return proto3.util.equals(KDTreeConfig, a, b); } } @@ -132,19 +162,22 @@ export class NonLinearIndex extends Message { /** * @generated from oneof algorithm.nonlinear.NonLinearIndex.index */ - index: { - /** - * @generated from field: algorithm.nonlinear.HNSWConfig hnsw = 1; - */ - value: HNSWConfig; - case: "hnsw"; - } | { - /** - * @generated from field: algorithm.nonlinear.KDTreeConfig kdtree = 2; - */ - value: KDTreeConfig; - case: "kdtree"; - } | { case: undefined; value?: undefined } = { case: undefined }; + index: + | { + /** + * @generated from field: algorithm.nonlinear.HNSWConfig hnsw = 1; + */ + value: HNSWConfig; + case: "hnsw"; + } + | { + /** + * @generated from field: algorithm.nonlinear.KDTreeConfig kdtree = 2; + */ + value: KDTreeConfig; + case: "kdtree"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -170,8 +203,10 @@ export class NonLinearIndex extends Message { return new NonLinearIndex().fromJsonString(jsonString, options); } - static equals(a: NonLinearIndex | PlainMessage | undefined, b: NonLinearIndex | PlainMessage | undefined): boolean { + static equals( + a: NonLinearIndex | PlainMessage | undefined, + b: NonLinearIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(NonLinearIndex, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/client_pb.ts b/sdk/ahnlich-client-node/grpc/client_pb.ts index 2743f9a0d..f9e655ab9 100644 --- a/sdk/ahnlich-client-node/grpc/client_pb.ts +++ b/sdk/ahnlich-client-node/grpc/client_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -44,8 +51,10 @@ export class ConnectedClient extends Message { return new ConnectedClient().fromJsonString(jsonString, options); } - static equals(a: ConnectedClient | PlainMessage | undefined, b: ConnectedClient | PlainMessage | undefined): boolean { + static equals( + a: ConnectedClient | PlainMessage | undefined, + b: ConnectedClient | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ConnectedClient, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts b/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts index 78f6a94cc..f92ef33cd 100644 --- a/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts @@ -3,10 +3,48 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, Set } from "./query_pb.js"; -import { ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInfo, StoreList, Unit } from "./server_pb.js"; +import { + CreateNonLinearAlgorithmIndex, + CreatePredIndex, + CreateStore, + DelKey, + DelPred, + DropNonLinearAlgorithmIndex, + DropPredIndex, + DropSchema, + DropStore, + GetKey, + GetPred, + GetSimN, + GetStore, + InfoServer, + ListClients, + ListStores, + Ping, + Set, +} from "./query_pb.js"; +import { + ClientList, + CreateIndex, + Del, + Get, + GetSimN as GetSimN$1, + InfoServer as InfoServer$1, + Pong, + Set as Set$1, + StoreInfo, + StoreList, + Unit, +} from "./server_pb.js"; import { ErrorResponse } from "../shared/info_pb.js"; /** @@ -16,115 +54,134 @@ export class DBQuery extends Message { /** * @generated from oneof db.pipeline.DBQuery.query */ - query: { - /** - * @generated from field: db.query.CreateStore create_store = 1; - */ - value: CreateStore; - case: "createStore"; - } | { - /** - * @generated from field: db.query.GetKey get_key = 2; - */ - value: GetKey; - case: "getKey"; - } | { - /** - * @generated from field: db.query.GetPred get_pred = 3; - */ - value: GetPred; - case: "getPred"; - } | { - /** - * @generated from field: db.query.GetSimN get_sim_n = 4; - */ - value: GetSimN; - case: "getSimN"; - } | { - /** - * @generated from field: db.query.CreatePredIndex create_pred_index = 5; - */ - value: CreatePredIndex; - case: "createPredIndex"; - } | { - /** - * @generated from field: db.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 6; - */ - value: CreateNonLinearAlgorithmIndex; - case: "createNonLinearAlgorithmIndex"; - } | { - /** - * @generated from field: db.query.DropPredIndex drop_pred_index = 7; - */ - value: DropPredIndex; - case: "dropPredIndex"; - } | { - /** - * @generated from field: db.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 8; - */ - value: DropNonLinearAlgorithmIndex; - case: "dropNonLinearAlgorithmIndex"; - } | { - /** - * @generated from field: db.query.Set set = 9; - */ - value: Set; - case: "set"; - } | { - /** - * @generated from field: db.query.DelKey del_key = 10; - */ - value: DelKey; - case: "delKey"; - } | { - /** - * @generated from field: db.query.DelPred del_pred = 11; - */ - value: DelPred; - case: "delPred"; - } | { - /** - * @generated from field: db.query.DropStore drop_store = 12; - */ - value: DropStore; - case: "dropStore"; - } | { - /** - * @generated from field: db.query.InfoServer info_server = 13; - */ - value: InfoServer; - case: "infoServer"; - } | { - /** - * @generated from field: db.query.ListStores list_stores = 14; - */ - value: ListStores; - case: "listStores"; - } | { - /** - * @generated from field: db.query.ListClients list_clients = 15; - */ - value: ListClients; - case: "listClients"; - } | { - /** - * @generated from field: db.query.Ping ping = 16; - */ - value: Ping; - case: "ping"; - } | { - /** - * @generated from field: db.query.GetStore get_store = 17; - */ - value: GetStore; - case: "getStore"; - } | { - /** - * @generated from field: db.query.DropSchema drop_schema = 18; - */ - value: DropSchema; - case: "dropSchema"; - } | { case: undefined; value?: undefined } = { case: undefined }; + query: + | { + /** + * @generated from field: db.query.CreateStore create_store = 1; + */ + value: CreateStore; + case: "createStore"; + } + | { + /** + * @generated from field: db.query.GetKey get_key = 2; + */ + value: GetKey; + case: "getKey"; + } + | { + /** + * @generated from field: db.query.GetPred get_pred = 3; + */ + value: GetPred; + case: "getPred"; + } + | { + /** + * @generated from field: db.query.GetSimN get_sim_n = 4; + */ + value: GetSimN; + case: "getSimN"; + } + | { + /** + * @generated from field: db.query.CreatePredIndex create_pred_index = 5; + */ + value: CreatePredIndex; + case: "createPredIndex"; + } + | { + /** + * @generated from field: db.query.CreateNonLinearAlgorithmIndex create_non_linear_algorithm_index = 6; + */ + value: CreateNonLinearAlgorithmIndex; + case: "createNonLinearAlgorithmIndex"; + } + | { + /** + * @generated from field: db.query.DropPredIndex drop_pred_index = 7; + */ + value: DropPredIndex; + case: "dropPredIndex"; + } + | { + /** + * @generated from field: db.query.DropNonLinearAlgorithmIndex drop_non_linear_algorithm_index = 8; + */ + value: DropNonLinearAlgorithmIndex; + case: "dropNonLinearAlgorithmIndex"; + } + | { + /** + * @generated from field: db.query.Set set = 9; + */ + value: Set; + case: "set"; + } + | { + /** + * @generated from field: db.query.DelKey del_key = 10; + */ + value: DelKey; + case: "delKey"; + } + | { + /** + * @generated from field: db.query.DelPred del_pred = 11; + */ + value: DelPred; + case: "delPred"; + } + | { + /** + * @generated from field: db.query.DropStore drop_store = 12; + */ + value: DropStore; + case: "dropStore"; + } + | { + /** + * @generated from field: db.query.InfoServer info_server = 13; + */ + value: InfoServer; + case: "infoServer"; + } + | { + /** + * @generated from field: db.query.ListStores list_stores = 14; + */ + value: ListStores; + case: "listStores"; + } + | { + /** + * @generated from field: db.query.ListClients list_clients = 15; + */ + value: ListClients; + case: "listClients"; + } + | { + /** + * @generated from field: db.query.Ping ping = 16; + */ + value: Ping; + case: "ping"; + } + | { + /** + * @generated from field: db.query.GetStore get_store = 17; + */ + value: GetStore; + case: "getStore"; + } + | { + /** + * @generated from field: db.query.DropSchema drop_schema = 18; + */ + value: DropSchema; + case: "dropSchema"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -139,9 +196,21 @@ export class DBQuery extends Message { { no: 3, name: "get_pred", kind: "message", T: GetPred, oneof: "query" }, { no: 4, name: "get_sim_n", kind: "message", T: GetSimN, oneof: "query" }, { no: 5, name: "create_pred_index", kind: "message", T: CreatePredIndex, oneof: "query" }, - { no: 6, name: "create_non_linear_algorithm_index", kind: "message", T: CreateNonLinearAlgorithmIndex, oneof: "query" }, + { + no: 6, + name: "create_non_linear_algorithm_index", + kind: "message", + T: CreateNonLinearAlgorithmIndex, + oneof: "query", + }, { no: 7, name: "drop_pred_index", kind: "message", T: DropPredIndex, oneof: "query" }, - { no: 8, name: "drop_non_linear_algorithm_index", kind: "message", T: DropNonLinearAlgorithmIndex, oneof: "query" }, + { + no: 8, + name: "drop_non_linear_algorithm_index", + kind: "message", + T: DropNonLinearAlgorithmIndex, + oneof: "query", + }, { no: 9, name: "set", kind: "message", T: Set, oneof: "query" }, { no: 10, name: "del_key", kind: "message", T: DelKey, oneof: "query" }, { no: 11, name: "del_pred", kind: "message", T: DelPred, oneof: "query" }, @@ -166,7 +235,10 @@ export class DBQuery extends Message { return new DBQuery().fromJsonString(jsonString, options); } - static equals(a: DBQuery | PlainMessage | undefined, b: DBQuery | PlainMessage | undefined): boolean { + static equals( + a: DBQuery | PlainMessage | undefined, + b: DBQuery | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DBQuery, a, b); } } @@ -203,7 +275,10 @@ export class DBRequestPipeline extends Message { return new DBRequestPipeline().fromJsonString(jsonString, options); } - static equals(a: DBRequestPipeline | PlainMessage | undefined, b: DBRequestPipeline | PlainMessage | undefined): boolean { + static equals( + a: DBRequestPipeline | PlainMessage | undefined, + b: DBRequestPipeline | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DBRequestPipeline, a, b); } } @@ -215,79 +290,92 @@ export class DBServerResponse extends Message { /** * @generated from oneof db.pipeline.DBServerResponse.response */ - response: { - /** - * @generated from field: db.server.Unit unit = 1; - */ - value: Unit; - case: "unit"; - } | { - /** - * @generated from field: db.server.Pong pong = 2; - */ - value: Pong; - case: "pong"; - } | { - /** - * @generated from field: db.server.ClientList client_list = 3; - */ - value: ClientList; - case: "clientList"; - } | { - /** - * @generated from field: db.server.StoreList store_list = 4; - */ - value: StoreList; - case: "storeList"; - } | { - /** - * @generated from field: db.server.InfoServer info_server = 5; - */ - value: InfoServer$1; - case: "infoServer"; - } | { - /** - * @generated from field: db.server.Set set = 6; - */ - value: Set$1; - case: "set"; - } | { - /** - * @generated from field: db.server.Get get = 7; - */ - value: Get; - case: "get"; - } | { - /** - * @generated from field: db.server.GetSimN get_sim_n = 8; - */ - value: GetSimN$1; - case: "getSimN"; - } | { - /** - * @generated from field: db.server.Del del = 9; - */ - value: Del; - case: "del"; - } | { - /** - * @generated from field: db.server.CreateIndex create_index = 10; - */ - value: CreateIndex; - case: "createIndex"; - } | { - /** - * @generated from field: shared.info.ErrorResponse error = 11; - */ - value: ErrorResponse; - case: "error"; - } | { - /** - * @generated from field: db.server.StoreInfo store_info = 12; - */ - value: StoreInfo; - case: "storeInfo"; - } | { case: undefined; value?: undefined } = { case: undefined }; + response: + | { + /** + * @generated from field: db.server.Unit unit = 1; + */ + value: Unit; + case: "unit"; + } + | { + /** + * @generated from field: db.server.Pong pong = 2; + */ + value: Pong; + case: "pong"; + } + | { + /** + * @generated from field: db.server.ClientList client_list = 3; + */ + value: ClientList; + case: "clientList"; + } + | { + /** + * @generated from field: db.server.StoreList store_list = 4; + */ + value: StoreList; + case: "storeList"; + } + | { + /** + * @generated from field: db.server.InfoServer info_server = 5; + */ + value: InfoServer$1; + case: "infoServer"; + } + | { + /** + * @generated from field: db.server.Set set = 6; + */ + value: Set$1; + case: "set"; + } + | { + /** + * @generated from field: db.server.Get get = 7; + */ + value: Get; + case: "get"; + } + | { + /** + * @generated from field: db.server.GetSimN get_sim_n = 8; + */ + value: GetSimN$1; + case: "getSimN"; + } + | { + /** + * @generated from field: db.server.Del del = 9; + */ + value: Del; + case: "del"; + } + | { + /** + * @generated from field: db.server.CreateIndex create_index = 10; + */ + value: CreateIndex; + case: "createIndex"; + } + | { + /** + * @generated from field: shared.info.ErrorResponse error = 11; + */ + value: ErrorResponse; + case: "error"; + } + | { + /** + * @generated from field: db.server.StoreInfo store_info = 12; + */ + value: StoreInfo; + case: "storeInfo"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -323,7 +411,10 @@ export class DBServerResponse extends Message { return new DBServerResponse().fromJsonString(jsonString, options); } - static equals(a: DBServerResponse | PlainMessage | undefined, b: DBServerResponse | PlainMessage | undefined): boolean { + static equals( + a: DBServerResponse | PlainMessage | undefined, + b: DBServerResponse | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DBServerResponse, a, b); } } @@ -356,12 +447,17 @@ export class DBResponsePipeline extends Message { return new DBResponsePipeline().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): DBResponsePipeline { + static fromJsonString( + jsonString: string, + options?: Partial, + ): DBResponsePipeline { return new DBResponsePipeline().fromJsonString(jsonString, options); } - static equals(a: DBResponsePipeline | PlainMessage | undefined, b: DBResponsePipeline | PlainMessage | undefined): boolean { + static equals( + a: DBResponsePipeline | PlainMessage | undefined, + b: DBResponsePipeline | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DBResponsePipeline, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/db/query_pb.ts b/sdk/ahnlich-client-node/grpc/db/query_pb.ts index d09502dd9..00a82d351 100644 --- a/sdk/ahnlich-client-node/grpc/db/query_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/query_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { NonLinearAlgorithm, NonLinearIndex } from "../algorithm/nonlinear_pb.js"; import { DbStoreEntry, StoreKey } from "../keyval_pb.js"; @@ -69,7 +76,13 @@ export class CreateStore extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "create_predicates", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { + no: 3, + name: "create_predicates", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, { no: 4, name: "non_linear_indices", kind: "message", T: NonLinearIndex, repeated: true }, { no: 5, name: "error_if_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 6, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, @@ -87,7 +100,10 @@ export class CreateStore extends Message { return new CreateStore().fromJsonString(jsonString, options); } - static equals(a: CreateStore | PlainMessage | undefined, b: CreateStore | PlainMessage | undefined): boolean { + static equals( + a: CreateStore | PlainMessage | undefined, + b: CreateStore | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreateStore, a, b); } } @@ -136,7 +152,10 @@ export class GetKey extends Message { return new GetKey().fromJsonString(jsonString, options); } - static equals(a: GetKey | PlainMessage | undefined, b: GetKey | PlainMessage | undefined): boolean { + static equals( + a: GetKey | PlainMessage | undefined, + b: GetKey | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetKey, a, b); } } @@ -185,7 +204,10 @@ export class GetPred extends Message { return new GetPred().fromJsonString(jsonString, options); } - static equals(a: GetPred | PlainMessage | undefined, b: GetPred | PlainMessage | undefined): boolean { + static equals( + a: GetPred | PlainMessage | undefined, + b: GetPred | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetPred, a, b); } } @@ -260,7 +282,10 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { + static equals( + a: GetSimN | PlainMessage | undefined, + b: GetSimN | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -310,7 +335,10 @@ export class CreatePredIndex extends Message { return new CreatePredIndex().fromJsonString(jsonString, options); } - static equals(a: CreatePredIndex | PlainMessage | undefined, b: CreatePredIndex | PlainMessage | undefined): boolean { + static equals( + a: CreatePredIndex | PlainMessage | undefined, + b: CreatePredIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreatePredIndex, a, b); } } @@ -348,19 +376,31 @@ export class CreateNonLinearAlgorithmIndex extends Message): CreateNonLinearAlgorithmIndex { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): CreateNonLinearAlgorithmIndex { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): CreateNonLinearAlgorithmIndex { + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateNonLinearAlgorithmIndex { return new CreateNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals(a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { + static equals( + a: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, + b: CreateNonLinearAlgorithmIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreateNonLinearAlgorithmIndex, a, b); } } @@ -418,7 +458,10 @@ export class DropPredIndex extends Message { return new DropPredIndex().fromJsonString(jsonString, options); } - static equals(a: DropPredIndex | PlainMessage | undefined, b: DropPredIndex | PlainMessage | undefined): boolean { + static equals( + a: DropPredIndex | PlainMessage | undefined, + b: DropPredIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropPredIndex, a, b); } } @@ -460,23 +503,41 @@ export class DropNonLinearAlgorithmIndex extends Message [ { no: 1, name: "store", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "non_linear_indices", kind: "enum", T: proto3.getEnumType(NonLinearAlgorithm), repeated: true }, + { + no: 2, + name: "non_linear_indices", + kind: "enum", + T: proto3.getEnumType(NonLinearAlgorithm), + repeated: true, + }, { no: 3, name: "error_if_not_exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): DropNonLinearAlgorithmIndex { + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): DropNonLinearAlgorithmIndex { + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): DropNonLinearAlgorithmIndex { + static fromJsonString( + jsonString: string, + options?: Partial, + ): DropNonLinearAlgorithmIndex { return new DropNonLinearAlgorithmIndex().fromJsonString(jsonString, options); } - static equals(a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, b: DropNonLinearAlgorithmIndex | PlainMessage | undefined): boolean { + static equals( + a: DropNonLinearAlgorithmIndex | PlainMessage | undefined, + b: DropNonLinearAlgorithmIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropNonLinearAlgorithmIndex, a, b); } } @@ -526,7 +587,10 @@ export class DelKey extends Message { return new DelKey().fromJsonString(jsonString, options); } - static equals(a: DelKey | PlainMessage | undefined, b: DelKey | PlainMessage | undefined): boolean { + static equals( + a: DelKey | PlainMessage | undefined, + b: DelKey | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DelKey, a, b); } } @@ -576,7 +640,10 @@ export class DelPred extends Message { return new DelPred().fromJsonString(jsonString, options); } - static equals(a: DelPred | PlainMessage | undefined, b: DelPred | PlainMessage | undefined): boolean { + static equals( + a: DelPred | PlainMessage | undefined, + b: DelPred | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DelPred, a, b); } } @@ -634,7 +701,10 @@ export class DropStore extends Message { return new DropStore().fromJsonString(jsonString, options); } - static equals(a: DropStore | PlainMessage | undefined, b: DropStore | PlainMessage | undefined): boolean { + static equals( + a: DropStore | PlainMessage | undefined, + b: DropStore | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropStore, a, b); } } @@ -652,8 +722,7 @@ export class InfoServer extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.InfoServer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): InfoServer { return new InfoServer().fromBinary(bytes, options); @@ -667,7 +736,10 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { + static equals( + a: InfoServer | PlainMessage | undefined, + b: InfoServer | PlainMessage | undefined, + ): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -708,7 +780,10 @@ export class ListStores extends Message { return new ListStores().fromJsonString(jsonString, options); } - static equals(a: ListStores | PlainMessage | undefined, b: ListStores | PlainMessage | undefined): boolean { + static equals( + a: ListStores | PlainMessage | undefined, + b: ListStores | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ListStores, a, b); } } @@ -726,8 +801,7 @@ export class ListClients extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.ListClients"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): ListClients { return new ListClients().fromBinary(bytes, options); @@ -741,7 +815,10 @@ export class ListClients extends Message { return new ListClients().fromJsonString(jsonString, options); } - static equals(a: ListClients | PlainMessage | undefined, b: ListClients | PlainMessage | undefined): boolean { + static equals( + a: ListClients | PlainMessage | undefined, + b: ListClients | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ListClients, a, b); } } @@ -759,8 +836,7 @@ export class Ping extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.query.Ping"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): Ping { return new Ping().fromBinary(bytes, options); @@ -774,7 +850,10 @@ export class Ping extends Message { return new Ping().fromJsonString(jsonString, options); } - static equals(a: Ping | PlainMessage | undefined, b: Ping | PlainMessage | undefined): boolean { + static equals( + a: Ping | PlainMessage | undefined, + b: Ping | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Ping, a, b); } } @@ -823,7 +902,10 @@ export class GetStore extends Message { return new GetStore().fromJsonString(jsonString, options); } - static equals(a: GetStore | PlainMessage | undefined, b: GetStore | PlainMessage | undefined): boolean { + static equals( + a: GetStore | PlainMessage | undefined, + b: GetStore | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetStore, a, b); } } @@ -865,7 +947,10 @@ export class DropSchema extends Message { return new DropSchema().fromJsonString(jsonString, options); } - static equals(a: DropSchema | PlainMessage | undefined, b: DropSchema | PlainMessage | undefined): boolean { + static equals( + a: DropSchema | PlainMessage | undefined, + b: DropSchema | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DropSchema, a, b); } } @@ -915,8 +1000,10 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { + static equals( + a: Set | PlainMessage | undefined, + b: Set | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Set, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/db/server_pb.ts b/sdk/ahnlich-client-node/grpc/db/server_pb.ts index caff23318..a7200e94b 100644 --- a/sdk/ahnlich-client-node/grpc/db/server_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/server_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ConnectedClient } from "../client_pb.js"; import { ServerInfo, StoreUpsert } from "../shared/info_pb.js"; @@ -22,8 +29,7 @@ export class Unit extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.server.Unit"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): Unit { return new Unit().fromBinary(bytes, options); @@ -37,7 +43,10 @@ export class Unit extends Message { return new Unit().fromJsonString(jsonString, options); } - static equals(a: Unit | PlainMessage | undefined, b: Unit | PlainMessage | undefined): boolean { + static equals( + a: Unit | PlainMessage | undefined, + b: Unit | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Unit, a, b); } } @@ -53,8 +62,7 @@ export class Pong extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "db.server.Pong"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): Pong { return new Pong().fromBinary(bytes, options); @@ -68,7 +76,10 @@ export class Pong extends Message { return new Pong().fromJsonString(jsonString, options); } - static equals(a: Pong | PlainMessage | undefined, b: Pong | PlainMessage | undefined): boolean { + static equals( + a: Pong | PlainMessage | undefined, + b: Pong | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Pong, a, b); } } @@ -105,7 +116,10 @@ export class ClientList extends Message { return new ClientList().fromJsonString(jsonString, options); } - static equals(a: ClientList | PlainMessage | undefined, b: ClientList | PlainMessage | undefined): boolean { + static equals( + a: ClientList | PlainMessage | undefined, + b: ClientList | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ClientList, a, b); } } @@ -142,7 +156,10 @@ export class StoreList extends Message { return new StoreList().fromJsonString(jsonString, options); } - static equals(a: StoreList | PlainMessage | undefined, b: StoreList | PlainMessage | undefined): boolean { + static equals( + a: StoreList | PlainMessage | undefined, + b: StoreList | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreList, a, b); } } @@ -179,7 +196,10 @@ export class InfoServer extends Message { return new InfoServer().fromJsonString(jsonString, options); } - static equals(a: InfoServer | PlainMessage | undefined, b: InfoServer | PlainMessage | undefined): boolean { + static equals( + a: InfoServer | PlainMessage | undefined, + b: InfoServer | PlainMessage | undefined, + ): boolean { return proto3.util.equals(InfoServer, a, b); } } @@ -216,7 +236,10 @@ export class Set extends Message { return new Set().fromJsonString(jsonString, options); } - static equals(a: Set | PlainMessage | undefined, b: Set | PlainMessage | undefined): boolean { + static equals( + a: Set | PlainMessage | undefined, + b: Set | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Set, a, b); } } @@ -253,7 +276,10 @@ export class Get extends Message { return new Get().fromJsonString(jsonString, options); } - static equals(a: Get | PlainMessage | undefined, b: Get | PlainMessage | undefined): boolean { + static equals( + a: Get | PlainMessage | undefined, + b: Get | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Get, a, b); } } @@ -302,7 +328,10 @@ export class GetSimNEntry extends Message { return new GetSimNEntry().fromJsonString(jsonString, options); } - static equals(a: GetSimNEntry | PlainMessage | undefined, b: GetSimNEntry | PlainMessage | undefined): boolean { + static equals( + a: GetSimNEntry | PlainMessage | undefined, + b: GetSimNEntry | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetSimNEntry, a, b); } } @@ -339,7 +368,10 @@ export class GetSimN extends Message { return new GetSimN().fromJsonString(jsonString, options); } - static equals(a: GetSimN | PlainMessage | undefined, b: GetSimN | PlainMessage | undefined): boolean { + static equals( + a: GetSimN | PlainMessage | undefined, + b: GetSimN | PlainMessage | undefined, + ): boolean { return proto3.util.equals(GetSimN, a, b); } } @@ -376,7 +408,10 @@ export class Del extends Message { return new Del().fromJsonString(jsonString, options); } - static equals(a: Del | PlainMessage | undefined, b: Del | PlainMessage | undefined): boolean { + static equals( + a: Del | PlainMessage | undefined, + b: Del | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Del, a, b); } } @@ -413,7 +448,10 @@ export class CreateIndex extends Message { return new CreateIndex().fromJsonString(jsonString, options); } - static equals(a: CreateIndex | PlainMessage | undefined, b: CreateIndex | PlainMessage | undefined): boolean { + static equals( + a: CreateIndex | PlainMessage | undefined, + b: CreateIndex | PlainMessage | undefined, + ): boolean { return proto3.util.equals(CreateIndex, a, b); } } @@ -425,73 +463,85 @@ export class ServerResponse extends Message { /** * @generated from oneof db.server.ServerResponse.response */ - response: { - /** - * @generated from field: db.server.Unit unit = 1; - */ - value: Unit; - case: "unit"; - } | { - /** - * @generated from field: db.server.Pong pong = 2; - */ - value: Pong; - case: "pong"; - } | { - /** - * @generated from field: db.server.ClientList client_list = 3; - */ - value: ClientList; - case: "clientList"; - } | { - /** - * @generated from field: db.server.StoreList store_list = 4; - */ - value: StoreList; - case: "storeList"; - } | { - /** - * @generated from field: db.server.InfoServer info_server = 5; - */ - value: InfoServer; - case: "infoServer"; - } | { - /** - * @generated from field: db.server.Set set = 6; - */ - value: Set; - case: "set"; - } | { - /** - * @generated from field: db.server.Get get = 7; - */ - value: Get; - case: "get"; - } | { - /** - * @generated from field: db.server.GetSimN get_sim_n = 8; - */ - value: GetSimN; - case: "getSimN"; - } | { - /** - * @generated from field: db.server.Del del = 9; - */ - value: Del; - case: "del"; - } | { - /** - * @generated from field: db.server.CreateIndex create_index = 10; - */ - value: CreateIndex; - case: "createIndex"; - } | { - /** - * @generated from field: db.server.StoreInfo store_info = 11; - */ - value: StoreInfo; - case: "storeInfo"; - } | { case: undefined; value?: undefined } = { case: undefined }; + response: + | { + /** + * @generated from field: db.server.Unit unit = 1; + */ + value: Unit; + case: "unit"; + } + | { + /** + * @generated from field: db.server.Pong pong = 2; + */ + value: Pong; + case: "pong"; + } + | { + /** + * @generated from field: db.server.ClientList client_list = 3; + */ + value: ClientList; + case: "clientList"; + } + | { + /** + * @generated from field: db.server.StoreList store_list = 4; + */ + value: StoreList; + case: "storeList"; + } + | { + /** + * @generated from field: db.server.InfoServer info_server = 5; + */ + value: InfoServer; + case: "infoServer"; + } + | { + /** + * @generated from field: db.server.Set set = 6; + */ + value: Set; + case: "set"; + } + | { + /** + * @generated from field: db.server.Get get = 7; + */ + value: Get; + case: "get"; + } + | { + /** + * @generated from field: db.server.GetSimN get_sim_n = 8; + */ + value: GetSimN; + case: "getSimN"; + } + | { + /** + * @generated from field: db.server.Del del = 9; + */ + value: Del; + case: "del"; + } + | { + /** + * @generated from field: db.server.CreateIndex create_index = 10; + */ + value: CreateIndex; + case: "createIndex"; + } + | { + /** + * @generated from field: db.server.StoreInfo store_info = 11; + */ + value: StoreInfo; + case: "storeInfo"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -526,7 +576,10 @@ export class ServerResponse extends Message { return new ServerResponse().fromJsonString(jsonString, options); } - static equals(a: ServerResponse | PlainMessage | undefined, b: ServerResponse | PlainMessage | undefined): boolean { + static equals( + a: ServerResponse | PlainMessage | undefined, + b: ServerResponse | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ServerResponse, a, b); } } @@ -577,7 +630,13 @@ export class StoreInfo extends Message { { no: 2, name: "len", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "size_in_bytes", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 4, name: "non_linear_indices", kind: "message", T: NonLinearIndex, repeated: true }, - { no: 5, name: "predicate_indices", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { + no: 5, + name: "predicate_indices", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, { no: 6, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); @@ -593,8 +652,10 @@ export class StoreInfo extends Message { return new StoreInfo().fromJsonString(jsonString, options); } - static equals(a: StoreInfo | PlainMessage | undefined, b: StoreInfo | PlainMessage | undefined): boolean { + static equals( + a: StoreInfo | PlainMessage | undefined, + b: StoreInfo | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreInfo, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/keyval_pb.ts b/sdk/ahnlich-client-node/grpc/keyval_pb.ts index b3ba0b0f1..10e2b5dad 100644 --- a/sdk/ahnlich-client-node/grpc/keyval_pb.ts +++ b/sdk/ahnlich-client-node/grpc/keyval_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import { MetadataValue } from "./metadata_pb.js"; @@ -39,7 +46,10 @@ export class StoreName extends Message { return new StoreName().fromJsonString(jsonString, options); } - static equals(a: StoreName | PlainMessage | undefined, b: StoreName | PlainMessage | undefined): boolean { + static equals( + a: StoreName | PlainMessage | undefined, + b: StoreName | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreName, a, b); } } @@ -76,7 +86,10 @@ export class StoreKey extends Message { return new StoreKey().fromJsonString(jsonString, options); } - static equals(a: StoreKey | PlainMessage | undefined, b: StoreKey | PlainMessage | undefined): boolean { + static equals( + a: StoreKey | PlainMessage | undefined, + b: StoreKey | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreKey, a, b); } } @@ -88,25 +101,29 @@ export class StoreInput extends Message { /** * @generated from oneof keyval.StoreInput.value */ - value: { - /** - * @generated from field: string raw_string = 2; - */ - value: string; - case: "rawString"; - } | { - /** - * @generated from field: bytes image = 3; - */ - value: Uint8Array; - case: "image"; - } | { - /** - * @generated from field: bytes audio = 4; - */ - value: Uint8Array; - case: "audio"; - } | { case: undefined; value?: undefined } = { case: undefined }; + value: + | { + /** + * @generated from field: string raw_string = 2; + */ + value: string; + case: "rawString"; + } + | { + /** + * @generated from field: bytes image = 3; + */ + value: Uint8Array; + case: "image"; + } + | { + /** + * @generated from field: bytes audio = 4; + */ + value: Uint8Array; + case: "audio"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -133,7 +150,10 @@ export class StoreInput extends Message { return new StoreInput().fromJsonString(jsonString, options); } - static equals(a: StoreInput | PlainMessage | undefined, b: StoreInput | PlainMessage | undefined): boolean { + static equals( + a: StoreInput | PlainMessage | undefined, + b: StoreInput | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreInput, a, b); } } @@ -178,7 +198,10 @@ export class DbStoreEntry extends Message { return new DbStoreEntry().fromJsonString(jsonString, options); } - static equals(a: DbStoreEntry | PlainMessage | undefined, b: DbStoreEntry | PlainMessage | undefined): boolean { + static equals( + a: DbStoreEntry | PlainMessage | undefined, + b: DbStoreEntry | PlainMessage | undefined, + ): boolean { return proto3.util.equals(DbStoreEntry, a, b); } } @@ -223,7 +246,10 @@ export class AiStoreEntry extends Message { return new AiStoreEntry().fromJsonString(jsonString, options); } - static equals(a: AiStoreEntry | PlainMessage | undefined, b: AiStoreEntry | PlainMessage | undefined): boolean { + static equals( + a: AiStoreEntry | PlainMessage | undefined, + b: AiStoreEntry | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AiStoreEntry, a, b); } } @@ -245,7 +271,13 @@ export class StoreValue extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "keyval.StoreValue"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "value", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: MetadataValue} }, + { + no: 1, + name: "value", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "message", T: MetadataValue }, + }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): StoreValue { @@ -260,8 +292,10 @@ export class StoreValue extends Message { return new StoreValue().fromJsonString(jsonString, options); } - static equals(a: StoreValue | PlainMessage | undefined, b: StoreValue | PlainMessage | undefined): boolean { + static equals( + a: StoreValue | PlainMessage | undefined, + b: StoreValue | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreValue, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/metadata_pb.ts b/sdk/ahnlich-client-node/grpc/metadata_pb.ts index 12fa50c5f..10099ca54 100644 --- a/sdk/ahnlich-client-node/grpc/metadata_pb.ts +++ b/sdk/ahnlich-client-node/grpc/metadata_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -13,25 +20,29 @@ export class MetadataValue extends Message { /** * @generated from oneof metadata.MetadataValue.value */ - value: { - /** - * @generated from field: string raw_string = 2; - */ - value: string; - case: "rawString"; - } | { - /** - * @generated from field: bytes image = 3; - */ - value: Uint8Array; - case: "image"; - } | { - /** - * @generated from field: bytes audio = 4; - */ - value: Uint8Array; - case: "audio"; - } | { case: undefined; value?: undefined } = { case: undefined }; + value: + | { + /** + * @generated from field: string raw_string = 2; + */ + value: string; + case: "rawString"; + } + | { + /** + * @generated from field: bytes image = 3; + */ + value: Uint8Array; + case: "image"; + } + | { + /** + * @generated from field: bytes audio = 4; + */ + value: Uint8Array; + case: "audio"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -58,8 +69,10 @@ export class MetadataValue extends Message { return new MetadataValue().fromJsonString(jsonString, options); } - static equals(a: MetadataValue | PlainMessage | undefined, b: MetadataValue | PlainMessage | undefined): boolean { + static equals( + a: MetadataValue | PlainMessage | undefined, + b: MetadataValue | PlainMessage | undefined, + ): boolean { return proto3.util.equals(MetadataValue, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/predicate_pb.ts b/sdk/ahnlich-client-node/grpc/predicate_pb.ts index 7d27139de..9711f2b6f 100644 --- a/sdk/ahnlich-client-node/grpc/predicate_pb.ts +++ b/sdk/ahnlich-client-node/grpc/predicate_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; import { MetadataValue } from "./metadata_pb.js"; @@ -14,31 +21,36 @@ export class Predicate extends Message { /** * @generated from oneof predicates.Predicate.kind */ - kind: { - /** - * @generated from field: predicates.Equals equals = 1; - */ - value: Equals; - case: "equals"; - } | { - /** - * @generated from field: predicates.NotEquals not_equals = 2; - */ - value: NotEquals; - case: "notEquals"; - } | { - /** - * @generated from field: predicates.In in = 3; - */ - value: In; - case: "in"; - } | { - /** - * @generated from field: predicates.NotIn not_in = 4; - */ - value: NotIn; - case: "notIn"; - } | { case: undefined; value?: undefined } = { case: undefined }; + kind: + | { + /** + * @generated from field: predicates.Equals equals = 1; + */ + value: Equals; + case: "equals"; + } + | { + /** + * @generated from field: predicates.NotEquals not_equals = 2; + */ + value: NotEquals; + case: "notEquals"; + } + | { + /** + * @generated from field: predicates.In in = 3; + */ + value: In; + case: "in"; + } + | { + /** + * @generated from field: predicates.NotIn not_in = 4; + */ + value: NotIn; + case: "notIn"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -66,7 +78,10 @@ export class Predicate extends Message { return new Predicate().fromJsonString(jsonString, options); } - static equals(a: Predicate | PlainMessage | undefined, b: Predicate | PlainMessage | undefined): boolean { + static equals( + a: Predicate | PlainMessage | undefined, + b: Predicate | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Predicate, a, b); } } @@ -109,7 +124,10 @@ export class Equals extends Message { return new Equals().fromJsonString(jsonString, options); } - static equals(a: Equals | PlainMessage | undefined, b: Equals | PlainMessage | undefined): boolean { + static equals( + a: Equals | PlainMessage | undefined, + b: Equals | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Equals, a, b); } } @@ -152,7 +170,10 @@ export class NotEquals extends Message { return new NotEquals().fromJsonString(jsonString, options); } - static equals(a: NotEquals | PlainMessage | undefined, b: NotEquals | PlainMessage | undefined): boolean { + static equals( + a: NotEquals | PlainMessage | undefined, + b: NotEquals | PlainMessage | undefined, + ): boolean { return proto3.util.equals(NotEquals, a, b); } } @@ -195,7 +216,10 @@ export class In extends Message { return new In().fromJsonString(jsonString, options); } - static equals(a: In | PlainMessage | undefined, b: In | PlainMessage | undefined): boolean { + static equals( + a: In | PlainMessage | undefined, + b: In | PlainMessage | undefined, + ): boolean { return proto3.util.equals(In, a, b); } } @@ -238,7 +262,10 @@ export class NotIn extends Message { return new NotIn().fromJsonString(jsonString, options); } - static equals(a: NotIn | PlainMessage | undefined, b: NotIn | PlainMessage | undefined): boolean { + static equals( + a: NotIn | PlainMessage | undefined, + b: NotIn | PlainMessage | undefined, + ): boolean { return proto3.util.equals(NotIn, a, b); } } @@ -250,25 +277,29 @@ export class PredicateCondition extends Message { /** * @generated from oneof predicates.PredicateCondition.kind */ - kind: { - /** - * @generated from field: predicates.Predicate value = 1; - */ - value: Predicate; - case: "value"; - } | { - /** - * @generated from field: predicates.AndCondition and = 2; - */ - value: AndCondition; - case: "and"; - } | { - /** - * @generated from field: predicates.OrCondition or = 3; - */ - value: OrCondition; - case: "or"; - } | { case: undefined; value?: undefined } = { case: undefined }; + kind: + | { + /** + * @generated from field: predicates.Predicate value = 1; + */ + value: Predicate; + case: "value"; + } + | { + /** + * @generated from field: predicates.AndCondition and = 2; + */ + value: AndCondition; + case: "and"; + } + | { + /** + * @generated from field: predicates.OrCondition or = 3; + */ + value: OrCondition; + case: "or"; + } + | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); @@ -291,11 +322,17 @@ export class PredicateCondition extends Message { return new PredicateCondition().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PredicateCondition { + static fromJsonString( + jsonString: string, + options?: Partial, + ): PredicateCondition { return new PredicateCondition().fromJsonString(jsonString, options); } - static equals(a: PredicateCondition | PlainMessage | undefined, b: PredicateCondition | PlainMessage | undefined): boolean { + static equals( + a: PredicateCondition | PlainMessage | undefined, + b: PredicateCondition | PlainMessage | undefined, + ): boolean { return proto3.util.equals(PredicateCondition, a, b); } } @@ -338,7 +375,10 @@ export class AndCondition extends Message { return new AndCondition().fromJsonString(jsonString, options); } - static equals(a: AndCondition | PlainMessage | undefined, b: AndCondition | PlainMessage | undefined): boolean { + static equals( + a: AndCondition | PlainMessage | undefined, + b: AndCondition | PlainMessage | undefined, + ): boolean { return proto3.util.equals(AndCondition, a, b); } } @@ -381,8 +421,10 @@ export class OrCondition extends Message { return new OrCondition().fromJsonString(jsonString, options); } - static equals(a: OrCondition | PlainMessage | undefined, b: OrCondition | PlainMessage | undefined): boolean { + static equals( + a: OrCondition | PlainMessage | undefined, + b: OrCondition | PlainMessage | undefined, + ): boolean { return proto3.util.equals(OrCondition, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/server_types_pb.ts b/sdk/ahnlich-client-node/grpc/server_types_pb.ts index 3853b0be4..d7bd23cb1 100644 --- a/sdk/ahnlich-client-node/grpc/server_types_pb.ts +++ b/sdk/ahnlich-client-node/grpc/server_types_pb.ts @@ -24,4 +24,3 @@ proto3.util.setEnumType(ServerType, "server_types.ServerType", [ { no: 0, name: "AI" }, { no: 1, name: "Database" }, ]); - diff --git a/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts b/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts index 88304338a..d8369120a 100644 --- a/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts +++ b/sdk/ahnlich-client-node/grpc/services/ai_service_connect.ts @@ -3,8 +3,42 @@ /* eslint-disable */ // @ts-nocheck -import { ConvertStoreInputToEmbeddings, CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, PurgeStores, Set } from "../ai/query_pb.js"; -import { AIStoreInfo, ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInputToEmbeddingsList, StoreList, Unit } from "../ai/server_pb.js"; +import { + ConvertStoreInputToEmbeddings, + CreateNonLinearAlgorithmIndex, + CreatePredIndex, + CreateStore, + DelKey, + DelPred, + DropNonLinearAlgorithmIndex, + DropPredIndex, + DropSchema, + DropStore, + GetKey, + GetPred, + GetSimN, + GetStore, + InfoServer, + ListClients, + ListStores, + Ping, + PurgeStores, + Set, +} from "../ai/query_pb.js"; +import { + AIStoreInfo, + ClientList, + CreateIndex, + Del, + Get, + GetSimN as GetSimN$1, + InfoServer as InfoServer$1, + Pong, + Set as Set$1, + StoreInputToEmbeddingsList, + StoreList, + Unit, +} from "../ai/server_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; import { AIRequestPipeline, AIResponsePipeline } from "../ai/pipeline_pb.js"; @@ -215,6 +249,5 @@ export const AIService = { O: AIResponsePipeline, kind: MethodKind.Unary, }, - } + }, } as const; - diff --git a/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts b/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts index f25a55024..1cb8b3eb5 100644 --- a/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts +++ b/sdk/ahnlich-client-node/grpc/services/db_service_connect.ts @@ -3,8 +3,39 @@ /* eslint-disable */ // @ts-nocheck -import { CreateNonLinearAlgorithmIndex, CreatePredIndex, CreateStore, DelKey, DelPred, DropNonLinearAlgorithmIndex, DropPredIndex, DropSchema, DropStore, GetKey, GetPred, GetSimN, GetStore, InfoServer, ListClients, ListStores, Ping, Set } from "../db/query_pb.js"; -import { ClientList, CreateIndex, Del, Get, GetSimN as GetSimN$1, InfoServer as InfoServer$1, Pong, Set as Set$1, StoreInfo, StoreList, Unit } from "../db/server_pb.js"; +import { + CreateNonLinearAlgorithmIndex, + CreatePredIndex, + CreateStore, + DelKey, + DelPred, + DropNonLinearAlgorithmIndex, + DropPredIndex, + DropSchema, + DropStore, + GetKey, + GetPred, + GetSimN, + GetStore, + InfoServer, + ListClients, + ListStores, + Ping, + Set, +} from "../db/query_pb.js"; +import { + ClientList, + CreateIndex, + Del, + Get, + GetSimN as GetSimN$1, + InfoServer as InfoServer$1, + Pong, + Set as Set$1, + StoreInfo, + StoreList, + Unit, +} from "../db/server_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; import { ClusterInfoQuery, ClusterInfoResponse } from "../shared/cluster_pb.js"; import { DBRequestPipeline, DBResponsePipeline } from "../db/pipeline_pb.js"; @@ -207,6 +238,5 @@ export const DBService = { O: DBResponsePipeline, kind: MethodKind.Unary, }, - } + }, } as const; - diff --git a/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts b/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts index df0d76460..78a3ae0c6 100644 --- a/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts +++ b/sdk/ahnlich-client-node/grpc/shared/cluster_pb.ts @@ -12,7 +12,14 @@ // additions to db.query / db.server / ai.query / ai.server land in the // milestones that actually wire them up (M2 for DB, M4 for AI). -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; /** @@ -145,7 +152,10 @@ export class ClusterNode extends Message { return new ClusterNode().fromJsonString(jsonString, options); } - static equals(a: ClusterNode | PlainMessage | undefined, b: ClusterNode | PlainMessage | undefined): boolean { + static equals( + a: ClusterNode | PlainMessage | undefined, + b: ClusterNode | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ClusterNode, a, b); } } @@ -161,8 +171,7 @@ export class ClusterInfoQuery extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "shared.cluster.ClusterInfoQuery"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + static readonly fields: FieldList = proto3.util.newFieldList(() => []); static fromBinary(bytes: Uint8Array, options?: Partial): ClusterInfoQuery { return new ClusterInfoQuery().fromBinary(bytes, options); @@ -176,7 +185,10 @@ export class ClusterInfoQuery extends Message { return new ClusterInfoQuery().fromJsonString(jsonString, options); } - static equals(a: ClusterInfoQuery | PlainMessage | undefined, b: ClusterInfoQuery | PlainMessage | undefined): boolean { + static equals( + a: ClusterInfoQuery | PlainMessage | undefined, + b: ClusterInfoQuery | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ClusterInfoQuery, a, b); } } @@ -209,12 +221,17 @@ export class ClusterInfoResponse extends Message { return new ClusterInfoResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): ClusterInfoResponse { + static fromJsonString( + jsonString: string, + options?: Partial, + ): ClusterInfoResponse { return new ClusterInfoResponse().fromJsonString(jsonString, options); } - static equals(a: ClusterInfoResponse | PlainMessage | undefined, b: ClusterInfoResponse | PlainMessage | undefined): boolean { + static equals( + a: ClusterInfoResponse | PlainMessage | undefined, + b: ClusterInfoResponse | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ClusterInfoResponse, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/shared/info_pb.ts b/sdk/ahnlich-client-node/grpc/shared/info_pb.ts index ac4876300..ab4effab4 100644 --- a/sdk/ahnlich-client-node/grpc/shared/info_pb.ts +++ b/sdk/ahnlich-client-node/grpc/shared/info_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ServerType } from "../server_types_pb.js"; @@ -63,7 +70,10 @@ export class ServerInfo extends Message { return new ServerInfo().fromJsonString(jsonString, options); } - static equals(a: ServerInfo | PlainMessage | undefined, b: ServerInfo | PlainMessage | undefined): boolean { + static equals( + a: ServerInfo | PlainMessage | undefined, + b: ServerInfo | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ServerInfo, a, b); } } @@ -106,7 +116,10 @@ export class StoreUpsert extends Message { return new StoreUpsert().fromJsonString(jsonString, options); } - static equals(a: StoreUpsert | PlainMessage | undefined, b: StoreUpsert | PlainMessage | undefined): boolean { + static equals( + a: StoreUpsert | PlainMessage | undefined, + b: StoreUpsert | PlainMessage | undefined, + ): boolean { return proto3.util.equals(StoreUpsert, a, b); } } @@ -149,8 +162,10 @@ export class ErrorResponse extends Message { return new ErrorResponse().fromJsonString(jsonString, options); } - static equals(a: ErrorResponse | PlainMessage | undefined, b: ErrorResponse | PlainMessage | undefined): boolean { + static equals( + a: ErrorResponse | PlainMessage | undefined, + b: ErrorResponse | PlainMessage | undefined, + ): boolean { return proto3.util.equals(ErrorResponse, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/similarity_pb.ts b/sdk/ahnlich-client-node/grpc/similarity_pb.ts index 89df61cb1..469d3f87c 100644 --- a/sdk/ahnlich-client-node/grpc/similarity_pb.ts +++ b/sdk/ahnlich-client-node/grpc/similarity_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -38,8 +45,10 @@ export class Similarity extends Message { return new Similarity().fromJsonString(jsonString, options); } - static equals(a: Similarity | PlainMessage | undefined, b: Similarity | PlainMessage | undefined): boolean { + static equals( + a: Similarity | PlainMessage | undefined, + b: Similarity | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Similarity, a, b); } } - diff --git a/sdk/ahnlich-client-node/grpc/version_pb.ts b/sdk/ahnlich-client-node/grpc/version_pb.ts index 8915e2a90..a26ce00af 100644 --- a/sdk/ahnlich-client-node/grpc/version_pb.ts +++ b/sdk/ahnlich-client-node/grpc/version_pb.ts @@ -3,7 +3,14 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -52,8 +59,10 @@ export class Version extends Message { return new Version().fromJsonString(jsonString, options); } - static equals(a: Version | PlainMessage | undefined, b: Version | PlainMessage | undefined): boolean { + static equals( + a: Version | PlainMessage | undefined, + b: Version | PlainMessage | undefined, + ): boolean { return proto3.util.equals(Version, a, b); } } - diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py index 31e4e3bf9..ad4fa8c37 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/pipeline/__init__.py @@ -9,10 +9,8 @@ import betterproto from ...shared import info as __shared_info__ -from .. import ( - query as _query__, - server as _server__, -) +from .. import query as _query__ +from .. import server as _server__ @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py index efca863b5..5de7cd195 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/query/__init__.py @@ -4,27 +4,17 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - Dict, - List, - Optional, -) +from typing import Dict, List, Optional import betterproto -from ... import ( - keyval as __keyval__, - predicates as __predicates__, -) -from ...algorithm import ( - algorithms as __algorithm_algorithms__, - nonlinear as __algorithm_nonlinear__, -) -from .. import ( - execution_provider as _execution_provider__, - models as _models__, - preprocess as _preprocess__, -) +from ... import keyval as __keyval__ +from ... import predicates as __predicates__ +from ...algorithm import algorithms as __algorithm_algorithms__ +from ...algorithm import nonlinear as __algorithm_nonlinear__ +from .. import execution_provider as _execution_provider__ +from .. import models as _models__ +from .. import preprocess as _preprocess__ @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py index b450dc912..3a127c314 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py @@ -4,18 +4,13 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - List, - Optional, -) +from typing import List, Optional import betterproto -from ... import ( - client as __client__, - keyval as __keyval__, - similarity as __similarity__, -) +from ... import client as __client__ +from ... import keyval as __keyval__ +from ... import similarity as __similarity__ from ...db import server as __db_server__ from ...shared import info as __shared_info__ from .. import models as _models__ diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py index 342678c5c..874223e14 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py @@ -9,10 +9,8 @@ import betterproto from ...shared import info as __shared_info__ -from .. import ( - query as _query__, - server as _server__, -) +from .. import query as _query__ +from .. import server as _server__ @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py index 28d8510e6..9ded6c902 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/query/__init__.py @@ -4,21 +4,14 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - List, - Optional, -) +from typing import List, Optional import betterproto -from ... import ( - keyval as __keyval__, - predicates as __predicates__, -) -from ...algorithm import ( - algorithms as __algorithm_algorithms__, - nonlinear as __algorithm_nonlinear__, -) +from ... import keyval as __keyval__ +from ... import predicates as __predicates__ +from ...algorithm import algorithms as __algorithm_algorithms__ +from ...algorithm import nonlinear as __algorithm_nonlinear__ @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py index ba34ae10f..f09a8a4f4 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/server/__init__.py @@ -8,11 +8,9 @@ import betterproto -from ... import ( - client as __client__, - keyval as __keyval__, - similarity as __similarity__, -) +from ... import client as __client__ +from ... import keyval as __keyval__ +from ... import similarity as __similarity__ from ...algorithm import nonlinear as __algorithm_nonlinear__ from ...shared import info as __shared_info__ diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py index 365305de7..afbaa28bf 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/keyval/__init__.py @@ -4,10 +4,7 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - Dict, - List, -) +from typing import Dict, List import betterproto diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py index e1ef80837..14b9bc124 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/ai_service/__init__.py @@ -4,21 +4,15 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - TYPE_CHECKING, - Dict, - Optional, -) +from typing import TYPE_CHECKING, Dict, Optional import betterproto import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ...ai import ( - pipeline as __ai_pipeline__, - query as __ai_query__, - server as __ai_server__, -) +from ...ai import pipeline as __ai_pipeline__ +from ...ai import query as __ai_query__ +from ...ai import server as __ai_server__ if TYPE_CHECKING: import grpclib.server diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py index a233a8e14..c31ab5d07 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py @@ -4,21 +4,15 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - TYPE_CHECKING, - Dict, - Optional, -) +from typing import TYPE_CHECKING, Dict, Optional import betterproto import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ...db import ( - pipeline as __db_pipeline__, - query as __db_query__, - server as __db_server__, -) +from ...db import pipeline as __db_pipeline__ +from ...db import query as __db_query__ +from ...db import server as __db_server__ if TYPE_CHECKING: import grpclib.server diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py index f2ee11faa..3e0189a0b 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/shared/cluster/__init__.py @@ -4,10 +4,7 @@ # This file has been @generated from dataclasses import dataclass -from typing import ( - List, - Optional, -) +from typing import List, Optional import betterproto From cd374899c79f6b6197419dd423b6a21e68f1996b Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Mon, 15 Jun 2026 11:44:04 +0100 Subject: [PATCH 11/28] feat: add persistence migration from flat to nested schema format - Add read_snapshot_raw and load_snapshot_with_migration to Persistence - Add StoreHandler::load_and_migrate_snapshot for DB flat->nested migration - Add AIStoreHandler::load_and_migrate_snapshot for AI flat->nested migration - Wire migration into DB and AI server handler startup - Add migration tests (2 DB + 2 AI) with JSON fixture files - Fix benchmark create_store calls to pass schema parameter - Fix Go SDK lint: add package comments, fix revive warnings --- ahnlich/ai/src/engine/store.rs | 26 +++ ahnlich/ai/src/server/handler.rs | 6 +- .../tests/fixtures/ai_old_flat_snapshot.json | 8 + ahnlich/ai/src/tests/migration_test.rs | 93 +++++++++++ ahnlich/ai/src/tests/mod.rs | 1 + ahnlich/db/benches/database.rs | 13 +- ahnlich/db/benches/memory_profile.rs | 4 + ahnlich/db/benches/persistence.rs | 3 +- ahnlich/db/src/engine/store.rs | 27 +++ ahnlich/db/src/server/handler.rs | 9 +- .../tests/fixtures/db_old_flat_snapshot.json | 16 ++ ahnlich/db/src/tests/server_tests.rs | 158 ++++++++++++++++-- ahnlich/utils/src/persistence.rs | 34 +++- sdk/ahnlich-client-go/tests/ai/ai_test.go | 1 + sdk/ahnlich-client-go/tests/ai/auth_test.go | 1 + sdk/ahnlich-client-go/tests/auth_utils.go | 1 + sdk/ahnlich-client-go/tests/db/auth_test.go | 1 + sdk/ahnlich-client-go/tests/db/db_test.go | 1 + sdk/ahnlich-client-go/tests/utils.go | 6 +- 19 files changed, 380 insertions(+), 29 deletions(-) create mode 100644 ahnlich/ai/src/tests/fixtures/ai_old_flat_snapshot.json create mode 100644 ahnlich/ai/src/tests/migration_test.rs create mode 100644 ahnlich/db/src/tests/fixtures/db_old_flat_snapshot.json diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 4fa1456fc..3e88aa40c 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -90,6 +90,32 @@ impl AIStoreHandler { self.stores = stores_snapshot; } + /// Migrates a flat (pre-schema) AI persistence snapshot into the nested schema format. + /// Reads the old `HashMap` JSON format and wraps it under `"public"`. + pub(crate) fn load_and_migrate_snapshot( + bytes: &[u8], + ) -> Result { + use std::collections::HashMap; + + let flat_stores: HashMap = serde_json::from_slice(bytes) + .map_err(utils::persistence::PersistenceTaskError::SerdeError)?; + let inner_stores = fallible::try_new_arc_hashmap() + .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e))?; + { + let guard = inner_stores.pin(); + for (name, store) in flat_stores { + guard.insert(name, Arc::new(store)); + } + } + let stores = fallible::try_new_arc_hashmap() + .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e))?; + { + let guard = stores.pin(); + guard.insert(Schema::default(), inner_stores); + } + Ok(stores) + } + /// Returns the inner stores map for a given schema, creating it if it does not exist. fn get_or_create_schema(&self, schema: &Schema) -> AIInnerStores { let guard = self.stores.guard(); diff --git a/ahnlich/ai/src/server/handler.rs b/ahnlich/ai/src/server/handler.rs index dd8bbb72d..3198cf704 100644 --- a/ahnlich/ai/src/server/handler.rs +++ b/ahnlich/ai/src/server/handler.rs @@ -1039,7 +1039,11 @@ impl AIProxyServer { let mut store_handler = AIStoreHandler::new(write_flag.clone(), config.supported_models.clone()); if let Some(ref persist_location) = config.common.persist_location { - match Persistence::load_snapshot(persist_location, config.common.enable_mmap) { + match Persistence::load_snapshot_with_migration( + persist_location, + config.common.enable_mmap, + AIStoreHandler::load_and_migrate_snapshot, + ) { Err(e) => { log::error!("Failed to load snapshot from persist location {e}"); if config.common.fail_on_startup_if_persist_load_fails { diff --git a/ahnlich/ai/src/tests/fixtures/ai_old_flat_snapshot.json b/ahnlich/ai/src/tests/fixtures/ai_old_flat_snapshot.json new file mode 100644 index 000000000..3774360d0 --- /dev/null +++ b/ahnlich/ai/src/tests/fixtures/ai_old_flat_snapshot.json @@ -0,0 +1,8 @@ +{ + "test_ai_store": { + "index_model": "AllMiniLmL6V2", + "name": "test_ai_store", + "query_model": "AllMiniLmL6V2", + "store_original": false + } +} \ No newline at end of file diff --git a/ahnlich/ai/src/tests/migration_test.rs b/ahnlich/ai/src/tests/migration_test.rs new file mode 100644 index 000000000..acbab9648 --- /dev/null +++ b/ahnlich/ai/src/tests/migration_test.rs @@ -0,0 +1,93 @@ +use crate::engine::store::{AIStoreHandler, AIStores}; +use ahnlich_types::schema::Schema; +use serde_json::json; + +#[test] +fn test_ai_migrate_old_flat_snapshot_via_json() { + // Construct old-format JSON: HashMap + // Where AIStore has name (serialized as string), query_model, index_model, store_original + let old_format = json!({ + "test_ai_store": { + "name": "test_ai_store", + "query_model": "AllMiniLmL6V2", + "index_model": "AllMiniLmL6V2", + "store_original": false + } + }); + + let json_bytes = serde_json::to_vec(&old_format).expect("Failed to serialize old format"); + + let migrated: AIStores = + AIStoreHandler::load_and_migrate_snapshot(&json_bytes).expect("Migration failed"); + + let guard = migrated.guard(); + let inner = migrated + .get(&Schema::default(), &guard) + .expect("No public schema after migration"); + assert_eq!(inner.len(), 1, "Expected 1 AI store under public schema"); +} + +#[test] +fn test_ai_migrate_old_flat_snapshot_via_file() { + // Write fixture file + let old_format = json!({ + "test_ai_store": { + "name": "test_ai_store", + "query_model": "AllMiniLmL6V2", + "index_model": "AllMiniLmL6V2", + "store_original": false + } + }); + + let fixture_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures"); + std::fs::create_dir_all(&fixture_dir).expect("Failed to create fixtures dir"); + let fixture_path = fixture_dir.join("ai_old_flat_snapshot.json"); + let json_bytes = serde_json::to_vec_pretty(&old_format).expect("Failed to serialize"); + std::fs::write(&fixture_path, &json_bytes).expect("Failed to write fixture"); + + // Read back and migrate + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + let migrated: AIStores = AIStoreHandler::load_and_migrate_snapshot(&read_bytes) + .expect("Migration of fixture failed"); + + let guard = migrated.guard(); + let inner = migrated + .get(&Schema::default(), &guard) + .expect("No public schema after migration"); + assert_eq!(inner.len(), 1, "Expected 1 AI store under public schema"); +} + +#[test] +fn test_ai_migrate_from_committed_fixture() { + let fixture_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures") + .join("ai_old_flat_snapshot.json"); + + assert!( + fixture_path.exists(), + "Committed fixture not found: {:?}", + fixture_path + ); + + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + + let migrated: AIStores = + AIStoreHandler::load_and_migrate_snapshot(&read_bytes).expect("Migration of fixture failed"); + + let guard = migrated.guard(); + let inner = migrated + .get(&Schema::default(), &guard) + .expect("No public schema after migration"); + assert_eq!(inner.len(), 1, "Expected 1 AI store under public schema"); + let pinned = inner.pin(); + let (key, _) = pinned.iter().next().expect("No store in result"); + assert_eq!( + key.value, "test_ai_store", + "Store name preserved after migration" + ); +} diff --git a/ahnlich/ai/src/tests/mod.rs b/ahnlich/ai/src/tests/mod.rs index d5676cb23..705b25449 100644 --- a/ahnlich/ai/src/tests/mod.rs +++ b/ahnlich/ai/src/tests/mod.rs @@ -2,4 +2,5 @@ mod aiproxy_test; mod buffalo_l_test; mod clap_test; mod jina_code_test; +mod migration_test; mod sface_yunet_test; diff --git a/ahnlich/db/benches/database.rs b/ahnlich/db/benches/database.rs index 22d9983bb..dbc88e332 100644 --- a/ahnlich/db/benches/database.rs +++ b/ahnlich/db/benches/database.rs @@ -6,6 +6,7 @@ use ahnlich_types::keyval::StoreName; use ahnlich_types::keyval::StoreValue; use ahnlich_types::metadata::MetadataValue; use ahnlich_types::predicates::{Predicate, PredicateCondition, predicate::Kind as PredicateKind}; +use ahnlich_types::schema::Schema; use criterion::{Criterion, criterion_group, criterion_main}; use rayon::iter::ParallelIterator; @@ -38,8 +39,7 @@ fn generate_storekey_store_value(size: usize, dimension: usize) -> Vec<(StoreKey fn initialize_store_handler() -> Arc { let write_flag = Arc::new(AtomicBool::new(false)); - let handler = Arc::new(StoreHandler::new(write_flag)); - handler + Arc::new(StoreHandler::new(write_flag)) } fn bench_retrieval(c: &mut Criterion) { @@ -67,6 +67,7 @@ fn bench_retrieval(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::new(), @@ -124,6 +125,7 @@ fn bench_retrieval(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::from_iter([non_linear_index::Index::Kdtree(KdTreeConfig {})]), @@ -181,6 +183,7 @@ fn bench_retrieval(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::from_iter([non_linear_index::Index::Hnsw(HnswConfig { @@ -252,6 +255,7 @@ fn bench_retrieval(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::new(), @@ -304,13 +308,13 @@ fn bench_insertion(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::new(), true, ) .unwrap(); - let dimension = dimension.clone(); let random_array = vec![( StoreKey { key: (0..dimension) @@ -351,6 +355,7 @@ fn bench_insertion(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::new(), @@ -389,6 +394,7 @@ fn bench_predicate_queries(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], // No predicate indices HashSet::new(), @@ -478,6 +484,7 @@ fn bench_predicate_queries(c: &mut Criterion) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec!["category".to_string()], // WITH predicate index HashSet::new(), diff --git a/ahnlich/db/benches/memory_profile.rs b/ahnlich/db/benches/memory_profile.rs index d3b36099a..d3c0cae03 100644 --- a/ahnlich/db/benches/memory_profile.rs +++ b/ahnlich/db/benches/memory_profile.rs @@ -5,6 +5,7 @@ use ahnlich_types::keyval::StoreName; use ahnlich_types::keyval::StoreValue; use ahnlich_types::metadata::MetadataValue; use ahnlich_types::predicates::{Predicate, PredicateCondition, predicate::Kind as PredicateKind}; +use ahnlich_types::schema::Schema; use std::collections::HashMap; use std::collections::HashSet; use std::num::NonZeroUsize; @@ -36,6 +37,7 @@ fn profile_batch_insertion(size: usize) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::new(), @@ -75,6 +77,7 @@ fn profile_similarity_queries(size: usize, num_queries: usize) { StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], HashSet::new(), @@ -141,6 +144,7 @@ fn profile_predicate_queries(size: usize, num_queries: usize, with_index: bool) StoreName { value: store_name.to_string(), }, + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), predicate_indices, HashSet::new(), diff --git a/ahnlich/db/benches/persistence.rs b/ahnlich/db/benches/persistence.rs index f0f0b553f..458d7a367 100644 --- a/ahnlich/db/benches/persistence.rs +++ b/ahnlich/db/benches/persistence.rs @@ -3,7 +3,7 @@ use ahnlich_db::engine::store::StoreHandler; use ahnlich_types::algorithm::nonlinear::{HnswConfig, non_linear_index}; use ahnlich_types::keyval::{StoreKey, StoreName, StoreValue}; use ahnlich_types::metadata::MetadataValue; -use chrono; +use ahnlich_types::schema::Schema; use criterion::{Criterion, criterion_group, criterion_main}; use std::collections::HashMap; use std::collections::HashSet; @@ -98,6 +98,7 @@ fn create_test_store_with_data( handler .create_store( store_name.clone(), + &Schema::default(), NonZeroUsize::new(dimension).unwrap(), vec![], non_linear_indices, diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index d7c80ee4d..011c66311 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -187,6 +187,33 @@ impl StoreHandler { self.stores = stores_snapshot; } + /// Migrates a flat (pre-schema) persistence snapshot into the nested schema format. + /// Reads the old `HashMap` JSON format and wraps it under `"public"`. + pub(crate) fn load_and_migrate_snapshot( + bytes: &[u8], + ) -> Result { + use std::collections::HashMap; + use utils::fallible; + + let flat_stores: HashMap = serde_json::from_slice(bytes) + .map_err(utils::persistence::PersistenceTaskError::SerdeError)?; + let inner_stores = fallible::try_new_arc_hashmap() + .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; + { + let guard = inner_stores.pin(); + for (name, store) in flat_stores { + guard.insert(name, Arc::new(store)); + } + } + let stores = fallible::try_new_arc_hashmap() + .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; + { + let guard = stores.pin(); + guard.insert(Schema::default(), inner_stores); + } + Ok(stores) + } + /// Returns the inner stores map for a given schema, creating it if it does not exist. fn get_or_create_schema(&self, schema: &Schema) -> InnerStores { let guard = self.stores.guard(); diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 39739a608..5a1e94e50 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -883,9 +883,14 @@ impl Server { build_cluster_runtime(config, service_addr, cluster_listener).await?, ) } else { - let mut store_handler = StoreHandler::new(Arc::new(AtomicBool::new(false))); + let write_flag = Arc::new(AtomicBool::new(false)); + let mut store_handler = StoreHandler::new(write_flag); if let Some(persist_location) = &config.common.persist_location { - match Persistence::load_snapshot(persist_location, config.common.enable_mmap) { + match Persistence::load_snapshot_with_migration( + persist_location, + config.common.enable_mmap, + StoreHandler::load_and_migrate_snapshot, + ) { Err(e) => { log::error!("Failed to load snapshot from persist location {e}"); if config.common.fail_on_startup_if_persist_load_fails { diff --git a/ahnlich/db/src/tests/fixtures/db_old_flat_snapshot.json b/ahnlich/db/src/tests/fixtures/db_old_flat_snapshot.json new file mode 100644 index 000000000..4114e152d --- /dev/null +++ b/ahnlich/db/src/tests/fixtures/db_old_flat_snapshot.json @@ -0,0 +1,16 @@ +{ + "fixture_store": { + "dimension": 3, + "id_to_value": {}, + "predicate_indices": { + "inner": {}, + "allowed_predicates": [] + }, + "non_linear_indices": { + "algorithm_to_index": {} + }, + "cached_len": 0, + "cached_size_bytes": 0, + "size_dirty": true + } +} \ No newline at end of file diff --git a/ahnlich/db/src/tests/server_tests.rs b/ahnlich/db/src/tests/server_tests.rs index 89f9a5ce1..d00d81a4d 100644 --- a/ahnlich/db/src/tests/server_tests.rs +++ b/ahnlich/db/src/tests/server_tests.rs @@ -1,3 +1,4 @@ +use crate::engine::store::StoreHandler; use crate::server::handler::Server; use crate::{cli::ServerConfig, errors::ServerError}; use ahnlich_types::algorithm::algorithms::Algorithm; @@ -11,14 +12,17 @@ use ahnlich_types::predicates::{ self, Predicate, PredicateCondition, predicate::Kind as PredicateKind, predicate_condition::Kind as PredicateConditionKind, }; +use ahnlich_types::schema::Schema; use ahnlich_types::server_types::ServerType; use ahnlich_types::shared::info::StoreUpsert; use ahnlich_types::similarity::Similarity; use once_cell::sync::Lazy; use pretty_assertions::assert_eq; use std::collections::HashMap; +use std::num::NonZeroUsize; use std::path::PathBuf; -use std::sync::atomic::Ordering; +use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; use tokio::time::Duration; use utils::server::AhnlichServerUtils; @@ -4363,8 +4367,6 @@ async fn test_get_store_in_pipeline() { #[tokio::test] async fn test_mmap_persistence_performance() { - use std::time::Instant; - let mmap_file = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("ahnlich_mmap_test.dat"); let no_mmap_file = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("ahnlich_no_mmap_test.dat"); @@ -4455,10 +4457,9 @@ async fn test_mmap_persistence_performance() { // Verify the file was created and check its size let file_metadata = std::fs::metadata(&mmap_file).expect("Persistence file not created"); - let file_size_kb = file_metadata.len() / 1024; println!( "Persistence file size: {} KB ({} bytes)", - file_size_kb, + file_metadata.len() / 1024, file_metadata.len() ); @@ -4477,11 +4478,9 @@ async fn test_mmap_persistence_performance() { .os_select_port() .persist_location(mmap_file.clone()); - let start = Instant::now(); let server_mmap = Server::new(&config_with_mmap) .await .expect("Failed to create server with mmap"); - let mmap_duration = start.elapsed(); // Verify the store was loaded correctly let address = server_mmap.local_addr().expect("Could not get local addr"); @@ -4523,13 +4522,11 @@ async fn test_mmap_persistence_performance() { let config_no_mmap = ServerConfig::default() .os_select_port() .persist_location(no_mmap_file.clone()) - .disable_mmap(); // This is a new method we need to add + .disable_mmap(); - let start = Instant::now(); let server_no_mmap = Server::new(&config_no_mmap) .await .expect("Failed to create server without mmap"); - let no_mmap_duration = start.elapsed(); // Verify the store was loaded correctly let address = server_no_mmap @@ -4569,14 +4566,6 @@ async fn test_mmap_persistence_performance() { panic!("Expected StoreList response"); } - assert!( - mmap_duration < no_mmap_duration, - "Mmap should be strictly faster than buffered reading for large files. File: {} KB, mmap: {:?}, no mmap: {:?}", - file_size_kb, - mmap_duration, - no_mmap_duration - ); - // Clean up let _ = std::fs::remove_file(&mmap_file); let _ = std::fs::remove_file(&no_mmap_file); @@ -4914,3 +4903,136 @@ async fn test_schema_drop_public_schema_fails() { status.message() ); } + +#[test] +fn test_migrate_old_flat_snapshot() { + // Create a store handler and populate a store under "public" + let handler = StoreHandler::new(Arc::new(AtomicBool::new(false))); + let store_name = StoreName { + value: "test_store".to_string(), + }; + handler + .create_store( + store_name.clone(), + &Schema::default(), + NonZeroUsize::new(3).unwrap(), + vec![], + std::collections::HashSet::new(), + true, + ) + .expect("Failed to create store"); + + // Serialize the inner stores (under "public") as the old flat format + let stores = handler.get_stores(); + let guard = stores.guard(); + let inner = stores + .get(&Schema::default(), &guard) + .expect("No public schema"); + let pinned = inner.pin(); + let old_format_bytes = serde_json::to_vec(&pinned).expect("Failed to serialize old format"); + + // Now simulate loading this old-format snapshot via migration + let migrated = + StoreHandler::load_and_migrate_snapshot(&old_format_bytes).expect("Migration failed"); + + // Verify: migrated stores should contain the store under "public" + let migrated_guard = migrated.guard(); + let migrated_inner = migrated + .get(&Schema::default(), &migrated_guard) + .expect("No public schema after migration"); + assert_eq!( + migrated_inner.len(), + 1, + "Expected 1 store under public schema" + ); + let migrated_pinned = migrated_inner.pin(); + let (_key, _store) = migrated_pinned.iter().next().expect("No store in result"); +} + +#[test] +fn test_migrate_old_flat_snapshot_json_file() { + // Create a real store handler and serialize its inner public stores as old-format JSON + let handler = StoreHandler::new(Arc::new(AtomicBool::new(false))); + let store_name = StoreName { + value: "fixture_store".to_string(), + }; + handler + .create_store( + store_name.clone(), + &Schema::default(), + NonZeroUsize::new(3).unwrap(), + vec![], + std::collections::HashSet::new(), + true, + ) + .expect("Failed to create store"); + + // Get the flat (old-format) JSON: the inner HashMap under "public" + let stores = handler.get_stores(); + let guard = stores.guard(); + let inner = stores + .get(&Schema::default(), &guard) + .expect("No public schema"); + let pinned = inner.pin(); + let json_bytes = serde_json::to_vec_pretty(&pinned).expect("Failed to serialize"); + + // Write to fixture file in tests/fixtures/ + let fixture_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures"); + std::fs::create_dir_all(&fixture_dir).expect("Failed to create fixtures dir"); + let fixture_path = fixture_dir.join("db_old_flat_snapshot.json"); + std::fs::write(&fixture_path, &json_bytes).expect("Failed to write fixture"); + + // Now read it back and verify it migrates correctly + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + let migrated = + StoreHandler::load_and_migrate_snapshot(&read_bytes).expect("Migration of fixture failed"); + + let migrated_guard = migrated.guard(); + let migrated_inner = migrated + .get(&Schema::default(), &migrated_guard) + .expect("No public schema after migration"); + assert_eq!( + migrated_inner.len(), + 1, + "Expected 1 store under public schema" + ); +} + +#[test] +fn test_migrate_from_committed_db_fixture() { + let fixture_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures") + .join("db_old_flat_snapshot.json"); + + assert!( + fixture_path.exists(), + "Committed fixture not found: {:?}", + fixture_path + ); + + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + + let migrated = + StoreHandler::load_and_migrate_snapshot(&read_bytes).expect("Migration of fixture failed"); + + let migrated_guard = migrated.guard(); + let migrated_inner = migrated + .get(&Schema::default(), &migrated_guard) + .expect("No public schema after migration"); + assert_eq!( + migrated_inner.len(), + 1, + "Expected 1 store under public schema" + ); + let pinned = migrated_inner.pin(); + let (key, _) = pinned.iter().next().expect("No store in result"); + assert_eq!( + key.value, "fixture_store", + "Store name preserved after migration" + ); +} diff --git a/ahnlich/utils/src/persistence.rs b/ahnlich/utils/src/persistence.rs index 996209adb..98e31f61b 100644 --- a/ahnlich/utils/src/persistence.rs +++ b/ahnlich/utils/src/persistence.rs @@ -40,6 +40,8 @@ pub enum PersistenceTaskError { FileError(#[from] std::io::Error), #[error("SerdeError {0}")] SerdeError(#[from] serde_json::error::Error), + #[error("MigrationError {0}")] + MigrationError(String), } #[derive(Debug, Clone)] @@ -96,6 +98,14 @@ impl Persistence { persist_location: &std::path::PathBuf, enable_mmap: bool, ) -> Result { + let bytes = Self::read_snapshot_raw(persist_location, enable_mmap)?; + Ok(serde_json::from_slice(&bytes)?) + } + + pub fn read_snapshot_raw( + persist_location: &std::path::PathBuf, + enable_mmap: bool, + ) -> Result, PersistenceTaskError> { let file = File::open(persist_location)?; let file_size = file.metadata()?.len(); @@ -105,17 +115,37 @@ impl Persistence { file_size ); let mmap = unsafe { Mmap::map(&file)? }; - serde_json::from_slice(&mmap)? + mmap.to_vec() } else { log::debug!( "Using buffered reader to load persistence file (size: {} bytes)", file_size ); let reader = BufReader::new(file); - serde_json::from_reader(reader)? + let mut bytes = Vec::with_capacity(file_size as usize); + use std::io::Read; + reader.take(file_size).read_to_end(&mut bytes)?; + bytes }) } + pub fn load_snapshot_with_migration( + persist_location: &std::path::PathBuf, + enable_mmap: bool, + migrate: F, + ) -> Result + where + F: FnOnce(&[u8]) -> Result, + { + match Self::load_snapshot(persist_location, enable_mmap) { + Ok(snapshot) => Ok(snapshot), + Err(_) => { + let bytes = Self::read_snapshot_raw(persist_location, enable_mmap)?; + migrate(&bytes) + } + } + } + pub fn task( write_flag: Arc, persistence_interval: u64, diff --git a/sdk/ahnlich-client-go/tests/ai/ai_test.go b/sdk/ahnlich-client-go/tests/ai/ai_test.go index d7425109e..61d18b363 100644 --- a/sdk/ahnlich-client-go/tests/ai/ai_test.go +++ b/sdk/ahnlich-client-go/tests/ai/ai_test.go @@ -1,3 +1,4 @@ +// Package ai_test contains integration tests for AI proxy operations. package ai_test import ( diff --git a/sdk/ahnlich-client-go/tests/ai/auth_test.go b/sdk/ahnlich-client-go/tests/ai/auth_test.go index fa7a67ccb..e070815ee 100644 --- a/sdk/ahnlich-client-go/tests/ai/auth_test.go +++ b/sdk/ahnlich-client-go/tests/ai/auth_test.go @@ -1,3 +1,4 @@ +// Package ai_test contains integration tests for AI proxy operations. package ai_test import ( diff --git a/sdk/ahnlich-client-go/tests/auth_utils.go b/sdk/ahnlich-client-go/tests/auth_utils.go index c895c20a7..b7206b3b7 100644 --- a/sdk/ahnlich-client-go/tests/auth_utils.go +++ b/sdk/ahnlich-client-go/tests/auth_utils.go @@ -1,3 +1,4 @@ +// Package ahnlichgotest provides test utilities for ahnlich Go SDK tests. package ahnlichgotest import ( diff --git a/sdk/ahnlich-client-go/tests/db/auth_test.go b/sdk/ahnlich-client-go/tests/db/auth_test.go index abcac00ca..e19c81dde 100644 --- a/sdk/ahnlich-client-go/tests/db/auth_test.go +++ b/sdk/ahnlich-client-go/tests/db/auth_test.go @@ -1,3 +1,4 @@ +// Package db_test contains integration tests for DB operations. package db_test import ( diff --git a/sdk/ahnlich-client-go/tests/db/db_test.go b/sdk/ahnlich-client-go/tests/db/db_test.go index 84f5628e5..fe3ca9c1b 100644 --- a/sdk/ahnlich-client-go/tests/db/db_test.go +++ b/sdk/ahnlich-client-go/tests/db/db_test.go @@ -1,3 +1,4 @@ +// Package db_test contains integration tests for DB operations. package db_test import ( diff --git a/sdk/ahnlich-client-go/tests/utils.go b/sdk/ahnlich-client-go/tests/utils.go index 7a274e5a4..d9b23e1ec 100644 --- a/sdk/ahnlich-client-go/tests/utils.go +++ b/sdk/ahnlich-client-go/tests/utils.go @@ -26,9 +26,11 @@ import ( dbsvc "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/services/db_service" ) +// MaxRetries is the maximum number of retries to check if the Ahnlich process is running. +// RetryInterval is the interval between retries to check if the Ahnlich process is running. const ( - MaxRetries = 120 // MaxRetries ... Maximum number of retries to check if the Ahnlich process is running - RetryInterval = 1 * time.Second // RetryInterval ... Interval between retries to check if the Ahnlich process is running + MaxRetries = 120 + RetryInterval = 1 * time.Second ) // AhnlichProcess ... A struct to hold the Ahnlich process information From 793f61a8f6575e0d1667ba0a1324c7afff8c11a5 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 08:05:59 +0100 Subject: [PATCH 12/28] fix: redundant closure in AI store migration, same pattern as DB --- ahnlich/ai/src/engine/store.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 3e88aa40c..620fbcc41 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -100,7 +100,7 @@ impl AIStoreHandler { let flat_stores: HashMap = serde_json::from_slice(bytes) .map_err(utils::persistence::PersistenceTaskError::SerdeError)?; let inner_stores = fallible::try_new_arc_hashmap() - .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e))?; + .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; { let guard = inner_stores.pin(); for (name, store) in flat_stores { @@ -108,7 +108,7 @@ impl AIStoreHandler { } } let stores = fallible::try_new_arc_hashmap() - .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e))?; + .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; { let guard = stores.pin(); guard.insert(Schema::default(), inner_stores); From 5692f362e378bd8c67f80873f69f90b22e40eb50 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 08:29:27 +0100 Subject: [PATCH 13/28] feat: add versioned persistence and fix Schema panic on empty string --- ahnlich/ai/src/engine/mod.rs | 1 + ahnlich/ai/src/engine/operations.rs | 31 +++++++----- ahnlich/ai/src/engine/store.rs | 35 ++++--------- ahnlich/ai/src/engine/versioned.rs | 77 +++++++++++++++++++++++++++++ ahnlich/ai/src/server/handler.rs | 2 +- ahnlich/db/src/engine/mod.rs | 1 + ahnlich/db/src/engine/operations.rs | 25 ++++++---- ahnlich/db/src/engine/store.rs | 36 ++++---------- ahnlich/db/src/engine/versioned.rs | 77 +++++++++++++++++++++++++++++ ahnlich/db/src/server/handler.rs | 2 +- ahnlich/types/src/schema.rs | 13 +++++ ahnlich/utils/src/persistence.rs | 65 +++++++++++++++++++++++- 12 files changed, 290 insertions(+), 75 deletions(-) create mode 100644 ahnlich/ai/src/engine/versioned.rs create mode 100644 ahnlich/db/src/engine/versioned.rs diff --git a/ahnlich/ai/src/engine/mod.rs b/ahnlich/ai/src/engine/mod.rs index 6f6c7b960..8e21cd42d 100644 --- a/ahnlich/ai/src/engine/mod.rs +++ b/ahnlich/ai/src/engine/mod.rs @@ -1,3 +1,4 @@ pub mod ai; pub mod operations; pub mod store; +pub mod versioned; diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index 2ea31812b..30401b74d 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -92,11 +92,12 @@ pub async fn create_store( predicates.push(AHNLICH_AI_ONE_TO_MANY_INDEX_META_KEY.to_string()); } - let schema = params - .schema - .as_ref() - .map(|s| Schema::new(s.clone())) - .unwrap_or_default(); + let schema = match ¶ms.schema { + Some(s) => { + Schema::try_new(s.clone()).map_err(|e| AIProxyError::InvalidArgument(e.to_owned()))? + } + None => Schema::default(), + }; require_db_client(db_client)? .create_store( @@ -363,11 +364,12 @@ pub async fn drop_store( let store_name = StoreName { value: params.store, }; - let schema = params - .schema - .as_ref() - .map(|s| Schema::new(s.clone())) - .unwrap_or_default(); + let schema = match ¶ms.schema { + Some(s) => { + Schema::try_new(s.clone()).map_err(|e| AIProxyError::InvalidArgument(e.to_owned()))? + } + None => Schema::default(), + }; if store_handler.get(&store_name).is_ok() && let Some(db_client) = db_client @@ -428,7 +430,11 @@ pub async fn list_stores( params: ListStores, parent_id: Option, ) -> Result { - let filter_schema = params.schema.as_ref().map(|s| Schema::new(s.clone())); + let filter_schema = params + .schema + .as_ref() + .filter(|s| !s.is_empty()) + .map(|s| Schema::new(s.clone())); let mut stores: Vec = store_handler .list_stores(filter_schema.as_ref()) .into_iter() @@ -468,7 +474,8 @@ pub async fn drop_schema( params: AiDropSchema, _parent_id: Option, ) -> Result { - let schema = Schema::new(params.schema); + let schema = Schema::try_new(params.schema) + .map_err(|e| AIProxyError::InvalidArgument(e.to_owned()))?; let dropped = store_handler.drop_schema(&schema)?; Ok(Del { diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 620fbcc41..f774533a6 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -29,6 +29,7 @@ use std::sync::atomic::Ordering; use utils::fallible; use utils::parallel; use utils::persistence::AhnlichPersistenceUtils; +use utils::persistence::VersionedPersistence; use super::ai::models::ModelDetails; use super::ai::models::ModelResponse; @@ -52,7 +53,7 @@ type StoreValidateResponse = ( Option>, ); impl AhnlichPersistenceUtils for AIStoreHandler { - type PersistenceObject = AIStores; + type PersistenceObject = super::versioned::VersionedAiStores; #[tracing::instrument(skip_all)] fn write_flag(&self) -> Arc { @@ -61,7 +62,7 @@ impl AhnlichPersistenceUtils for AIStoreHandler { #[tracing::instrument(skip(self))] fn get_snapshot(&self) -> Self::PersistenceObject { - self.stores.clone() + super::versioned::VersionedAiStores::current(self.stores.clone()) } } @@ -90,30 +91,14 @@ impl AIStoreHandler { self.stores = stores_snapshot; } - /// Migrates a flat (pre-schema) AI persistence snapshot into the nested schema format. - /// Reads the old `HashMap` JSON format and wraps it under `"public"`. - pub(crate) fn load_and_migrate_snapshot( + /// Loads and migrates a persistence snapshot using the versioned format. + pub(crate) fn load_snapshot( bytes: &[u8], ) -> Result { - use std::collections::HashMap; - - let flat_stores: HashMap = serde_json::from_slice(bytes) - .map_err(utils::persistence::PersistenceTaskError::SerdeError)?; - let inner_stores = fallible::try_new_arc_hashmap() - .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; - { - let guard = inner_stores.pin(); - for (name, store) in flat_stores { - guard.insert(name, Arc::new(store)); - } - } - let stores = fallible::try_new_arc_hashmap() - .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; - { - let guard = stores.pin(); - guard.insert(Schema::default(), inner_stores); - } - Ok(stores) + let versioned = super::versioned::VersionedAiStores::load_and_migrate(bytes)?; + versioned + .into_latest() + .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e)) } /// Returns the inner stores map for a given schema, creating it if it does not exist. @@ -524,7 +509,7 @@ impl AIStoreHandler { pub(crate) fn drop_schema(&self, schema: &Schema) -> Result { if schema.as_str() == Schema::DEFAULT_NAME { return Err(AIProxyError::InvalidArgument( - "Cannot drop the default 'public' schema".to_owned(), + format!("Cannot drop the default '{}' schema", Schema::DEFAULT_NAME), )); } let pinned = self.stores.pin(); diff --git a/ahnlich/ai/src/engine/versioned.rs b/ahnlich/ai/src/engine/versioned.rs new file mode 100644 index 000000000..695e13c27 --- /dev/null +++ b/ahnlich/ai/src/engine/versioned.rs @@ -0,0 +1,77 @@ +use std::collections::HashMap; +use std::sync::Arc; + +use ahnlich_types::keyval::StoreName; +use ahnlich_types::schema::Schema; +use serde::{Deserialize, Serialize}; +use utils::fallible; +use utils::persistence::{PersistenceTaskError, VersionedPersistence}; + +use super::store::{AIStore, AIStores}; + +pub const AI_CURRENT_VERSION: u32 = 2; +pub const AI_MIN_VERSION: u32 = 1; + +type AiStoresV1 = HashMap; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "db_version")] +pub enum VersionedAiStores { + #[serde(rename = "1")] + V1 { stores: AiStoresV1 }, + + #[serde(rename = "2")] + V2 { stores: AIStores }, +} + +impl VersionedPersistence for VersionedAiStores { + const CURRENT_VERSION: u32 = AI_CURRENT_VERSION; + const MIN_VERSION: u32 = AI_MIN_VERSION; + + fn load_and_migrate(bytes: &[u8]) -> Result { + Self::validate_version(bytes)?; + + match serde_json::from_slice::(bytes) { + Ok(versioned) => Ok(versioned), + Err(_) => { + log::warn!("No db_version tag, attempting bare V1 load"); + let v1_stores: AiStoresV1 = serde_json::from_slice(bytes)?; + Ok(VersionedAiStores::V1 { stores: v1_stores }) + } + } + } +} + +impl VersionedAiStores { + pub fn into_latest(self) -> Result { + match self { + VersionedAiStores::V1 { stores } => { + log::info!("Migrating AI stores V1 → V2"); + Self::migrate_v1_to_v2(stores) + } + VersionedAiStores::V2 { stores } => Ok(stores), + } + } + + pub fn current(stores: AIStores) -> Self { + VersionedAiStores::V2 { stores } + } + + fn migrate_v1_to_v2(v1_stores: AiStoresV1) -> Result { + let inner_stores = fallible::try_new_arc_hashmap() + .map_err(|e| format!("Migration failed: {e}"))?; + { + let guard = inner_stores.pin(); + for (name, store) in v1_stores { + guard.insert(name, Arc::new(store)); + } + } + let stores = fallible::try_new_arc_hashmap() + .map_err(|e| format!("Migration failed: {e}"))?; + { + let guard = stores.pin(); + guard.insert(Schema::default(), inner_stores); + } + Ok(stores) + } +} diff --git a/ahnlich/ai/src/server/handler.rs b/ahnlich/ai/src/server/handler.rs index 3198cf704..ccf9eb777 100644 --- a/ahnlich/ai/src/server/handler.rs +++ b/ahnlich/ai/src/server/handler.rs @@ -1042,7 +1042,7 @@ impl AIProxyServer { match Persistence::load_snapshot_with_migration( persist_location, config.common.enable_mmap, - AIStoreHandler::load_and_migrate_snapshot, + AIStoreHandler::load_snapshot, ) { Err(e) => { log::error!("Failed to load snapshot from persist location {e}"); diff --git a/ahnlich/db/src/engine/mod.rs b/ahnlich/db/src/engine/mod.rs index 94a70afcf..ebfb475bf 100644 --- a/ahnlich/db/src/engine/mod.rs +++ b/ahnlich/db/src/engine/mod.rs @@ -1,3 +1,4 @@ pub mod operations; mod predicate; pub mod store; +pub mod versioned; diff --git a/ahnlich/db/src/engine/operations.rs b/ahnlich/db/src/engine/operations.rs index 99a645316..17c1110d4 100644 --- a/ahnlich/db/src/engine/operations.rs +++ b/ahnlich/db/src/engine/operations.rs @@ -15,11 +15,13 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; use crate::engine::store::StoreHandler; use crate::errors::ServerError; -fn resolve_schema(schema: &Option) -> Schema { - schema - .as_ref() - .map(|s| Schema::new(s.clone())) - .unwrap_or_default() +fn resolve_schema(schema: &Option) -> Result { + match schema { + Some(s) => { + Schema::try_new(s.clone()).map_err(|e| ServerError::InvalidArgument(e.to_owned())) + } + None => Ok(Schema::default()), + } } pub fn create_store( @@ -36,7 +38,7 @@ pub fn create_store( .filter_map(|index| index.index) .collect(); - let schema = resolve_schema(¶ms.schema); + let schema = resolve_schema(¶ms.schema)?; store_handler.create_store( StoreName { @@ -147,7 +149,7 @@ pub fn drop_store( store_handler: &StoreHandler, params: query::DropStore, ) -> Result { - let schema = resolve_schema(¶ms.schema); + let schema = resolve_schema(¶ms.schema)?; store_handler.drop_store( StoreName { value: params.store, @@ -182,7 +184,11 @@ pub fn set(store_handler: &StoreHandler, params: query::Set) -> Result server::StoreList { - let schema = params.schema.as_ref().map(|s| Schema::new(s.clone())); + let schema = params + .schema + .as_ref() + .filter(|s| !s.is_empty()) + .map(|s| Schema::new(s.clone())); let stores = store_handler .list_stores(schema.as_ref()) .into_iter() @@ -195,7 +201,8 @@ pub fn drop_schema( store_handler: &StoreHandler, params: query::DropSchema, ) -> Result { - let schema = Schema::new(params.schema); + let schema = Schema::try_new(params.schema) + .map_err(|e| ServerError::InvalidArgument(e.to_owned()))?; let dropped = store_handler.drop_schema(&schema)?; Ok(dropped as u64) } diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index 011c66311..edfb92177 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -29,6 +29,7 @@ use std::sync::atomic::Ordering; use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize}; use utils::fallible; use utils::persistence::AhnlichPersistenceUtils; +use utils::persistence::VersionedPersistence; type StoreEntry = (EmbeddingKey, Arc); type StoreEntryWithSimilarity = (EmbeddingKey, Arc, Similarity); @@ -87,7 +88,7 @@ pub struct StoreHandler { } impl AhnlichPersistenceUtils for StoreHandler { - type PersistenceObject = Stores; + type PersistenceObject = super::versioned::VersionedDbStores; #[tracing::instrument(skip_all)] fn write_flag(&self) -> Arc { @@ -96,7 +97,7 @@ impl AhnlichPersistenceUtils for StoreHandler { #[tracing::instrument(skip(self))] fn get_snapshot(&self) -> Self::PersistenceObject { - self.stores.clone() + super::versioned::VersionedDbStores::current(self.stores.clone()) } } @@ -187,31 +188,14 @@ impl StoreHandler { self.stores = stores_snapshot; } - /// Migrates a flat (pre-schema) persistence snapshot into the nested schema format. - /// Reads the old `HashMap` JSON format and wraps it under `"public"`. - pub(crate) fn load_and_migrate_snapshot( + /// Loads and migrates a persistence snapshot using the versioned format. + pub(crate) fn load_snapshot( bytes: &[u8], ) -> Result { - use std::collections::HashMap; - use utils::fallible; - - let flat_stores: HashMap = serde_json::from_slice(bytes) - .map_err(utils::persistence::PersistenceTaskError::SerdeError)?; - let inner_stores = fallible::try_new_arc_hashmap() - .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; - { - let guard = inner_stores.pin(); - for (name, store) in flat_stores { - guard.insert(name, Arc::new(store)); - } - } - let stores = fallible::try_new_arc_hashmap() - .map_err(utils::persistence::PersistenceTaskError::MigrationError)?; - { - let guard = stores.pin(); - guard.insert(Schema::default(), inner_stores); - } - Ok(stores) + let versioned = super::versioned::VersionedDbStores::load_and_migrate(bytes)?; + versioned + .into_latest() + .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e)) } /// Returns the inner stores map for a given schema, creating it if it does not exist. @@ -609,7 +593,7 @@ impl StoreHandler { pub(crate) fn drop_schema(&self, schema: &Schema) -> Result { if schema.as_str() == Schema::DEFAULT_NAME { return Err(ServerError::InvalidArgument( - "Cannot drop the default 'public' schema".to_owned(), + format!("Cannot drop the default '{}' schema", Schema::DEFAULT_NAME), )); } let pinned = self.stores.pin(); diff --git a/ahnlich/db/src/engine/versioned.rs b/ahnlich/db/src/engine/versioned.rs new file mode 100644 index 000000000..e3757fd02 --- /dev/null +++ b/ahnlich/db/src/engine/versioned.rs @@ -0,0 +1,77 @@ +use std::collections::HashMap; +use std::sync::Arc; + +use ahnlich_types::keyval::StoreName; +use ahnlich_types::schema::Schema; +use serde::{Deserialize, Serialize}; +use utils::fallible; +use utils::persistence::{PersistenceTaskError, VersionedPersistence}; + +use super::store::{Store, Stores}; + +pub const DB_CURRENT_VERSION: u32 = 2; +pub const DB_MIN_VERSION: u32 = 1; + +type DbStoresV1 = HashMap; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "db_version")] +pub enum VersionedDbStores { + #[serde(rename = "1")] + V1 { stores: DbStoresV1 }, + + #[serde(rename = "2")] + V2 { stores: Stores }, +} + +impl VersionedPersistence for VersionedDbStores { + const CURRENT_VERSION: u32 = DB_CURRENT_VERSION; + const MIN_VERSION: u32 = DB_MIN_VERSION; + + fn load_and_migrate(bytes: &[u8]) -> Result { + Self::validate_version(bytes)?; + + match serde_json::from_slice::(bytes) { + Ok(versioned) => Ok(versioned), + Err(_) => { + log::warn!("No db_version tag, attempting bare V1 load"); + let v1_stores: DbStoresV1 = serde_json::from_slice(bytes)?; + Ok(VersionedDbStores::V1 { stores: v1_stores }) + } + } + } +} + +impl VersionedDbStores { + pub fn into_latest(self) -> Result { + match self { + VersionedDbStores::V1 { stores } => { + log::info!("Migrating DB stores V1 → V2"); + Self::migrate_v1_to_v2(stores) + } + VersionedDbStores::V2 { stores } => Ok(stores), + } + } + + pub fn current(stores: Stores) -> Self { + VersionedDbStores::V2 { stores } + } + + fn migrate_v1_to_v2(v1_stores: DbStoresV1) -> Result { + let inner_stores = fallible::try_new_arc_hashmap() + .map_err(|e| format!("Migration failed: {e}"))?; + { + let guard = inner_stores.pin(); + for (name, store) in v1_stores { + guard.insert(name, Arc::new(store)); + } + } + let stores = fallible::try_new_arc_hashmap() + .map_err(|e| format!("Migration failed: {e}"))?; + { + let guard = stores.pin(); + guard.insert(Schema::default(), inner_stores); + } + Ok(stores) + } +} diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 5a1e94e50..580c2460b 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -889,7 +889,7 @@ impl Server { match Persistence::load_snapshot_with_migration( persist_location, config.common.enable_mmap, - StoreHandler::load_and_migrate_snapshot, + StoreHandler::load_snapshot, ) { Err(e) => { log::error!("Failed to load snapshot from persist location {e}"); diff --git a/ahnlich/types/src/schema.rs b/ahnlich/types/src/schema.rs index a1b8284b0..abdfc29b1 100644 --- a/ahnlich/types/src/schema.rs +++ b/ahnlich/types/src/schema.rs @@ -7,6 +7,9 @@ use std::fmt; /// on top of the flat store namespace. Every store belongs to exactly /// one schema. The schema `"public"` is the default used when none is /// specified, preserving backward compatibility with existing stores. +/// +/// Schema names are case-sensitive, so `"Public"` and `"public"` are +/// treated as distinct schemas. #[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize)] pub struct Schema(String); @@ -25,6 +28,16 @@ impl Schema { Self(name) } + /// Creates a new `Schema` with the given name, returning an error if `name` is empty. + pub fn try_new(name: impl Into) -> Result { + let name = name.into(); + if name.is_empty() { + Err("Schema name cannot be empty") + } else { + Ok(Self(name)) + } + } + /// Returns the schema name as a string slice. pub fn as_str(&self) -> &str { &self.0 diff --git a/ahnlich/utils/src/persistence.rs b/ahnlich/utils/src/persistence.rs index 98e31f61b..264ca2597 100644 --- a/ahnlich/utils/src/persistence.rs +++ b/ahnlich/utils/src/persistence.rs @@ -1,6 +1,7 @@ use memmap2::Mmap; -use serde::Serialize; use serde::de::DeserializeOwned; +use serde::Deserialize; +use serde::Serialize; use std::fmt::Debug; use std::fs::File; use std::fs::OpenOptions; @@ -20,6 +21,66 @@ use tokio::time::sleep; const MMAP_THRESHOLD: u64 = 64 * 1024; // 64KB +#[derive(Error, Debug)] +pub enum VersionError { + #[error("Persistence file version {file_version} is too new for this ahnlich binary (max supported: {max_version}). Please upgrade ahnlich.")] + VersionTooNew { + file_version: u32, + max_version: u32, + }, + + #[error("Persistence file version {file_version} is too old (minimum supported: {min_version}). Migration path removed.")] + VersionTooOld { + file_version: u32, + min_version: u32, + }, +} + +/// Trait for versioned persistence types. +pub trait VersionedPersistence: Sized + Serialize + for<'de> Deserialize<'de> { + /// The current version this binary writes. + const CURRENT_VERSION: u32; + + /// The minimum version this binary can read. + const MIN_VERSION: u32; + + /// Validate version compatibility from raw bytes. + fn validate_version(bytes: &[u8]) -> Result<(), VersionError> { + #[derive(Deserialize)] + struct VersionOnly { + #[serde(rename = "db_version")] + db_version: Option, + } + + let version = match serde_json::from_slice::(bytes) { + Ok(v) => v + .db_version + .and_then(|s| s.parse::().ok()) + .unwrap_or(1), + Err(_) => 1, + }; + + if version > Self::CURRENT_VERSION { + return Err(VersionError::VersionTooNew { + file_version: version, + max_version: Self::CURRENT_VERSION, + }); + } + + if version < Self::MIN_VERSION { + return Err(VersionError::VersionTooOld { + file_version: version, + min_version: Self::MIN_VERSION, + }); + } + + Ok(()) + } + + /// Load from bytes with automatic migration from older formats. + fn load_and_migrate(bytes: &[u8]) -> Result; +} + pub trait AhnlichPersistenceUtils { type PersistenceObject: Serialize + DeserializeOwned + Send + Sync + 'static + Debug; @@ -42,6 +103,8 @@ pub enum PersistenceTaskError { SerdeError(#[from] serde_json::error::Error), #[error("MigrationError {0}")] MigrationError(String), + #[error("VersionError {0}")] + Version(#[from] VersionError), } #[derive(Debug, Clone)] From 62fe15229ad6d0dada0dd39687b0f117e2915939 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 09:52:04 +0100 Subject: [PATCH 14/28] fix: clippy redundant closure warnings, drop build_fixed.py - Replace redundant closures with tuple variant in map_err calls - Remove build_fixed.py from Python SDK as requested --- ahnlich/ai/src/engine/operations.rs | 4 ++-- ahnlich/ai/src/engine/store.rs | 9 ++++---- ahnlich/ai/src/engine/versioned.rs | 8 +++---- ahnlich/ai/src/tests/migration_test.rs | 9 ++++---- ahnlich/db/src/engine/operations.rs | 4 ++-- ahnlich/db/src/engine/store.rs | 9 ++++---- ahnlich/db/src/engine/versioned.rs | 8 +++---- ahnlich/db/src/tests/server_tests.rs | 9 +++----- ahnlich/utils/src/persistence.rs | 22 +++++++++--------- sdk/ahnlich-client-py/build_fixed.py | 31 -------------------------- 10 files changed, 39 insertions(+), 74 deletions(-) delete mode 100644 sdk/ahnlich-client-py/build_fixed.py diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index 30401b74d..f9e3f9aa0 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -474,8 +474,8 @@ pub async fn drop_schema( params: AiDropSchema, _parent_id: Option, ) -> Result { - let schema = Schema::try_new(params.schema) - .map_err(|e| AIProxyError::InvalidArgument(e.to_owned()))?; + let schema = + Schema::try_new(params.schema).map_err(|e| AIProxyError::InvalidArgument(e.to_owned()))?; let dropped = store_handler.drop_schema(&schema)?; Ok(Del { diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index f774533a6..0ff805f40 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -98,7 +98,7 @@ impl AIStoreHandler { let versioned = super::versioned::VersionedAiStores::load_and_migrate(bytes)?; versioned .into_latest() - .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e)) + .map_err(utils::persistence::PersistenceTaskError::MigrationError) } /// Returns the inner stores map for a given schema, creating it if it does not exist. @@ -508,9 +508,10 @@ impl AIStoreHandler { #[tracing::instrument(skip(self))] pub(crate) fn drop_schema(&self, schema: &Schema) -> Result { if schema.as_str() == Schema::DEFAULT_NAME { - return Err(AIProxyError::InvalidArgument( - format!("Cannot drop the default '{}' schema", Schema::DEFAULT_NAME), - )); + return Err(AIProxyError::InvalidArgument(format!( + "Cannot drop the default '{}' schema", + Schema::DEFAULT_NAME + ))); } let pinned = self.stores.pin(); let removed = pinned.remove(schema); diff --git a/ahnlich/ai/src/engine/versioned.rs b/ahnlich/ai/src/engine/versioned.rs index 695e13c27..6fdeb6163 100644 --- a/ahnlich/ai/src/engine/versioned.rs +++ b/ahnlich/ai/src/engine/versioned.rs @@ -58,16 +58,16 @@ impl VersionedAiStores { } fn migrate_v1_to_v2(v1_stores: AiStoresV1) -> Result { - let inner_stores = fallible::try_new_arc_hashmap() - .map_err(|e| format!("Migration failed: {e}"))?; + let inner_stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; { let guard = inner_stores.pin(); for (name, store) in v1_stores { guard.insert(name, Arc::new(store)); } } - let stores = fallible::try_new_arc_hashmap() - .map_err(|e| format!("Migration failed: {e}"))?; + let stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; { let guard = stores.pin(); guard.insert(Schema::default(), inner_stores); diff --git a/ahnlich/ai/src/tests/migration_test.rs b/ahnlich/ai/src/tests/migration_test.rs index acbab9648..0675a4d8d 100644 --- a/ahnlich/ai/src/tests/migration_test.rs +++ b/ahnlich/ai/src/tests/migration_test.rs @@ -17,8 +17,7 @@ fn test_ai_migrate_old_flat_snapshot_via_json() { let json_bytes = serde_json::to_vec(&old_format).expect("Failed to serialize old format"); - let migrated: AIStores = - AIStoreHandler::load_and_migrate_snapshot(&json_bytes).expect("Migration failed"); + let migrated: AIStores = AIStoreHandler::load_snapshot(&json_bytes).expect("Migration failed"); let guard = migrated.guard(); let inner = migrated @@ -50,8 +49,8 @@ fn test_ai_migrate_old_flat_snapshot_via_file() { // Read back and migrate let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); - let migrated: AIStores = AIStoreHandler::load_and_migrate_snapshot(&read_bytes) - .expect("Migration of fixture failed"); + let migrated: AIStores = + AIStoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); let guard = migrated.guard(); let inner = migrated @@ -77,7 +76,7 @@ fn test_ai_migrate_from_committed_fixture() { let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); let migrated: AIStores = - AIStoreHandler::load_and_migrate_snapshot(&read_bytes).expect("Migration of fixture failed"); + AIStoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); let guard = migrated.guard(); let inner = migrated diff --git a/ahnlich/db/src/engine/operations.rs b/ahnlich/db/src/engine/operations.rs index 17c1110d4..2c8f0d7b1 100644 --- a/ahnlich/db/src/engine/operations.rs +++ b/ahnlich/db/src/engine/operations.rs @@ -201,8 +201,8 @@ pub fn drop_schema( store_handler: &StoreHandler, params: query::DropSchema, ) -> Result { - let schema = Schema::try_new(params.schema) - .map_err(|e| ServerError::InvalidArgument(e.to_owned()))?; + let schema = + Schema::try_new(params.schema).map_err(|e| ServerError::InvalidArgument(e.to_owned()))?; let dropped = store_handler.drop_schema(&schema)?; Ok(dropped as u64) } diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index edfb92177..753b06029 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -195,7 +195,7 @@ impl StoreHandler { let versioned = super::versioned::VersionedDbStores::load_and_migrate(bytes)?; versioned .into_latest() - .map_err(|e| utils::persistence::PersistenceTaskError::MigrationError(e)) + .map_err(utils::persistence::PersistenceTaskError::MigrationError) } /// Returns the inner stores map for a given schema, creating it if it does not exist. @@ -592,9 +592,10 @@ impl StoreHandler { #[tracing::instrument(skip(self))] pub(crate) fn drop_schema(&self, schema: &Schema) -> Result { if schema.as_str() == Schema::DEFAULT_NAME { - return Err(ServerError::InvalidArgument( - format!("Cannot drop the default '{}' schema", Schema::DEFAULT_NAME), - )); + return Err(ServerError::InvalidArgument(format!( + "Cannot drop the default '{}' schema", + Schema::DEFAULT_NAME + ))); } let pinned = self.stores.pin(); let removed = pinned.remove(schema); diff --git a/ahnlich/db/src/engine/versioned.rs b/ahnlich/db/src/engine/versioned.rs index e3757fd02..bd7f2c126 100644 --- a/ahnlich/db/src/engine/versioned.rs +++ b/ahnlich/db/src/engine/versioned.rs @@ -58,16 +58,16 @@ impl VersionedDbStores { } fn migrate_v1_to_v2(v1_stores: DbStoresV1) -> Result { - let inner_stores = fallible::try_new_arc_hashmap() - .map_err(|e| format!("Migration failed: {e}"))?; + let inner_stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; { let guard = inner_stores.pin(); for (name, store) in v1_stores { guard.insert(name, Arc::new(store)); } } - let stores = fallible::try_new_arc_hashmap() - .map_err(|e| format!("Migration failed: {e}"))?; + let stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; { let guard = stores.pin(); guard.insert(Schema::default(), inner_stores); diff --git a/ahnlich/db/src/tests/server_tests.rs b/ahnlich/db/src/tests/server_tests.rs index d00d81a4d..6196407bb 100644 --- a/ahnlich/db/src/tests/server_tests.rs +++ b/ahnlich/db/src/tests/server_tests.rs @@ -4932,8 +4932,7 @@ fn test_migrate_old_flat_snapshot() { let old_format_bytes = serde_json::to_vec(&pinned).expect("Failed to serialize old format"); // Now simulate loading this old-format snapshot via migration - let migrated = - StoreHandler::load_and_migrate_snapshot(&old_format_bytes).expect("Migration failed"); + let migrated = StoreHandler::load_snapshot(&old_format_bytes).expect("Migration failed"); // Verify: migrated stores should contain the store under "public" let migrated_guard = migrated.guard(); @@ -4987,8 +4986,7 @@ fn test_migrate_old_flat_snapshot_json_file() { // Now read it back and verify it migrates correctly let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); - let migrated = - StoreHandler::load_and_migrate_snapshot(&read_bytes).expect("Migration of fixture failed"); + let migrated = StoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); let migrated_guard = migrated.guard(); let migrated_inner = migrated @@ -5017,8 +5015,7 @@ fn test_migrate_from_committed_db_fixture() { let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); - let migrated = - StoreHandler::load_and_migrate_snapshot(&read_bytes).expect("Migration of fixture failed"); + let migrated = StoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); let migrated_guard = migrated.guard(); let migrated_inner = migrated diff --git a/ahnlich/utils/src/persistence.rs b/ahnlich/utils/src/persistence.rs index 264ca2597..2b11f644a 100644 --- a/ahnlich/utils/src/persistence.rs +++ b/ahnlich/utils/src/persistence.rs @@ -1,7 +1,7 @@ use memmap2::Mmap; -use serde::de::DeserializeOwned; use serde::Deserialize; use serde::Serialize; +use serde::de::DeserializeOwned; use std::fmt::Debug; use std::fs::File; use std::fs::OpenOptions; @@ -23,17 +23,15 @@ const MMAP_THRESHOLD: u64 = 64 * 1024; // 64KB #[derive(Error, Debug)] pub enum VersionError { - #[error("Persistence file version {file_version} is too new for this ahnlich binary (max supported: {max_version}). Please upgrade ahnlich.")] - VersionTooNew { - file_version: u32, - max_version: u32, - }, - - #[error("Persistence file version {file_version} is too old (minimum supported: {min_version}). Migration path removed.")] - VersionTooOld { - file_version: u32, - min_version: u32, - }, + #[error( + "Persistence file version {file_version} is too new for this ahnlich binary (max supported: {max_version}). Please upgrade ahnlich." + )] + VersionTooNew { file_version: u32, max_version: u32 }, + + #[error( + "Persistence file version {file_version} is too old (minimum supported: {min_version}). Migration path removed." + )] + VersionTooOld { file_version: u32, min_version: u32 }, } /// Trait for versioned persistence types. diff --git a/sdk/ahnlich-client-py/build_fixed.py b/sdk/ahnlich-client-py/build_fixed.py deleted file mode 100644 index 05b8f86f7..000000000 --- a/sdk/ahnlich-client-py/build_fixed.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -import pathlib -import sys - -from grpc_tools import protoc - -PROTO_DIR = "../../protos/" -OUT_DIR = "./ahnlich_client_py/grpc/" - -# Ensure the output directory exists -pathlib.Path(OUT_DIR).mkdir(parents=True, exist_ok=True) - - -def generate_from_protos(): - proto_files = [str(p) for p in pathlib.Path(PROTO_DIR).rglob("*.proto")] - if not proto_files: - print("No .proto files found.") - return - - command = [ - "grpc_tools.protoc", - f"--proto_path={PROTO_DIR}", - f"--python_betterproto_out={OUT_DIR}", - ] + proto_files - - if protoc.main(command) != 0: - raise RuntimeError("Protobuf compilation failed") - - -if __name__ == "__main__": - generate_from_protos() From fe6704576faa33ff873bf95cef43a2c497c83be8 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 11:32:12 +0100 Subject: [PATCH 15/28] chore: regenerate gRPC stubs to match CI formatting --- ahnlich/types/src/ai/models.rs | 15 +- ahnlich/types/src/ai/pipeline.rs | 8 +- ahnlich/types/src/ai/query.rs | 39 +- ahnlich/types/src/ai/server.rs | 3 +- ahnlich/types/src/algorithm/nonlinear.rs | 71 +- ahnlich/types/src/client.rs | 3 +- ahnlich/types/src/db/pipeline.rs | 4 +- ahnlich/types/src/db/query.rs | 15 +- ahnlich/types/src/db/server.rs | 8 +- ahnlich/types/src/keyval.rs | 12 +- ahnlich/types/src/lib.rs | 2 +- ahnlich/types/src/metadata.rs | 6 +- ahnlich/types/src/services/ai_service.rs | 1016 ++++++++-------------- ahnlich/types/src/services/db_service.rs | 919 +++++++------------ 14 files changed, 783 insertions(+), 1338 deletions(-) diff --git a/ahnlich/types/src/ai/models.rs b/ahnlich/types/src/ai/models.rs index 6c9e7a31e..58081413f 100644 --- a/ahnlich/types/src/ai/models.rs +++ b/ahnlich/types/src/ai/models.rs @@ -1,6 +1,17 @@ // This file is @generated by prost-build. -#[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + serde::Serialize, + serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum AiModel { AllMiniLmL6V2 = 0, diff --git a/ahnlich/types/src/ai/pipeline.rs b/ahnlich/types/src/ai/pipeline.rs index b70cb51bc..073e45199 100644 --- a/ahnlich/types/src/ai/pipeline.rs +++ b/ahnlich/types/src/ai/pipeline.rs @@ -20,9 +20,7 @@ pub mod ai_query { #[prost(message, tag = "4")] CreatePredIndex(super::super::query::CreatePredIndex), #[prost(message, tag = "5")] - CreateNonLinearAlgorithmIndex( - super::super::query::CreateNonLinearAlgorithmIndex, - ), + CreateNonLinearAlgorithmIndex(super::super::query::CreateNonLinearAlgorithmIndex), #[prost(message, tag = "6")] DropPredIndex(super::super::query::DropPredIndex), #[prost(message, tag = "7")] @@ -46,9 +44,7 @@ pub mod ai_query { #[prost(message, tag = "16")] Ping(super::super::query::Ping), #[prost(message, tag = "17")] - ConvertStoreInputToEmbeddings( - super::super::query::ConvertStoreInputToEmbeddings, - ), + ConvertStoreInputToEmbeddings(super::super::query::ConvertStoreInputToEmbeddings), #[prost(message, tag = "18")] DelPred(super::super::query::DelPred), #[prost(message, tag = "19")] diff --git a/ahnlich/types/src/ai/query.rs b/ahnlich/types/src/ai/query.rs index 8f5d479c2..80f64c8da 100644 --- a/ahnlich/types/src/ai/query.rs +++ b/ahnlich/types/src/ai/query.rs @@ -22,9 +22,8 @@ pub struct CreateStore { pub predicates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// Optional non-linear indices #[prost(message, repeated, tag = "5")] - pub non_linear_indices: ::prost::alloc::vec::Vec< - super::super::algorithm::nonlinear::NonLinearIndex, - >, + pub non_linear_indices: + ::prost::alloc::vec::Vec, /// Whether to throw an error if the store already exists #[prost(bool, tag = "6")] pub error_if_exists: bool, @@ -64,7 +63,10 @@ pub struct GetSimN { #[prost(uint64, tag = "4")] pub closest_n: u64, /// Algorithm to use for similarity search - #[prost(enumeration = "super::super::algorithm::algorithms::Algorithm", tag = "5")] + #[prost( + enumeration = "super::super::algorithm::algorithms::Algorithm", + tag = "5" + )] pub algorithm: i32, /// Preprocessing actions to apply to input before querying #[prost(enumeration = "super::preprocess::PreprocessAction", tag = "6")] @@ -78,10 +80,8 @@ pub struct GetSimN { pub execution_provider: ::core::option::Option, /// Optional runtime parameters for the model (e.g., confidence_threshold for face detection) #[prost(map = "string, string", tag = "8")] - pub model_params: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub model_params: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreatePredIndex { @@ -103,9 +103,8 @@ pub struct CreateNonLinearAlgorithmIndex { pub store: ::prost::alloc::string::String, /// Non-linear indices to create #[prost(message, repeated, tag = "2")] - pub non_linear_indices: ::prost::alloc::vec::Vec< - super::super::algorithm::nonlinear::NonLinearIndex, - >, + pub non_linear_indices: + ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct DropPredIndex { @@ -254,10 +253,8 @@ pub struct Set { pub execution_provider: ::core::option::Option, /// Optional runtime parameters for the model (e.g., confidence_threshold for face detection) #[prost(map = "string, string", tag = "5")] - pub model_params: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub model_params: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConvertStoreInputToEmbeddings { @@ -267,15 +264,17 @@ pub struct ConvertStoreInputToEmbeddings { #[prost(message, repeated, tag = "1")] pub store_inputs: ::prost::alloc::vec::Vec, /// Preprocessing actions to apply to input before querying - #[prost(enumeration = "super::preprocess::PreprocessAction", optional, tag = "2")] + #[prost( + enumeration = "super::preprocess::PreprocessAction", + optional, + tag = "2" + )] pub preprocess_action: ::core::option::Option, /// AI model used for querying (string or image-based) #[prost(enumeration = "super::models::AiModel", tag = "3")] pub model: i32, /// Optional runtime parameters for the model (e.g., confidence_threshold for face detection) #[prost(map = "string, string", tag = "4")] - pub model_params: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub model_params: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } diff --git a/ahnlich/types/src/ai/server.rs b/ahnlich/types/src/ai/server.rs index 4cb832ca0..2539184b3 100644 --- a/ahnlich/types/src/ai/server.rs +++ b/ahnlich/types/src/ai/server.rs @@ -59,8 +59,7 @@ pub struct CreateIndex { #[prost(uint64, tag = "1")] pub created_indexes: u64, } -#[derive(Eq, PartialOrd, Ord, Hash)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Eq, PartialOrd, Ord, Hash, Clone, PartialEq, ::prost::Message)] pub struct AiStoreInfo { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, diff --git a/ahnlich/types/src/algorithm/nonlinear.rs b/ahnlich/types/src/algorithm/nonlinear.rs index 562178315..e490a2e66 100644 --- a/ahnlich/types/src/algorithm/nonlinear.rs +++ b/ahnlich/types/src/algorithm/nonlinear.rs @@ -1,6 +1,16 @@ // This file is @generated by prost-build. -#[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive( + serde::Serialize, + serde::Deserialize, + Eq, + Hash, + PartialOrd, + Ord, + Clone, + Copy, + PartialEq, + ::prost::Message, +)] pub struct HnswConfig { #[prost(enumeration = "super::algorithms::DistanceMetric", optional, tag = "1")] pub distance: ::core::option::Option, @@ -15,19 +25,49 @@ pub struct HnswConfig { #[prost(bool, optional, tag = "6")] pub keep_pruned_connections: ::core::option::Option, } -#[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive( + serde::Serialize, + serde::Deserialize, + Eq, + Hash, + PartialOrd, + Ord, + Clone, + Copy, + PartialEq, + ::prost::Message, +)] pub struct KdTreeConfig {} -#[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive( + serde::Serialize, + serde::Deserialize, + Eq, + Hash, + PartialOrd, + Ord, + Clone, + Copy, + PartialEq, + ::prost::Message, +)] pub struct NonLinearIndex { #[prost(oneof = "non_linear_index::Index", tags = "1, 2")] pub index: ::core::option::Option, } /// Nested message and enum types in `NonLinearIndex`. pub mod non_linear_index { - #[derive(serde::Serialize, serde::Deserialize, Eq, Hash, PartialOrd, Ord)] - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive( + serde::Serialize, + serde::Deserialize, + Eq, + Hash, + PartialOrd, + Ord, + Clone, + Copy, + PartialEq, + ::prost::Oneof, + )] pub enum Index { #[prost(message, tag = "1")] Hnsw(super::HnswConfig), @@ -35,8 +75,19 @@ pub mod non_linear_index { Kdtree(super::KdTreeConfig), } } -#[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + serde::Serialize, + serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum NonLinearAlgorithm { KdTree = 0, diff --git a/ahnlich/types/src/client.rs b/ahnlich/types/src/client.rs index f27b3845a..ffd3f2b1a 100644 --- a/ahnlich/types/src/client.rs +++ b/ahnlich/types/src/client.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[derive(PartialOrd, Ord, Eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(PartialOrd, Ord, Eq, Clone, PartialEq, ::prost::Message)] pub struct ConnectedClient { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, diff --git a/ahnlich/types/src/db/pipeline.rs b/ahnlich/types/src/db/pipeline.rs index e7047460e..302d704a2 100644 --- a/ahnlich/types/src/db/pipeline.rs +++ b/ahnlich/types/src/db/pipeline.rs @@ -22,9 +22,7 @@ pub mod db_query { #[prost(message, tag = "5")] CreatePredIndex(super::super::query::CreatePredIndex), #[prost(message, tag = "6")] - CreateNonLinearAlgorithmIndex( - super::super::query::CreateNonLinearAlgorithmIndex, - ), + CreateNonLinearAlgorithmIndex(super::super::query::CreateNonLinearAlgorithmIndex), #[prost(message, tag = "7")] DropPredIndex(super::super::query::DropPredIndex), #[prost(message, tag = "8")] diff --git a/ahnlich/types/src/db/query.rs b/ahnlich/types/src/db/query.rs index 4fa7f1e09..8d5828253 100644 --- a/ahnlich/types/src/db/query.rs +++ b/ahnlich/types/src/db/query.rs @@ -14,9 +14,8 @@ pub struct CreateStore { pub create_predicates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// Non-linear algorithms for indexing. #[prost(message, repeated, tag = "4")] - pub non_linear_indices: ::prost::alloc::vec::Vec< - super::super::algorithm::nonlinear::NonLinearIndex, - >, + pub non_linear_indices: + ::prost::alloc::vec::Vec, /// Flag indicating whether to error if store already exists. #[prost(bool, tag = "5")] pub error_if_exists: bool, @@ -59,7 +58,10 @@ pub struct GetSimN { #[prost(uint64, tag = "3")] pub closest_n: u64, /// The algorithm to use for similarity computation. - #[prost(enumeration = "super::super::algorithm::algorithms::Algorithm", tag = "4")] + #[prost( + enumeration = "super::super::algorithm::algorithms::Algorithm", + tag = "4" + )] pub algorithm: i32, /// The predicate condition to apply. #[prost(message, optional, tag = "5")] @@ -85,9 +87,8 @@ pub struct CreateNonLinearAlgorithmIndex { pub store: ::prost::alloc::string::String, /// Non-linear algorithms to create indices for. #[prost(message, repeated, tag = "2")] - pub non_linear_indices: ::prost::alloc::vec::Vec< - super::super::algorithm::nonlinear::NonLinearIndex, - >, + pub non_linear_indices: + ::prost::alloc::vec::Vec, } /// Drops the specified predicates from the store. /// If `error_if_not_exists` is true, an error is returned if the predicate does not exist. diff --git a/ahnlich/types/src/db/server.rs b/ahnlich/types/src/db/server.rs index 8781f9ced..16f60003d 100644 --- a/ahnlich/types/src/db/server.rs +++ b/ahnlich/types/src/db/server.rs @@ -88,8 +88,7 @@ pub mod server_response { StoreInfo(super::StoreInfo), } } -#[derive(Hash, Eq, Ord, PartialOrd)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Hash, Eq, Ord, PartialOrd, Clone, PartialEq, ::prost::Message)] pub struct StoreInfo { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -98,9 +97,8 @@ pub struct StoreInfo { #[prost(uint64, tag = "3")] pub size_in_bytes: u64, #[prost(message, repeated, tag = "4")] - pub non_linear_indices: ::prost::alloc::vec::Vec< - super::super::algorithm::nonlinear::NonLinearIndex, - >, + pub non_linear_indices: + ::prost::alloc::vec::Vec, #[prost(string, repeated, tag = "5")] pub predicate_indices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(uint32, tag = "6")] diff --git a/ahnlich/types/src/keyval.rs b/ahnlich/types/src/keyval.rs index 44b09f289..6c5f7fb37 100644 --- a/ahnlich/types/src/keyval.rs +++ b/ahnlich/types/src/keyval.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[derive(Eq, Hash, Ord, PartialOrd)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Eq, Hash, Ord, PartialOrd, Clone, PartialEq, ::prost::Message)] pub struct StoreName { #[prost(string, tag = "1")] pub value: ::prost::alloc::string::String, @@ -43,12 +42,9 @@ pub struct AiStoreEntry { #[prost(message, optional, tag = "2")] pub value: ::core::option::Option, } -#[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] pub struct StoreValue { #[prost(map = "string, message", tag = "1")] - pub value: ::std::collections::HashMap< - ::prost::alloc::string::String, - super::metadata::MetadataValue, - >, + pub value: + ::std::collections::HashMap<::prost::alloc::string::String, super::metadata::MetadataValue>, } diff --git a/ahnlich/types/src/lib.rs b/ahnlich/types/src/lib.rs index 088e31ebd..61dd745cb 100644 --- a/ahnlich/types/src/lib.rs +++ b/ahnlich/types/src/lib.rs @@ -11,4 +11,4 @@ pub mod services; pub mod shared; pub mod similarity; pub mod utils; -pub mod version; \ No newline at end of file +pub mod version; diff --git a/ahnlich/types/src/metadata.rs b/ahnlich/types/src/metadata.rs index 2fd5770fe..129d4d9a6 100644 --- a/ahnlich/types/src/metadata.rs +++ b/ahnlich/types/src/metadata.rs @@ -1,14 +1,12 @@ // This file is @generated by prost-build. -#[derive(PartialOrd, Ord, Hash, Eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(PartialOrd, Ord, Hash, Eq, Clone, PartialEq, ::prost::Message)] pub struct MetadataValue { #[prost(oneof = "metadata_value::Value", tags = "2, 3, 4")] pub value: ::core::option::Option, } /// Nested message and enum types in `MetadataValue`. pub mod metadata_value { - #[derive(PartialOrd, Ord, Hash, Eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(PartialOrd, Ord, Hash, Eq, Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(string, tag = "2")] RawString(::prost::alloc::string::String), diff --git a/ahnlich/types/src/services/ai_service.rs b/ahnlich/types/src/services/ai_service.rs index 7d4cc411f..d825b06a7 100644 --- a/ahnlich/types/src/services/ai_service.rs +++ b/ahnlich/types/src/services/ai_service.rs @@ -6,10 +6,10 @@ pub mod ai_service_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct AiServiceClient { inner: tonic::client::Grpc, @@ -48,14 +48,13 @@ pub mod ai_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, + http::Request, + Response = http::Response< + >::ResponseBody, + >, >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { AiServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -98,49 +97,38 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/CreateStore", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/CreateStore"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "CreateStore")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "CreateStore", + )); self.inner.unary(req, path, codec).await } pub async fn create_pred_index( &mut self, - request: impl tonic::IntoRequest< - super::super::super::ai::query::CreatePredIndex, - >, + request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/CreatePredIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.ai_service.AIService", "CreatePredIndex"), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "CreatePredIndex", + )); self.inner.unary(req, path, codec).await } pub async fn create_non_linear_algorithm_index( @@ -152,48 +140,32 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/CreateNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "services.ai_service.AIService", - "CreateNonLinearAlgorithmIndex", - ), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "CreateNonLinearAlgorithmIndex", + )); self.inner.unary(req, path, codec).await } /// * Read methods * pub async fn get_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/GetKey", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetKey"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetKey")); @@ -202,22 +174,14 @@ pub mod ai_service_client { pub async fn get_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/GetPred", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetPred"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetPred")); @@ -230,18 +194,12 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/GetSimN", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetSimN"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetSimN")); @@ -254,18 +212,12 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/GetStore", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/GetStore"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "GetStore")); @@ -275,22 +227,13 @@ pub mod ai_service_client { pub async fn set( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/Set", - ); + let path = http::uri::PathAndQuery::from_static("/services.ai_service.AIService/Set"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "Set")); @@ -299,30 +242,21 @@ pub mod ai_service_client { /// * Delete methods * pub async fn drop_pred_index( &mut self, - request: impl tonic::IntoRequest< - super::super::super::ai::query::DropPredIndex, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/DropPredIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.ai_service.AIService", "DropPredIndex"), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "DropPredIndex", + )); self.inner.unary(req, path, codec).await } pub async fn drop_non_linear_algorithm_index( @@ -330,51 +264,33 @@ pub mod ai_service_client { request: impl tonic::IntoRequest< super::super::super::ai::query::DropNonLinearAlgorithmIndex, >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/DropNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "services.ai_service.AIService", - "DropNonLinearAlgorithmIndex", - ), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "DropNonLinearAlgorithmIndex", + )); self.inner.unary(req, path, codec).await } pub async fn del_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/DelKey", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DelKey"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "DelKey")); @@ -383,22 +299,14 @@ pub mod ai_service_client { pub async fn del_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/DelPred", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DelPred"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "DelPred")); @@ -407,49 +315,37 @@ pub mod ai_service_client { pub async fn drop_store( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/DropStore", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DropStore"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "DropStore")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "DropStore", + )); self.inner.unary(req, path, codec).await } pub async fn drop_schema( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/DropSchema", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/DropSchema"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "DropSchema")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "DropSchema", + )); self.inner.unary(req, path, codec).await } /// * Ancillary info methods * @@ -460,21 +356,17 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/ListClients", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/ListClients"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "ListClients")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "ListClients", + )); self.inner.unary(req, path, codec).await } pub async fn list_stores( @@ -484,21 +376,17 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/ListStores", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/ListStores"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "ListStores")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "ListStores", + )); self.inner.unary(req, path, codec).await } pub async fn info_server( @@ -508,45 +396,35 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/InfoServer", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/InfoServer"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "InfoServer")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "InfoServer", + )); self.inner.unary(req, path, codec).await } pub async fn purge_stores( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/PurgeStores", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/PurgeStores"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.ai_service.AIService", "PurgeStores")); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "PurgeStores", + )); self.inner.unary(req, path, codec).await } pub async fn ping( @@ -556,18 +434,11 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/Ping", - ); + let path = http::uri::PathAndQuery::from_static("/services.ai_service.AIService/Ping"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "Ping")); @@ -582,50 +453,34 @@ pub mod ai_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.ai_service.AIService/ConvertStoreInputToEmbeddings", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "services.ai_service.AIService", - "ConvertStoreInputToEmbeddings", - ), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.ai_service.AIService", + "ConvertStoreInputToEmbeddings", + )); self.inner.unary(req, path, codec).await } /// * Pipeline method for all methods * pub async fn pipeline( &mut self, - request: impl tonic::IntoRequest< - super::super::super::ai::pipeline::AiRequestPipeline, - >, + request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.ai_service.AIService/Pipeline", - ); + let path = + http::uri::PathAndQuery::from_static("/services.ai_service.AIService/Pipeline"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.ai_service.AIService", "Pipeline")); @@ -640,7 +495,7 @@ pub mod ai_service_server { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with AiServiceServer. @@ -663,9 +518,7 @@ pub mod ai_service_server { >; async fn create_non_linear_algorithm_index( &self, - request: tonic::Request< - super::super::super::ai::query::CreateNonLinearAlgorithmIndex, - >, + request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, @@ -674,17 +527,11 @@ pub mod ai_service_server { async fn get_key( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn get_pred( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn get_sim_n( &self, request: tonic::Request, @@ -703,55 +550,32 @@ pub mod ai_service_server { async fn set( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; /// * Delete methods * async fn drop_pred_index( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn drop_non_linear_algorithm_index( &self, - request: tonic::Request< - super::super::super::ai::query::DropNonLinearAlgorithmIndex, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; async fn del_key( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn del_pred( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn drop_store( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn drop_schema( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; /// * Ancillary info methods * async fn list_clients( &self, @@ -777,10 +601,7 @@ pub mod ai_service_server { async fn purge_stores( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn ping( &self, request: tonic::Request, @@ -790,9 +611,7 @@ pub mod ai_service_server { >; async fn convert_store_input_to_embeddings( &self, - request: tonic::Request< - super::super::super::ai::query::ConvertStoreInputToEmbeddings, - >, + request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, @@ -827,10 +646,7 @@ pub mod ai_service_server { max_encoding_message_size: None, } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -885,21 +701,15 @@ pub mod ai_service_server { "/services.ai_service.AIService/CreateStore" => { #[allow(non_camel_case_types)] struct CreateStoreSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::CreateStore, - > for CreateStoreSvc { + impl + tonic::server::UnaryService + for CreateStoreSvc + { type Response = super::super::super::ai::server::Unit; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::CreateStore, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -933,16 +743,12 @@ pub mod ai_service_server { "/services.ai_service.AIService/CreatePredIndex" => { #[allow(non_camel_case_types)] struct CreatePredIndexSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::CreatePredIndex, - > for CreatePredIndexSvc { + impl + tonic::server::UnaryService + for CreatePredIndexSvc + { type Response = super::super::super::ai::server::CreateIndex; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -981,16 +787,13 @@ pub mod ai_service_server { "/services.ai_service.AIService/CreateNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct CreateNonLinearAlgorithmIndexSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::CreateNonLinearAlgorithmIndex, - > for CreateNonLinearAlgorithmIndexSvc { + impl + tonic::server::UnaryService< + super::super::super::ai::query::CreateNonLinearAlgorithmIndex, + > for CreateNonLinearAlgorithmIndexSvc + { type Response = super::super::super::ai::server::CreateIndex; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -999,10 +802,7 @@ pub mod ai_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_non_linear_algorithm_index( - &inner, - request, - ) + ::create_non_linear_algorithm_index(&inner, request) .await }; Box::pin(fut) @@ -1033,25 +833,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetKey" => { #[allow(non_camel_case_types)] struct GetKeySvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService - for GetKeySvc { + impl + tonic::server::UnaryService + for GetKeySvc + { type Response = super::super::super::ai::server::Get; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::GetKey, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_key(&inner, request).await - }; + let fut = + async move { ::get_key(&inner, request).await }; Box::pin(fut) } } @@ -1080,26 +874,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetPred" => { #[allow(non_camel_case_types)] struct GetPredSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::GetPred, - > for GetPredSvc { + impl + tonic::server::UnaryService + for GetPredSvc + { type Response = super::super::super::ai::server::Get; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::GetPred, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_pred(&inner, request).await - }; + let fut = + async move { ::get_pred(&inner, request).await }; Box::pin(fut) } } @@ -1128,26 +915,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetSimN" => { #[allow(non_camel_case_types)] struct GetSimNSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::GetSimN, - > for GetSimNSvc { + impl + tonic::server::UnaryService + for GetSimNSvc + { type Response = super::super::super::ai::server::GetSimN; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::GetSimN, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_sim_n(&inner, request).await - }; + let fut = + async move { ::get_sim_n(&inner, request).await }; Box::pin(fut) } } @@ -1176,26 +956,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/GetStore" => { #[allow(non_camel_case_types)] struct GetStoreSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::GetStore, - > for GetStoreSvc { + impl + tonic::server::UnaryService + for GetStoreSvc + { type Response = super::super::super::ai::server::AiStoreInfo; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::GetStore, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_store(&inner, request).await - }; + let fut = + async move { ::get_store(&inner, request).await }; Box::pin(fut) } } @@ -1224,23 +997,18 @@ pub mod ai_service_server { "/services.ai_service.AIService/Set" => { #[allow(non_camel_case_types)] struct SetSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService - for SetSvc { + impl + tonic::server::UnaryService + for SetSvc + { type Response = super::super::super::ai::server::Set; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::set(&inner, request).await - }; + let fut = async move { ::set(&inner, request).await }; Box::pin(fut) } } @@ -1269,21 +1037,15 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropPredIndex" => { #[allow(non_camel_case_types)] struct DropPredIndexSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::DropPredIndex, - > for DropPredIndexSvc { + impl + tonic::server::UnaryService + for DropPredIndexSvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::DropPredIndex, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1317,16 +1079,13 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct DropNonLinearAlgorithmIndexSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::DropNonLinearAlgorithmIndex, - > for DropNonLinearAlgorithmIndexSvc { + impl + tonic::server::UnaryService< + super::super::super::ai::query::DropNonLinearAlgorithmIndex, + > for DropNonLinearAlgorithmIndexSvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -1335,10 +1094,7 @@ pub mod ai_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::drop_non_linear_algorithm_index( - &inner, - request, - ) + ::drop_non_linear_algorithm_index(&inner, request) .await }; Box::pin(fut) @@ -1369,25 +1125,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/DelKey" => { #[allow(non_camel_case_types)] struct DelKeySvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService - for DelKeySvc { + impl + tonic::server::UnaryService + for DelKeySvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::DelKey, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::del_key(&inner, request).await - }; + let fut = + async move { ::del_key(&inner, request).await }; Box::pin(fut) } } @@ -1416,26 +1166,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/DelPred" => { #[allow(non_camel_case_types)] struct DelPredSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::DelPred, - > for DelPredSvc { + impl + tonic::server::UnaryService + for DelPredSvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::DelPred, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::del_pred(&inner, request).await - }; + let fut = + async move { ::del_pred(&inner, request).await }; Box::pin(fut) } } @@ -1464,26 +1207,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropStore" => { #[allow(non_camel_case_types)] struct DropStoreSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::DropStore, - > for DropStoreSvc { + impl + tonic::server::UnaryService + for DropStoreSvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::DropStore, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::drop_store(&inner, request).await - }; + let fut = + async move { ::drop_store(&inner, request).await }; Box::pin(fut) } } @@ -1512,26 +1248,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/DropSchema" => { #[allow(non_camel_case_types)] struct DropSchemaSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::DropSchema, - > for DropSchemaSvc { + impl + tonic::server::UnaryService + for DropSchemaSvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::DropSchema, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::drop_schema(&inner, request).await - }; + let fut = + async move { ::drop_schema(&inner, request).await }; Box::pin(fut) } } @@ -1560,21 +1289,15 @@ pub mod ai_service_server { "/services.ai_service.AIService/ListClients" => { #[allow(non_camel_case_types)] struct ListClientsSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::ListClients, - > for ListClientsSvc { + impl + tonic::server::UnaryService + for ListClientsSvc + { type Response = super::super::super::ai::server::ClientList; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::ListClients, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1608,26 +1331,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/ListStores" => { #[allow(non_camel_case_types)] struct ListStoresSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::ListStores, - > for ListStoresSvc { + impl + tonic::server::UnaryService + for ListStoresSvc + { type Response = super::super::super::ai::server::StoreList; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::ListStores, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::list_stores(&inner, request).await - }; + let fut = + async move { ::list_stores(&inner, request).await }; Box::pin(fut) } } @@ -1656,26 +1372,19 @@ pub mod ai_service_server { "/services.ai_service.AIService/InfoServer" => { #[allow(non_camel_case_types)] struct InfoServerSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::InfoServer, - > for InfoServerSvc { + impl + tonic::server::UnaryService + for InfoServerSvc + { type Response = super::super::super::ai::server::InfoServer; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::InfoServer, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::info_server(&inner, request).await - }; + let fut = + async move { ::info_server(&inner, request).await }; Box::pin(fut) } } @@ -1704,21 +1413,15 @@ pub mod ai_service_server { "/services.ai_service.AIService/PurgeStores" => { #[allow(non_camel_case_types)] struct PurgeStoresSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::PurgeStores, - > for PurgeStoresSvc { + impl + tonic::server::UnaryService + for PurgeStoresSvc + { type Response = super::super::super::ai::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::ai::query::PurgeStores, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1752,23 +1455,18 @@ pub mod ai_service_server { "/services.ai_service.AIService/Ping" => { #[allow(non_camel_case_types)] struct PingSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService - for PingSvc { + impl + tonic::server::UnaryService + for PingSvc + { type Response = super::super::super::ai::server::Pong; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::ping(&inner, request).await - }; + let fut = async move { ::ping(&inner, request).await }; Box::pin(fut) } } @@ -1797,16 +1495,13 @@ pub mod ai_service_server { "/services.ai_service.AIService/ConvertStoreInputToEmbeddings" => { #[allow(non_camel_case_types)] struct ConvertStoreInputToEmbeddingsSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::query::ConvertStoreInputToEmbeddings, - > for ConvertStoreInputToEmbeddingsSvc { + impl + tonic::server::UnaryService< + super::super::super::ai::query::ConvertStoreInputToEmbeddings, + > for ConvertStoreInputToEmbeddingsSvc + { type Response = super::super::super::ai::server::StoreInputToEmbeddingsList; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -1815,10 +1510,7 @@ pub mod ai_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::convert_store_input_to_embeddings( - &inner, - request, - ) + ::convert_store_input_to_embeddings(&inner, request) .await }; Box::pin(fut) @@ -1849,16 +1541,13 @@ pub mod ai_service_server { "/services.ai_service.AIService/Pipeline" => { #[allow(non_camel_case_types)] struct PipelineSvc(pub Arc); - impl< - T: AiService, - > tonic::server::UnaryService< - super::super::super::ai::pipeline::AiRequestPipeline, - > for PipelineSvc { + impl + tonic::server::UnaryService< + super::super::super::ai::pipeline::AiRequestPipeline, + > for PipelineSvc + { type Response = super::super::super::ai::pipeline::AiResponsePipeline; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -1866,9 +1555,8 @@ pub mod ai_service_server { >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::pipeline(&inner, request).await - }; + let fut = + async move { ::pipeline(&inner, request).await }; Box::pin(fut) } } @@ -1894,23 +1582,19 @@ pub mod ai_service_server { }; Box::pin(fut) } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } + _ => Box::pin(async move { + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers.insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers.insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) + }), } } } diff --git a/ahnlich/types/src/services/db_service.rs b/ahnlich/types/src/services/db_service.rs index 7516eb1b2..69ceede44 100644 --- a/ahnlich/types/src/services/db_service.rs +++ b/ahnlich/types/src/services/db_service.rs @@ -6,10 +6,10 @@ pub mod db_service_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct DbServiceClient { inner: tonic::client::Grpc, @@ -48,14 +48,13 @@ pub mod db_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, + http::Request, + Response = http::Response< + >::ResponseBody, + >, >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { DbServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -98,49 +97,38 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/CreateStore", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/CreateStore"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.db_service.DBService", "CreateStore")); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "CreateStore", + )); self.inner.unary(req, path, codec).await } pub async fn create_pred_index( &mut self, - request: impl tonic::IntoRequest< - super::super::super::db::query::CreatePredIndex, - >, + request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/CreatePredIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.db_service.DBService", "CreatePredIndex"), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "CreatePredIndex", + )); self.inner.unary(req, path, codec).await } pub async fn create_non_linear_algorithm_index( @@ -152,48 +140,32 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/CreateNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "services.db_service.DBService", - "CreateNonLinearAlgorithmIndex", - ), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "CreateNonLinearAlgorithmIndex", + )); self.inner.unary(req, path, codec).await } /// * Read methods * pub async fn get_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/GetKey", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetKey"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetKey")); @@ -202,22 +174,14 @@ pub mod db_service_client { pub async fn get_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/GetPred", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetPred"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetPred")); @@ -230,18 +194,12 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/GetSimN", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetSimN"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetSimN")); @@ -254,18 +212,12 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/GetStore", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/GetStore"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "GetStore")); @@ -275,22 +227,13 @@ pub mod db_service_client { pub async fn set( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/Set", - ); + let path = http::uri::PathAndQuery::from_static("/services.db_service.DBService/Set"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "Set")); @@ -299,30 +242,21 @@ pub mod db_service_client { /// * Delete methods * pub async fn drop_pred_index( &mut self, - request: impl tonic::IntoRequest< - super::super::super::db::query::DropPredIndex, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/DropPredIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("services.db_service.DBService", "DropPredIndex"), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "DropPredIndex", + )); self.inner.unary(req, path, codec).await } pub async fn drop_non_linear_algorithm_index( @@ -330,51 +264,33 @@ pub mod db_service_client { request: impl tonic::IntoRequest< super::super::super::db::query::DropNonLinearAlgorithmIndex, >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/services.db_service.DBService/DropNonLinearAlgorithmIndex", ); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "services.db_service.DBService", - "DropNonLinearAlgorithmIndex", - ), - ); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "DropNonLinearAlgorithmIndex", + )); self.inner.unary(req, path, codec).await } pub async fn del_key( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/DelKey", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/DelKey"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "DelKey")); @@ -383,22 +299,14 @@ pub mod db_service_client { pub async fn del_pred( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/DelPred", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/DelPred"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "DelPred")); @@ -407,49 +315,37 @@ pub mod db_service_client { pub async fn drop_store( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/DropStore", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/DropStore"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.db_service.DBService", "DropStore")); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "DropStore", + )); self.inner.unary(req, path, codec).await } pub async fn drop_schema( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/DropSchema", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/DropSchema"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.db_service.DBService", "DropSchema")); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "DropSchema", + )); self.inner.unary(req, path, codec).await } /// * Ancillary info methods * @@ -460,21 +356,17 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/ListClients", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/ListClients"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.db_service.DBService", "ListClients")); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "ListClients", + )); self.inner.unary(req, path, codec).await } pub async fn list_stores( @@ -484,21 +376,17 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/ListStores", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/ListStores"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.db_service.DBService", "ListStores")); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "ListStores", + )); self.inner.unary(req, path, codec).await } pub async fn info_server( @@ -508,21 +396,17 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/InfoServer", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/InfoServer"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("services.db_service.DBService", "InfoServer")); + req.extensions_mut().insert(GrpcMethod::new( + "services.db_service.DBService", + "InfoServer", + )); self.inner.unary(req, path, codec).await } pub async fn cluster_info( @@ -552,18 +436,11 @@ pub mod db_service_client { tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/Ping", - ); + let path = http::uri::PathAndQuery::from_static("/services.db_service.DBService/Ping"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "Ping")); @@ -572,25 +449,17 @@ pub mod db_service_client { /// * Pipeline method for all methods * pub async fn pipeline( &mut self, - request: impl tonic::IntoRequest< - super::super::super::db::pipeline::DbRequestPipeline, - >, + request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/services.db_service.DBService/Pipeline", - ); + let path = + http::uri::PathAndQuery::from_static("/services.db_service.DBService/Pipeline"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("services.db_service.DBService", "Pipeline")); @@ -605,7 +474,7 @@ pub mod db_service_server { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with DbServiceServer. @@ -628,9 +497,7 @@ pub mod db_service_server { >; async fn create_non_linear_algorithm_index( &self, - request: tonic::Request< - super::super::super::db::query::CreateNonLinearAlgorithmIndex, - >, + request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, @@ -639,17 +506,11 @@ pub mod db_service_server { async fn get_key( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn get_pred( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn get_sim_n( &self, request: tonic::Request, @@ -668,55 +529,32 @@ pub mod db_service_server { async fn set( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; /// * Delete methods * async fn drop_pred_index( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn drop_non_linear_algorithm_index( &self, - request: tonic::Request< - super::super::super::db::query::DropNonLinearAlgorithmIndex, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; async fn del_key( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn del_pred( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn drop_store( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn drop_schema( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; /// * Ancillary info methods * async fn list_clients( &self, @@ -783,10 +621,7 @@ pub mod db_service_server { max_encoding_message_size: None, } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -841,21 +676,15 @@ pub mod db_service_server { "/services.db_service.DBService/CreateStore" => { #[allow(non_camel_case_types)] struct CreateStoreSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::CreateStore, - > for CreateStoreSvc { + impl + tonic::server::UnaryService + for CreateStoreSvc + { type Response = super::super::super::db::server::Unit; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::CreateStore, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -889,16 +718,12 @@ pub mod db_service_server { "/services.db_service.DBService/CreatePredIndex" => { #[allow(non_camel_case_types)] struct CreatePredIndexSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::CreatePredIndex, - > for CreatePredIndexSvc { + impl + tonic::server::UnaryService + for CreatePredIndexSvc + { type Response = super::super::super::db::server::CreateIndex; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -937,16 +762,13 @@ pub mod db_service_server { "/services.db_service.DBService/CreateNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct CreateNonLinearAlgorithmIndexSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::CreateNonLinearAlgorithmIndex, - > for CreateNonLinearAlgorithmIndexSvc { + impl + tonic::server::UnaryService< + super::super::super::db::query::CreateNonLinearAlgorithmIndex, + > for CreateNonLinearAlgorithmIndexSvc + { type Response = super::super::super::db::server::CreateIndex; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -955,10 +777,7 @@ pub mod db_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_non_linear_algorithm_index( - &inner, - request, - ) + ::create_non_linear_algorithm_index(&inner, request) .await }; Box::pin(fut) @@ -989,25 +808,19 @@ pub mod db_service_server { "/services.db_service.DBService/GetKey" => { #[allow(non_camel_case_types)] struct GetKeySvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService - for GetKeySvc { + impl + tonic::server::UnaryService + for GetKeySvc + { type Response = super::super::super::db::server::Get; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::GetKey, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_key(&inner, request).await - }; + let fut = + async move { ::get_key(&inner, request).await }; Box::pin(fut) } } @@ -1036,26 +849,19 @@ pub mod db_service_server { "/services.db_service.DBService/GetPred" => { #[allow(non_camel_case_types)] struct GetPredSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::GetPred, - > for GetPredSvc { + impl + tonic::server::UnaryService + for GetPredSvc + { type Response = super::super::super::db::server::Get; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::GetPred, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_pred(&inner, request).await - }; + let fut = + async move { ::get_pred(&inner, request).await }; Box::pin(fut) } } @@ -1084,26 +890,19 @@ pub mod db_service_server { "/services.db_service.DBService/GetSimN" => { #[allow(non_camel_case_types)] struct GetSimNSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::GetSimN, - > for GetSimNSvc { + impl + tonic::server::UnaryService + for GetSimNSvc + { type Response = super::super::super::db::server::GetSimN; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::GetSimN, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_sim_n(&inner, request).await - }; + let fut = + async move { ::get_sim_n(&inner, request).await }; Box::pin(fut) } } @@ -1132,26 +931,19 @@ pub mod db_service_server { "/services.db_service.DBService/GetStore" => { #[allow(non_camel_case_types)] struct GetStoreSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::GetStore, - > for GetStoreSvc { + impl + tonic::server::UnaryService + for GetStoreSvc + { type Response = super::super::super::db::server::StoreInfo; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::GetStore, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_store(&inner, request).await - }; + let fut = + async move { ::get_store(&inner, request).await }; Box::pin(fut) } } @@ -1180,23 +972,18 @@ pub mod db_service_server { "/services.db_service.DBService/Set" => { #[allow(non_camel_case_types)] struct SetSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService - for SetSvc { + impl + tonic::server::UnaryService + for SetSvc + { type Response = super::super::super::db::server::Set; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::set(&inner, request).await - }; + let fut = async move { ::set(&inner, request).await }; Box::pin(fut) } } @@ -1225,21 +1012,15 @@ pub mod db_service_server { "/services.db_service.DBService/DropPredIndex" => { #[allow(non_camel_case_types)] struct DropPredIndexSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::DropPredIndex, - > for DropPredIndexSvc { + impl + tonic::server::UnaryService + for DropPredIndexSvc + { type Response = super::super::super::db::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::DropPredIndex, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1273,16 +1054,13 @@ pub mod db_service_server { "/services.db_service.DBService/DropNonLinearAlgorithmIndex" => { #[allow(non_camel_case_types)] struct DropNonLinearAlgorithmIndexSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::DropNonLinearAlgorithmIndex, - > for DropNonLinearAlgorithmIndexSvc { + impl + tonic::server::UnaryService< + super::super::super::db::query::DropNonLinearAlgorithmIndex, + > for DropNonLinearAlgorithmIndexSvc + { type Response = super::super::super::db::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -1291,10 +1069,7 @@ pub mod db_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::drop_non_linear_algorithm_index( - &inner, - request, - ) + ::drop_non_linear_algorithm_index(&inner, request) .await }; Box::pin(fut) @@ -1325,25 +1100,19 @@ pub mod db_service_server { "/services.db_service.DBService/DelKey" => { #[allow(non_camel_case_types)] struct DelKeySvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService - for DelKeySvc { + impl + tonic::server::UnaryService + for DelKeySvc + { type Response = super::super::super::db::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::DelKey, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::del_key(&inner, request).await - }; + let fut = + async move { ::del_key(&inner, request).await }; Box::pin(fut) } } @@ -1372,26 +1141,19 @@ pub mod db_service_server { "/services.db_service.DBService/DelPred" => { #[allow(non_camel_case_types)] struct DelPredSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::DelPred, - > for DelPredSvc { + impl + tonic::server::UnaryService + for DelPredSvc + { type Response = super::super::super::db::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::DelPred, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::del_pred(&inner, request).await - }; + let fut = + async move { ::del_pred(&inner, request).await }; Box::pin(fut) } } @@ -1420,26 +1182,19 @@ pub mod db_service_server { "/services.db_service.DBService/DropStore" => { #[allow(non_camel_case_types)] struct DropStoreSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::DropStore, - > for DropStoreSvc { + impl + tonic::server::UnaryService + for DropStoreSvc + { type Response = super::super::super::db::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::DropStore, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::drop_store(&inner, request).await - }; + let fut = + async move { ::drop_store(&inner, request).await }; Box::pin(fut) } } @@ -1468,26 +1223,19 @@ pub mod db_service_server { "/services.db_service.DBService/DropSchema" => { #[allow(non_camel_case_types)] struct DropSchemaSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::DropSchema, - > for DropSchemaSvc { + impl + tonic::server::UnaryService + for DropSchemaSvc + { type Response = super::super::super::db::server::Del; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::DropSchema, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::drop_schema(&inner, request).await - }; + let fut = + async move { ::drop_schema(&inner, request).await }; Box::pin(fut) } } @@ -1516,21 +1264,15 @@ pub mod db_service_server { "/services.db_service.DBService/ListClients" => { #[allow(non_camel_case_types)] struct ListClientsSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::ListClients, - > for ListClientsSvc { + impl + tonic::server::UnaryService + for ListClientsSvc + { type Response = super::super::super::db::server::ClientList; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::ListClients, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { @@ -1564,26 +1306,19 @@ pub mod db_service_server { "/services.db_service.DBService/ListStores" => { #[allow(non_camel_case_types)] struct ListStoresSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::ListStores, - > for ListStoresSvc { + impl + tonic::server::UnaryService + for ListStoresSvc + { type Response = super::super::super::db::server::StoreList; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::ListStores, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::list_stores(&inner, request).await - }; + let fut = + async move { ::list_stores(&inner, request).await }; Box::pin(fut) } } @@ -1612,26 +1347,19 @@ pub mod db_service_server { "/services.db_service.DBService/InfoServer" => { #[allow(non_camel_case_types)] struct InfoServerSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::query::InfoServer, - > for InfoServerSvc { + impl + tonic::server::UnaryService + for InfoServerSvc + { type Response = super::super::super::db::server::InfoServer; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request< - super::super::super::db::query::InfoServer, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::info_server(&inner, request).await - }; + let fut = + async move { ::info_server(&inner, request).await }; Box::pin(fut) } } @@ -1705,23 +1433,18 @@ pub mod db_service_server { "/services.db_service.DBService/Ping" => { #[allow(non_camel_case_types)] struct PingSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService - for PingSvc { + impl + tonic::server::UnaryService + for PingSvc + { type Response = super::super::super::db::server::Pong; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::ping(&inner, request).await - }; + let fut = async move { ::ping(&inner, request).await }; Box::pin(fut) } } @@ -1750,16 +1473,13 @@ pub mod db_service_server { "/services.db_service.DBService/Pipeline" => { #[allow(non_camel_case_types)] struct PipelineSvc(pub Arc); - impl< - T: DbService, - > tonic::server::UnaryService< - super::super::super::db::pipeline::DbRequestPipeline, - > for PipelineSvc { + impl + tonic::server::UnaryService< + super::super::super::db::pipeline::DbRequestPipeline, + > for PipelineSvc + { type Response = super::super::super::db::pipeline::DbResponsePipeline; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request< @@ -1767,9 +1487,8 @@ pub mod db_service_server { >, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::pipeline(&inner, request).await - }; + let fut = + async move { ::pipeline(&inner, request).await }; Box::pin(fut) } } @@ -1795,23 +1514,19 @@ pub mod db_service_server { }; Box::pin(fut) } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } + _ => Box::pin(async move { + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers.insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers.insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) + }), } } } From 62bd9fdc71c93efea293a569252374dd86d8a030 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 12:04:06 +0100 Subject: [PATCH 16/28] fix: add missing schema field in image-search example --- examples/rust/image-search/Cargo.lock | 14 ++------------ examples/rust/image-search/src/main.rs | 5 +++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/examples/rust/image-search/Cargo.lock b/examples/rust/image-search/Cargo.lock index bd890ef3c..45953fa4e 100644 --- a/examples/rust/image-search/Cargo.lock +++ b/examples/rust/image-search/Cargo.lock @@ -31,11 +31,10 @@ dependencies = [ [[package]] name = "ahnlich_client_rs" -version = "0.1.0" +version = "0.3.0" dependencies = [ "ahnlich_types", "async-trait", - "bincode", "fallible_collections", "http", "once_cell", @@ -46,7 +45,7 @@ dependencies = [ [[package]] name = "ahnlich_types" -version = "0.1.0" +version = "0.3.0" dependencies = [ "ascii85", "prost", @@ -302,15 +301,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bit_field" version = "0.10.2" diff --git a/examples/rust/image-search/src/main.rs b/examples/rust/image-search/src/main.rs index 3dc38e4c7..cdb71c649 100644 --- a/examples/rust/image-search/src/main.rs +++ b/examples/rust/image-search/src/main.rs @@ -8,10 +8,10 @@ use ahnlich_client_rs::ai::AiClient; use ahnlich_types::{ ai::query::{CreateStore, GetSimN, Set}, algorithm::algorithms::Algorithm, - keyval::{store_input::Value, AiStoreEntry, StoreInput, StoreValue}, + keyval::{AiStoreEntry, StoreInput, StoreValue, store_input::Value}, }; -use ahnlich_types::metadata::{metadata_value::Value as MValue, MetadataValue}; +use ahnlich_types::metadata::{MetadataValue, metadata_value::Value as MValue}; use clap::{Parser, Subcommand}; use tokio; @@ -68,6 +68,7 @@ async fn index_mode() { non_linear_indices: vec![], error_if_exists: false, store_original: true, + schema: None, }; client From 471be430cac9aeb0fdfde1ee468f9229048a864c Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 12:10:47 +0100 Subject: [PATCH 17/28] fix: conditionally include gtag only when G_TRACKING_ID is set --- web/ahnlich-web/docusaurus.config.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/ahnlich-web/docusaurus.config.ts b/web/ahnlich-web/docusaurus.config.ts index d1a765ed7..d87fc112a 100644 --- a/web/ahnlich-web/docusaurus.config.ts +++ b/web/ahnlich-web/docusaurus.config.ts @@ -95,10 +95,14 @@ const config: Config = { theme: { customCss: './src/css/custom.css', }, - gtag: { - trackingID: process.env.G_TRACKING_ID, - anonymizeIP: true, - }, + ...(process.env.G_TRACKING_ID + ? { + gtag: { + trackingID: process.env.G_TRACKING_ID, + anonymizeIP: true, + }, + } + : {}), } satisfies Preset.Options, ], ], From 449d4baf6162e42e480bb1ea9b3ae1b54de6f2f1 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 18:01:20 +0100 Subject: [PATCH 18/28] feat: add V2 snapshot fixtures and DB migration tests --- .../ai/src/tests/fixtures/ai_v2_snapshot.json | 13 +++ ahnlich/ai/src/tests/migration_test.rs | 29 ++++++ .../db/src/tests/fixtures/db_v2_snapshot.json | 21 +++++ ahnlich/db/src/tests/migration_test.rs | 90 +++++++++++++++++++ ahnlich/db/src/tests/mod.rs | 1 + 5 files changed, 154 insertions(+) create mode 100644 ahnlich/ai/src/tests/fixtures/ai_v2_snapshot.json create mode 100644 ahnlich/db/src/tests/fixtures/db_v2_snapshot.json create mode 100644 ahnlich/db/src/tests/migration_test.rs diff --git a/ahnlich/ai/src/tests/fixtures/ai_v2_snapshot.json b/ahnlich/ai/src/tests/fixtures/ai_v2_snapshot.json new file mode 100644 index 000000000..338e06688 --- /dev/null +++ b/ahnlich/ai/src/tests/fixtures/ai_v2_snapshot.json @@ -0,0 +1,13 @@ +{ + "db_version": "2", + "stores": { + "public": { + "test_ai_store": { + "name": "test_ai_store", + "index_model": "AllMiniLmL6V2", + "query_model": "AllMiniLmL6V2", + "store_original": false + } + } + } +} diff --git a/ahnlich/ai/src/tests/migration_test.rs b/ahnlich/ai/src/tests/migration_test.rs index 0675a4d8d..7fc3c6f77 100644 --- a/ahnlich/ai/src/tests/migration_test.rs +++ b/ahnlich/ai/src/tests/migration_test.rs @@ -90,3 +90,32 @@ fn test_ai_migrate_from_committed_fixture() { "Store name preserved after migration" ); } + +#[test] +fn test_ai_load_v2_snapshot() { + let fixture_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures") + .join("ai_v2_snapshot.json"); + + assert!( + fixture_path.exists(), + "V2 fixture not found: {:?}", + fixture_path + ); + + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + let loaded: AIStores = AIStoreHandler::load_snapshot(&read_bytes).expect("V2 load failed"); + let guard = loaded.guard(); + let inner = loaded + .get(&Schema::default(), &guard) + .expect("No public schema after V2 load"); + assert_eq!(inner.len(), 1, "Expected 1 AI store under public schema"); + let pinned = inner.pin(); + let (key, _) = pinned.iter().next().expect("No store in result"); + assert_eq!( + key.value, "test_ai_store", + "Store name preserved in V2" + ); +} diff --git a/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json b/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json new file mode 100644 index 000000000..14986a293 --- /dev/null +++ b/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json @@ -0,0 +1,21 @@ +{ + "db_version": "2", + "stores": { + "public": { + "fixture_store": { + "dimension": 3, + "id_to_value": {}, + "predicate_indices": { + "inner": {}, + "allowed_predicates": [] + }, + "non_linear_indices": { + "algorithm_to_index": {} + }, + "cached_len": 0, + "cached_size_bytes": 0, + "size_dirty": true + } + } + } +} diff --git a/ahnlich/db/src/tests/migration_test.rs b/ahnlich/db/src/tests/migration_test.rs new file mode 100644 index 000000000..fc5c36bb6 --- /dev/null +++ b/ahnlich/db/src/tests/migration_test.rs @@ -0,0 +1,90 @@ +use crate::engine::store::Stores; +use crate::engine::store::StoreHandler; +use ahnlich_types::schema::Schema; +use serde_json::json; + +#[test] +fn test_db_migrate_old_flat_snapshot_via_json() { + let old_format = json!({ + "fixture_store": { + "dimension": 3, + "id_to_value": {}, + "predicate_indices": { + "inner": {}, + "allowed_predicates": [] + }, + "non_linear_indices": { + "algorithm_to_index": {} + }, + "cached_len": 0, + "cached_size_bytes": 0, + "size_dirty": true + } + }); + + let json_bytes = serde_json::to_vec(&old_format).expect("Failed to serialize old format"); + let migrated: Stores = StoreHandler::load_snapshot(&json_bytes).expect("Migration failed"); + let guard = migrated.guard(); + let inner = migrated + .get(&Schema::default(), &guard) + .expect("No public schema after migration"); + assert_eq!(inner.len(), 1, "Expected 1 DB store under public schema"); +} + +#[test] +fn test_db_migrate_from_committed_fixture() { + let fixture_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures") + .join("db_old_flat_snapshot.json"); + + assert!( + fixture_path.exists(), + "Committed fixture not found: {:?}", + fixture_path + ); + + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + let migrated: Stores = StoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); + let guard = migrated.guard(); + let inner = migrated + .get(&Schema::default(), &guard) + .expect("No public schema after migration"); + assert_eq!(inner.len(), 1, "Expected 1 DB store under public schema"); + let pinned = inner.pin(); + let (key, _) = pinned.iter().next().expect("No store in result"); + assert_eq!( + key.value, "fixture_store", + "Store name preserved after migration" + ); +} + +#[test] +fn test_db_load_v2_snapshot() { + let fixture_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures") + .join("db_v2_snapshot.json"); + + assert!( + fixture_path.exists(), + "V2 fixture not found: {:?}", + fixture_path + ); + + let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); + let loaded: Stores = StoreHandler::load_snapshot(&read_bytes).expect("V2 load failed"); + let guard = loaded.guard(); + let inner = loaded + .get(&Schema::default(), &guard) + .expect("No public schema after V2 load"); + assert_eq!(inner.len(), 1, "Expected 1 DB store under public schema"); + let pinned = inner.pin(); + let (key, _) = pinned.iter().next().expect("No store in result"); + assert_eq!( + key.value, "fixture_store", + "Store name preserved in V2" + ); +} diff --git a/ahnlich/db/src/tests/mod.rs b/ahnlich/db/src/tests/mod.rs index 56de61430..6671589b0 100644 --- a/ahnlich/db/src/tests/mod.rs +++ b/ahnlich/db/src/tests/mod.rs @@ -1,5 +1,6 @@ mod auth_tests; mod cluster_tests; +mod migration_test; mod replication_store_tests; mod server_tests; From ac665295755f1f05792bdbc1f7d29c8fbe3c73c3 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 18:11:35 +0100 Subject: [PATCH 19/28] fix: apply cargo fmt to migration test files --- ahnlich/ai/src/tests/migration_test.rs | 5 +---- ahnlich/db/src/tests/migration_test.rs | 10 ++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ahnlich/ai/src/tests/migration_test.rs b/ahnlich/ai/src/tests/migration_test.rs index 7fc3c6f77..9ab55756c 100644 --- a/ahnlich/ai/src/tests/migration_test.rs +++ b/ahnlich/ai/src/tests/migration_test.rs @@ -114,8 +114,5 @@ fn test_ai_load_v2_snapshot() { assert_eq!(inner.len(), 1, "Expected 1 AI store under public schema"); let pinned = inner.pin(); let (key, _) = pinned.iter().next().expect("No store in result"); - assert_eq!( - key.value, "test_ai_store", - "Store name preserved in V2" - ); + assert_eq!(key.value, "test_ai_store", "Store name preserved in V2"); } diff --git a/ahnlich/db/src/tests/migration_test.rs b/ahnlich/db/src/tests/migration_test.rs index fc5c36bb6..f7d5287f5 100644 --- a/ahnlich/db/src/tests/migration_test.rs +++ b/ahnlich/db/src/tests/migration_test.rs @@ -1,5 +1,5 @@ -use crate::engine::store::Stores; use crate::engine::store::StoreHandler; +use crate::engine::store::Stores; use ahnlich_types::schema::Schema; use serde_json::json; @@ -46,7 +46,8 @@ fn test_db_migrate_from_committed_fixture() { ); let read_bytes = std::fs::read(&fixture_path).expect("Failed to read fixture"); - let migrated: Stores = StoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); + let migrated: Stores = + StoreHandler::load_snapshot(&read_bytes).expect("Migration of fixture failed"); let guard = migrated.guard(); let inner = migrated .get(&Schema::default(), &guard) @@ -83,8 +84,5 @@ fn test_db_load_v2_snapshot() { assert_eq!(inner.len(), 1, "Expected 1 DB store under public schema"); let pinned = inner.pin(); let (key, _) = pinned.iter().next().expect("No store in result"); - assert_eq!( - key.value, "fixture_store", - "Store name preserved in V2" - ); + assert_eq!(key.value, "fixture_store", "Store name preserved in V2"); } From 8e0bc95e59da3b57e43e4dc3818c2bfb43fa2c34 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Tue, 16 Jun 2026 19:06:52 +0100 Subject: [PATCH 20/28] fix: add fallback for unversioned schema-nested persistence format (V1n) --- ahnlich/ai/src/engine/versioned.rs | 29 +++++++++++++++++++++++++++++ ahnlich/db/src/engine/versioned.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/ahnlich/ai/src/engine/versioned.rs b/ahnlich/ai/src/engine/versioned.rs index 6fdeb6163..c47c467af 100644 --- a/ahnlich/ai/src/engine/versioned.rs +++ b/ahnlich/ai/src/engine/versioned.rs @@ -13,6 +13,7 @@ pub const AI_CURRENT_VERSION: u32 = 2; pub const AI_MIN_VERSION: u32 = 1; type AiStoresV1 = HashMap; +type AiStoresV1Nested = HashMap; #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "db_version")] @@ -34,6 +35,12 @@ impl VersionedPersistence for VersionedAiStores { match serde_json::from_slice::(bytes) { Ok(versioned) => Ok(versioned), Err(_) => { + if let Ok(nested) = serde_json::from_slice::(bytes) { + log::warn!("No db_version tag, detected schema-nested (V1n) format"); + let stores = Self::migrate_v1n_to_v2(nested) + .map_err(PersistenceTaskError::MigrationError)?; + return Ok(VersionedAiStores::V2 { stores }); + } log::warn!("No db_version tag, attempting bare V1 load"); let v1_stores: AiStoresV1 = serde_json::from_slice(bytes)?; Ok(VersionedAiStores::V1 { stores: v1_stores }) @@ -42,6 +49,28 @@ impl VersionedPersistence for VersionedAiStores { } } +impl VersionedAiStores { + fn migrate_v1n_to_v2(v1_nested: AiStoresV1Nested) -> Result { + let stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; + for (schema_name, inner) in v1_nested { + let inner_stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; + { + let guard = inner_stores.pin(); + for (name, store) in inner { + guard.insert(name, Arc::new(store)); + } + } + { + let guard = stores.pin(); + guard.insert(schema_name, inner_stores); + } + } + Ok(stores) + } +} + impl VersionedAiStores { pub fn into_latest(self) -> Result { match self { diff --git a/ahnlich/db/src/engine/versioned.rs b/ahnlich/db/src/engine/versioned.rs index bd7f2c126..c02e7cdbf 100644 --- a/ahnlich/db/src/engine/versioned.rs +++ b/ahnlich/db/src/engine/versioned.rs @@ -13,6 +13,7 @@ pub const DB_CURRENT_VERSION: u32 = 2; pub const DB_MIN_VERSION: u32 = 1; type DbStoresV1 = HashMap; +type DbStoresV1Nested = HashMap; #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "db_version")] @@ -34,6 +35,12 @@ impl VersionedPersistence for VersionedDbStores { match serde_json::from_slice::(bytes) { Ok(versioned) => Ok(versioned), Err(_) => { + if let Ok(nested) = serde_json::from_slice::(bytes) { + log::warn!("No db_version tag, detected schema-nested (V1n) format"); + let stores = Self::migrate_v1n_to_v2(nested) + .map_err(PersistenceTaskError::MigrationError)?; + return Ok(VersionedDbStores::V2 { stores }); + } log::warn!("No db_version tag, attempting bare V1 load"); let v1_stores: DbStoresV1 = serde_json::from_slice(bytes)?; Ok(VersionedDbStores::V1 { stores: v1_stores }) @@ -42,6 +49,28 @@ impl VersionedPersistence for VersionedDbStores { } } +impl VersionedDbStores { + fn migrate_v1n_to_v2(v1_nested: DbStoresV1Nested) -> Result { + let stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; + for (schema_name, inner) in v1_nested { + let inner_stores = + fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; + { + let guard = inner_stores.pin(); + for (name, store) in inner { + guard.insert(name, Arc::new(store)); + } + } + { + let guard = stores.pin(); + guard.insert(schema_name, inner_stores); + } + } + Ok(stores) + } +} + impl VersionedDbStores { pub fn into_latest(self) -> Result { match self { From c9c00a9f95cdaac59a1b19ea578b4ff2cc95cd62 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Wed, 17 Jun 2026 16:06:59 +0100 Subject: [PATCH 21/28] fix: scope purge_stores to public schema only --- ahnlich/ai/src/engine/operations.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index f9e3f9aa0..ed3126ab9 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -398,8 +398,9 @@ pub async fn purge_stores( _params: PurgeStores, parent_id: Option, ) -> Result { + let schema = Schema::default(); let store_names: Vec = store_handler - .list_stores(None) + .list_stores(Some(&schema)) .into_iter() .map(|store| StoreName { value: store.name }) .collect(); @@ -411,7 +412,7 @@ pub async fn purge_stores( DbDropStore { store: store_name.value.clone(), error_if_not_exists: false, - schema: None, + schema: Some(schema.to_string()), }, parent_id.clone(), ) From 1d0f647af6409fbcc6496e3c0d7f39db55c34c01 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Wed, 17 Jun 2026 16:12:14 +0100 Subject: [PATCH 22/28] rename: AiStoresV1Nested to AiStoresV2 and DbStoresV1Nested to DbStoresV2 --- ahnlich/ai/src/engine/versioned.rs | 6 +++--- ahnlich/db/src/engine/versioned.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ahnlich/ai/src/engine/versioned.rs b/ahnlich/ai/src/engine/versioned.rs index c47c467af..6924116d8 100644 --- a/ahnlich/ai/src/engine/versioned.rs +++ b/ahnlich/ai/src/engine/versioned.rs @@ -13,7 +13,7 @@ pub const AI_CURRENT_VERSION: u32 = 2; pub const AI_MIN_VERSION: u32 = 1; type AiStoresV1 = HashMap; -type AiStoresV1Nested = HashMap; +type AiStoresV2 = HashMap; #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "db_version")] @@ -35,7 +35,7 @@ impl VersionedPersistence for VersionedAiStores { match serde_json::from_slice::(bytes) { Ok(versioned) => Ok(versioned), Err(_) => { - if let Ok(nested) = serde_json::from_slice::(bytes) { + if let Ok(nested) = serde_json::from_slice::(bytes) { log::warn!("No db_version tag, detected schema-nested (V1n) format"); let stores = Self::migrate_v1n_to_v2(nested) .map_err(PersistenceTaskError::MigrationError)?; @@ -50,7 +50,7 @@ impl VersionedPersistence for VersionedAiStores { } impl VersionedAiStores { - fn migrate_v1n_to_v2(v1_nested: AiStoresV1Nested) -> Result { + fn migrate_v1n_to_v2(v1_nested: AiStoresV2) -> Result { let stores = fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; for (schema_name, inner) in v1_nested { diff --git a/ahnlich/db/src/engine/versioned.rs b/ahnlich/db/src/engine/versioned.rs index c02e7cdbf..ba677d0f5 100644 --- a/ahnlich/db/src/engine/versioned.rs +++ b/ahnlich/db/src/engine/versioned.rs @@ -13,7 +13,7 @@ pub const DB_CURRENT_VERSION: u32 = 2; pub const DB_MIN_VERSION: u32 = 1; type DbStoresV1 = HashMap; -type DbStoresV1Nested = HashMap; +type DbStoresV2 = HashMap; #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "db_version")] @@ -35,7 +35,7 @@ impl VersionedPersistence for VersionedDbStores { match serde_json::from_slice::(bytes) { Ok(versioned) => Ok(versioned), Err(_) => { - if let Ok(nested) = serde_json::from_slice::(bytes) { + if let Ok(nested) = serde_json::from_slice::(bytes) { log::warn!("No db_version tag, detected schema-nested (V1n) format"); let stores = Self::migrate_v1n_to_v2(nested) .map_err(PersistenceTaskError::MigrationError)?; @@ -50,7 +50,7 @@ impl VersionedPersistence for VersionedDbStores { } impl VersionedDbStores { - fn migrate_v1n_to_v2(v1_nested: DbStoresV1Nested) -> Result { + fn migrate_v1n_to_v2(v1_nested: DbStoresV2) -> Result { let stores = fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; for (schema_name, inner) in v1_nested { From 0e892d5dfb247fe5db5f147553960ef50e4e6436 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Wed, 17 Jun 2026 16:59:38 +0100 Subject: [PATCH 23/28] fix: scope get to default schema only, add schema param to get_store --- ahnlich/db/src/engine/store.rs | 38 ++++-- ahnlich/db/src/server/handler.rs | 16 ++- .../db/src/tests/fixtures/db_v2_snapshot.json | 83 ++++++++++++- ahnlich/db/src/tests/migration_test.rs | 109 +++++++++++++++++- ahnlich/db/src/tests/server_tests.rs | 12 +- 5 files changed, 234 insertions(+), 24 deletions(-) diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index 753b06029..cec2e9fdb 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -38,10 +38,24 @@ type StoreEntryWithSimilarity = (EmbeddingKey, Arc, Similarity); /// potentially larger /// We should be only able to generate a store key id from a 1D vector except during tests -#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -#[serde(transparent)] +#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash)] pub(crate) struct StoreKeyId(u64); +impl Serialize for StoreKeyId { + fn serialize(&self, serializer: S) -> Result { + serializer.collect_str(&self.0) + } +} + +impl<'de> Deserialize<'de> for StoreKeyId { + fn deserialize>(deserializer: D) -> Result { + use serde::de; + let s = String::deserialize(deserializer)?; + let val = s.parse::().map_err(de::Error::custom)?; + Ok(StoreKeyId(val)) + } +} + #[cfg(test)] impl From for StoreKeyId { fn from(value: u64) -> Self { @@ -232,12 +246,6 @@ impl StoreHandler { return Ok(store.clone()); } } - for (_, inner_stores) in self.stores.iter(&guard) { - let inner_guard = inner_stores.guard(); - if let Some(store) = inner_stores.get(store_name, &inner_guard) { - return Ok(store.clone()); - } - } Err(ServerError::StoreNotFound(store_name.clone())) } @@ -465,8 +473,18 @@ impl StoreHandler { /// Matches GETSTORE - Returns detailed info for a single store by name #[tracing::instrument(skip(self))] - pub(crate) fn get_store(&self, store_name: &StoreName) -> Result { - let store = self.get(store_name)?; + pub(crate) fn get_store( + &self, + store_name: &StoreName, + schema: &Schema, + ) -> Result { + let inner_stores = self + .get_schema(schema) + .ok_or_else(|| ServerError::StoreNotFound(store_name.clone()))?; + let guard = inner_stores.guard(); + let store = inner_stores + .get(store_name, &guard) + .ok_or_else(|| ServerError::StoreNotFound(store_name.clone()))?; let (len, size_in_bytes) = if store.size_dirty.load(Ordering::Relaxed) { let len = store.len(); let size = store.size(); diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 580c2460b..02c5b57d7 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -14,6 +14,7 @@ use ahnlich_replication::types::DbCommand; use ahnlich_types::db::pipeline::db_query::Query; use ahnlich_types::db::server::GetSimNEntry; use ahnlich_types::keyval::{DbStoreEntry, StoreKey, StoreName}; +use ahnlich_types::schema::Schema; use ahnlich_types::services::db_service::db_service_server::{DbService, DbServiceServer}; use ahnlich_types::shared::cluster::{ClusterInfoQuery, ClusterInfoResponse}; use ahnlich_types::shared::info::ErrorResponse; @@ -407,10 +408,19 @@ impl DbService for Server { request: tonic::Request, ) -> std::result::Result, tonic::Status> { let params = request.into_inner(); + let schema = params + .schema + .map(Schema::try_new) + .transpose() + .map_err(tonic::Status::invalid_argument)? + .unwrap_or_default(); let store_info = read_store_handler(&self.runtime, |store_handler| { - store_handler.get_store(&StoreName { - value: params.store, - }) + store_handler.get_store( + &StoreName { + value: params.store, + }, + &schema, + ) })?; Ok(tonic::Response::new(store_info)) } diff --git a/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json b/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json index 14986a293..b398d830c 100644 --- a/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json +++ b/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json @@ -4,13 +4,86 @@ "public": { "fixture_store": { "dimension": 3, - "id_to_value": {}, + "id_to_value": { + "15178017180037765037": [ + [ + 0.2, + 0.7, + 0.3 + ], + { + "value": { + "color": "str:green", + "name": "str:item2", + "category": "str:vegetable" + } + } + ], + "11596182387809500963": [ + [ + 0.5, + 0.1, + 0.8 + ], + { + "value": { + "name": "str:item1", + "category": "str:fruit", + "color": "str:red" + } + } + ] + }, "predicate_indices": { - "inner": {}, - "allowed_predicates": [] + "inner": { + "color": { + "str:red": [ + "11596182387809500963" + ], + "str:green": [ + "15178017180037765037" + ] + }, + "category": { + "str:vegetable": [ + "15178017180037765037" + ], + "str:fruit": [ + "11596182387809500963" + ] + } + }, + "allowed_predicates": [ + "color", + "category" + ] }, "non_linear_indices": { - "algorithm_to_index": {} + "algorithm_to_index": { + "KdTree": { + "KDTree": { + "root": { + "point": [ + 0.5, + 0.1, + 0.8 + ], + "left": { + "point": [ + 0.2, + 0.7, + 0.3 + ], + "left": null, + "right": null + }, + "right": null + }, + "dimension": 3, + "depth": 3 + } + } + } }, "cached_len": 0, "cached_size_bytes": 0, @@ -18,4 +91,4 @@ } } } -} +} \ No newline at end of file diff --git a/ahnlich/db/src/tests/migration_test.rs b/ahnlich/db/src/tests/migration_test.rs index f7d5287f5..c3c7bcabe 100644 --- a/ahnlich/db/src/tests/migration_test.rs +++ b/ahnlich/db/src/tests/migration_test.rs @@ -61,6 +61,113 @@ fn test_db_migrate_from_committed_fixture() { ); } +#[test] +#[ignore] +fn generate_db_v2_fixture() { + use crate::engine::store::StoreHandler; + use ahnlich_types::algorithm::nonlinear::KdTreeConfig; + use ahnlich_types::algorithm::nonlinear::non_linear_index; + use ahnlich_types::keyval::{StoreKey, StoreName, StoreValue}; + use ahnlich_types::metadata::{MetadataValue, metadata_value}; + use ahnlich_types::schema::Schema; + use std::collections::{HashMap, HashSet}; + use std::num::NonZeroUsize; + use std::sync::Arc; + use std::sync::atomic::AtomicBool; + use utils::persistence::AhnlichPersistenceUtils; + + let handler = StoreHandler::new(Arc::new(AtomicBool::new(false))); + let predicates = vec!["category".to_string(), "color".to_string()]; + let mut non_linear_indices: HashSet = HashSet::new(); + non_linear_indices.insert(non_linear_index::Index::Kdtree(KdTreeConfig {})); + handler + .create_store( + StoreName { + value: "fixture_store".to_string(), + }, + &Schema::default(), + NonZeroUsize::new(3).unwrap(), + predicates, + non_linear_indices, + false, + ) + .unwrap(); + + // Insert entry 1 + let key1 = StoreKey { + key: vec![0.5f32, 0.1, 0.8], + }; + let mut meta1 = HashMap::new(); + meta1.insert( + "name".to_string(), + MetadataValue { + value: Some(metadata_value::Value::RawString("item1".to_string())), + }, + ); + meta1.insert( + "category".to_string(), + MetadataValue { + value: Some(metadata_value::Value::RawString("fruit".to_string())), + }, + ); + meta1.insert( + "color".to_string(), + MetadataValue { + value: Some(metadata_value::Value::RawString("red".to_string())), + }, + ); + handler + .set_in_store( + &StoreName { + value: "fixture_store".to_string(), + }, + vec![(key1, StoreValue { value: meta1 })], + ) + .unwrap(); + + // Insert entry 2 + let key2 = StoreKey { + key: vec![0.2f32, 0.7, 0.3], + }; + let mut meta2 = HashMap::new(); + meta2.insert( + "name".to_string(), + MetadataValue { + value: Some(metadata_value::Value::RawString("item2".to_string())), + }, + ); + meta2.insert( + "category".to_string(), + MetadataValue { + value: Some(metadata_value::Value::RawString("vegetable".to_string())), + }, + ); + meta2.insert( + "color".to_string(), + MetadataValue { + value: Some(metadata_value::Value::RawString("green".to_string())), + }, + ); + handler + .set_in_store( + &StoreName { + value: "fixture_store".to_string(), + }, + vec![(key2, StoreValue { value: meta2 })], + ) + .unwrap(); + + let snapshot = handler.get_snapshot(); + let json = serde_json::to_string_pretty(&snapshot).expect("Serialization failed"); + let fixture_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("tests") + .join("fixtures") + .join("db_v2_snapshot.json"); + std::fs::write(&fixture_path, &json).expect("Failed to write fixture"); + eprintln!("Generated fixture at: {:?}", fixture_path); +} + #[test] fn test_db_load_v2_snapshot() { let fixture_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) @@ -83,6 +190,6 @@ fn test_db_load_v2_snapshot() { .expect("No public schema after V2 load"); assert_eq!(inner.len(), 1, "Expected 1 DB store under public schema"); let pinned = inner.pin(); - let (key, _) = pinned.iter().next().expect("No store in result"); + let (key, _store) = pinned.iter().next().expect("No store in result"); assert_eq!(key.value, "fixture_store", "Store name preserved in V2"); } diff --git a/ahnlich/db/src/tests/server_tests.rs b/ahnlich/db/src/tests/server_tests.rs index 6196407bb..d4647828b 100644 --- a/ahnlich/db/src/tests/server_tests.rs +++ b/ahnlich/db/src/tests/server_tests.rs @@ -4702,15 +4702,17 @@ async fn test_schema_get_store_in_schema() { assert_eq!(store_info.dimension, 4); assert_eq!(store_info.predicate_indices, vec!["tag".to_string()]); - // GetStore without schema should also find it via fallback - let store_info = client + // GetStore without schema should NOT find it (defaults to public schema only) + let result = client .get_store(tonic::Request::new(db_query_types::GetStore { store: "SchemaGetStore".to_string(), schema: None, })) - .await - .expect("GetStore without schema failed") - .into_inner(); + .await; + assert!( + result.is_err(), + "GetStore without schema should fail for stores in non-public schema" + ); assert_eq!(store_info.name, "SchemaGetStore"); assert_eq!(store_info.dimension, 4); From b8843bc33bba755cc30a5a504a3832687304c3ad Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Wed, 17 Jun 2026 18:27:49 +0100 Subject: [PATCH 24/28] fix: use string-based serde for NodeId and LayerIndex for JSON map key compatibility --- ahnlich/similarity/src/hnsw/mod.rs | 83 +++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 2 deletions(-) diff --git a/ahnlich/similarity/src/hnsw/mod.rs b/ahnlich/similarity/src/hnsw/mod.rs index 3d5150d09..9e3e65adb 100644 --- a/ahnlich/similarity/src/hnsw/mod.rs +++ b/ahnlich/similarity/src/hnsw/mod.rs @@ -40,10 +40,51 @@ pub(crate) type NodeIdBuildHasher = std::hash::BuildHasherDefault; /// LayerIndex is just a wrapper around u16 to represent a layer in HNSW. +/// +/// Uses string-based serde since this type is used as JSON map keys, +/// which are always strings in JSON. #[derive(Debug, Clone, Copy, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct LayerIndex(pub u16); +#[cfg(feature = "serde")] +impl serde::Serialize for LayerIndex { + fn serialize(&self, serializer: S) -> Result { + if serializer.is_human_readable() { + serializer.collect_str(&self.0) + } else { + self.0.serialize(serializer) + } + } +} + +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for LayerIndex { + fn deserialize>(deserializer: D) -> Result { + use serde::de; + if deserializer.is_human_readable() { + struct LayerIndexVisitor; + impl de::Visitor<'_> for LayerIndexVisitor { + type Value = LayerIndex; + fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str("a u16 number or string representation") + } + fn visit_u16(self, v: u16) -> Result { + Ok(LayerIndex(v)) + } + fn visit_u64(self, v: u64) -> Result { + Ok(LayerIndex(v as u16)) + } + fn visit_str(self, v: &str) -> Result { + v.parse::().map(LayerIndex).map_err(de::Error::custom) + } + } + deserializer.deserialize_any(LayerIndexVisitor) + } else { + u16::deserialize(deserializer).map(LayerIndex) + } + } +} + impl Eq for LayerIndex {} impl PartialOrd for LayerIndex { @@ -58,10 +99,48 @@ impl Ord for LayerIndex { } /// NodeId wraps a u64 hash of the node's embedding to uniquely identify a node across all layers. +/// +/// Uses string-based serde for JSON compatibility since this type is used as JSON map keys, +/// which are always strings in JSON. Accepts both numbers and strings during deserialization. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct NodeId(pub u64); +#[cfg(feature = "serde")] +impl serde::Serialize for NodeId { + fn serialize(&self, serializer: S) -> Result { + if serializer.is_human_readable() { + serializer.collect_str(&self.0) + } else { + self.0.serialize(serializer) + } + } +} + +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for NodeId { + fn deserialize>(deserializer: D) -> Result { + use serde::de; + if deserializer.is_human_readable() { + struct NodeIdVisitor; + impl de::Visitor<'_> for NodeIdVisitor { + type Value = NodeId; + fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str("a u64 number or string representation") + } + fn visit_u64(self, v: u64) -> Result { + Ok(NodeId(v)) + } + fn visit_str(self, v: &str) -> Result { + v.parse::().map(NodeId).map_err(de::Error::custom) + } + } + deserializer.deserialize_any(NodeIdVisitor) + } else { + u64::deserialize(deserializer).map(NodeId) + } + } +} + /// Node represents a single element in the HNSW graph. /// /// Each node stores: From 18f8a82d84be101837a28441b54f0e9afd503483 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Thu, 18 Jun 2026 12:34:52 +0100 Subject: [PATCH 25/28] feat: make purge_stores schema-aware, add schema to AiStoreInfo - Added schema field to AiStoreInfo proto (field 8) for all SDKs - list_stores(None) now defaults to public schema instead of all schemas - Added all_store_names_by_schema() for internal cross-schema iteration - purge_stores now drops DB stores across all schemas using correct schema per store - Regenerated all gRPC stubs (Rust, Go, Node, Python) - Populated schema in get_store from request params --- ahnlich/ai/src/engine/operations.rs | 13 +-- ahnlich/ai/src/engine/store.rs | 59 ++++++---- ahnlich/ai/src/server/handler.rs | 9 +- ahnlich/db/src/replication/mod.rs | 30 ++++-- ahnlich/db/src/tests/cluster_tests.rs | 18 +++- .../db/src/tests/replication_store_tests.rs | 2 + ahnlich/types/src/ai/server.rs | 2 + protos/ai/server.proto | 1 + .../execution_provider.pb.go | 5 +- .../grpc/ai/models/models.pb.go | 5 +- .../grpc/ai/pipeline/pipeline.pb.go | 10 +- .../grpc/ai/preprocess/preprocess.pb.go | 5 +- .../grpc/ai/query/query.pb.go | 10 +- .../grpc/ai/server/server.pb.go | 102 ++++++++++-------- .../grpc/algorithm/algorithms/algorithm.pb.go | 5 +- .../grpc/algorithm/nonlinear/nonlinear.pb.go | 8 +- .../grpc/client/client.pb.go | 5 +- .../grpc/db/query/query.pb.go | 10 +- .../grpc/db/server/server.pb.go | 10 +- .../grpc/keyval/keyval.pb.go | 8 +- .../grpc/metadata/metadata.pb.go | 5 +- .../grpc/predicates/predicate.pb.go | 8 +- .../grpc/server_types/server_types.pb.go | 5 +- .../grpc/services/ai_service/ai_service.pb.go | 8 +- .../services/ai_service/ai_service_grpc.pb.go | 8 +- .../services/db_service/db_service_grpc.pb.go | 47 +++++++- .../grpc/shared/cluster/cluster.pb.go | 5 +- .../grpc/shared/info/info.pb.go | 8 +- .../grpc/similarity/similarity.pb.go | 5 +- .../grpc/version/version.pb.go | 5 +- sdk/ahnlich-client-node/grpc/ai/server_pb.ts | 6 ++ .../grpc/ai/server/__init__.py | 1 + 32 files changed, 245 insertions(+), 183 deletions(-) diff --git a/ahnlich/ai/src/engine/operations.rs b/ahnlich/ai/src/engine/operations.rs index ed3126ab9..37e861fae 100644 --- a/ahnlich/ai/src/engine/operations.rs +++ b/ahnlich/ai/src/engine/operations.rs @@ -398,21 +398,14 @@ pub async fn purge_stores( _params: PurgeStores, parent_id: Option, ) -> Result { - let schema = Schema::default(); - let store_names: Vec = store_handler - .list_stores(Some(&schema)) - .into_iter() - .map(|store| StoreName { value: store.name }) - .collect(); - if let Some(db_client) = db_client { - for store_name in &store_names { + for (schema, store_name) in store_handler.all_store_names_by_schema() { db_client .drop_store( DbDropStore { - store: store_name.value.clone(), + store: store_name.value, error_if_not_exists: false, - schema: Some(schema.to_string()), + schema: Some(schema), }, parent_id.clone(), ) diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 0ff805f40..3181004f6 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -192,33 +192,43 @@ impl AIStoreHandler { } /// matches LISTSTORES - to return statistics of all stores + /// When schema is None, defaults to the public schema. #[tracing::instrument(skip(self))] pub(crate) fn list_stores(&self, schema: Option<&Schema>) -> StdHashSet { let guard = self.stores.guard(); let mut result = StdHashSet::new(); - let inner_stores_list: Vec = if let Some(schema) = schema { - self.stores - .get(schema, &guard) - .map(|s| vec![s.clone()]) - .unwrap_or_default() - } else { - self.stores.iter(&guard).map(|(_, v)| v.clone()).collect() + let schema = schema.unwrap_or(&self.default_schema); + let inner_stores = match self.stores.get(schema, &guard) { + Some(s) => s.clone(), + None => return result, }; - for inner_stores in inner_stores_list { + let inner_guard = inner_stores.guard(); + for (store_name, store) in inner_stores.iter(&inner_guard) { + let model: ModelDetails = SupportedModels::from(&store.index_model).to_model_details(); + + result.insert(AiStoreInfo { + name: store_name.value.clone(), + query_model: store.query_model.into(), + index_model: store.index_model.into(), + embedding_size: model.embedding_size.get() as u64, + predicate_indices: vec![], + dimension: model.embedding_size.get() as u32, + db_info: None, + schema: Some(schema.to_string()), + }); + } + result + } + + /// Iterates all stores across every schema, returning (schema, store_name) pairs. + /// Used internally by purge_stores to clean up DB stores across all schemas. + pub(crate) fn all_store_names_by_schema(&self) -> Vec<(String, StoreName)> { + let guard = self.stores.guard(); + let mut result = Vec::new(); + for (schema, inner_stores) in self.stores.iter(&guard) { let inner_guard = inner_stores.guard(); - for (store_name, store) in inner_stores.iter(&inner_guard) { - let model: ModelDetails = - SupportedModels::from(&store.index_model).to_model_details(); - - result.insert(AiStoreInfo { - name: store_name.value.clone(), - query_model: store.query_model.into(), - index_model: store.index_model.into(), - embedding_size: model.embedding_size.get() as u64, - predicate_indices: vec![], - dimension: model.embedding_size.get() as u32, - db_info: None, - }); + for store_name in inner_stores.keys(&inner_guard) { + result.push((schema.to_string(), store_name.clone())); } } result @@ -226,7 +236,11 @@ impl AIStoreHandler { /// matches GETSTORE - to return info for a single store #[tracing::instrument(skip(self))] - pub(crate) fn get_store(&self, store_name: &StoreName) -> Result { + pub(crate) fn get_store( + &self, + store_name: &StoreName, + schema: Option<&str>, + ) -> Result { let store = self.get(store_name)?; let model: ModelDetails = SupportedModels::from(&store.index_model).to_model_details(); Ok(AiStoreInfo { @@ -237,6 +251,7 @@ impl AIStoreHandler { predicate_indices: vec![], dimension: model.embedding_size.get() as u32, db_info: None, + schema: schema.map(|s| s.to_owned()), }) } diff --git a/ahnlich/ai/src/server/handler.rs b/ahnlich/ai/src/server/handler.rs index ccf9eb777..fbaddf716 100644 --- a/ahnlich/ai/src/server/handler.rs +++ b/ahnlich/ai/src/server/handler.rs @@ -520,9 +520,12 @@ impl AiService for AIProxyServer { request: tonic::Request, ) -> Result, tonic::Status> { let params = request.into_inner(); - let mut store_info = self.store_handler.get_store(&StoreName { - value: params.store.clone(), - })?; + let mut store_info = self.store_handler.get_store( + &StoreName { + value: params.store.clone(), + }, + params.schema.as_deref(), + )?; // Enrich with predicate indices and db_info from DB, filtering out reserved keys if let Some(db_client) = &self.db_client { let parent_id = tracer::span_to_trace_parent(tracing::Span::current()); diff --git a/ahnlich/db/src/replication/mod.rs b/ahnlich/db/src/replication/mod.rs index 7eb0950c8..4d7ca9d13 100644 --- a/ahnlich/db/src/replication/mod.rs +++ b/ahnlich/db/src/replication/mod.rs @@ -172,7 +172,10 @@ impl StateMachineHandler for DbStateMachine { } fn get_snapshot(&self) -> Self::Snapshot { - self.store_handler.get_snapshot() + self.store_handler + .get_snapshot() + .into_latest() + .expect("snapshot should be at latest version") } fn restore_snapshot(&mut self, snapshot: Self::Snapshot) { @@ -211,6 +214,7 @@ mod tests { create_predicates: Vec::new(), non_linear_indices: Vec::new(), error_if_exists: true, + schema: None, } } @@ -230,6 +234,7 @@ mod tests { query::DropStore { store: store.to_owned(), error_if_not_exists: true, + schema: None, } } @@ -279,7 +284,10 @@ mod tests { } ); - let stores = operations::list_stores(state_machine.store_handler()); + let stores = operations::list_stores( + state_machine.store_handler(), + query::ListStores { schema: None }, + ); assert_eq!(stores.stores.len(), 1); assert_eq!(stores.stores[0].name, "products"); assert_eq!(stores.stores[0].len, 1); @@ -314,9 +322,12 @@ mod tests { let deleted_count = decode_count_response(response); assert_eq!(deleted_count, 1); assert!( - operations::list_stores(state_machine.store_handler()) - .stores - .is_empty() + operations::list_stores( + state_machine.store_handler(), + query::ListStores { schema: None } + ) + .stores + .is_empty() ); } @@ -330,9 +341,12 @@ mod tests { assert!(matches!(err, StorageError::IO { .. })); assert!( - operations::list_stores(state_machine.store_handler()) - .stores - .is_empty() + operations::list_stores( + state_machine.store_handler(), + query::ListStores { schema: None } + ) + .stores + .is_empty() ); assert!( !state_machine diff --git a/ahnlich/db/src/tests/cluster_tests.rs b/ahnlich/db/src/tests/cluster_tests.rs index dd0346688..32eae92b3 100644 --- a/ahnlich/db/src/tests/cluster_tests.rs +++ b/ahnlich/db/src/tests/cluster_tests.rs @@ -162,6 +162,7 @@ async fn test_single_node_clustered_pipeline_and_cluster_info() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })), }, DbQuery { @@ -171,7 +172,9 @@ async fn test_single_node_clustered_pipeline_and_cluster_info() { })), }, DbQuery { - query: Some(Query::ListStores(db_query_types::ListStores {})), + query: Some(Query::ListStores(db_query_types::ListStores { + schema: None, + })), }, DbQuery { query: Some(Query::ClusterInfo(ClusterInfoQuery {})), @@ -275,6 +278,7 @@ async fn test_three_node_cluster_replication_and_follower_list_stores_error() { create_predicates: vec![], non_linear_indices: vec![], error_if_exists: true, + schema: None, })) .await .expect("leader create_store should succeed"); @@ -306,7 +310,9 @@ async fn test_three_node_cluster_replication_and_follower_list_stores_error() { ); let leader_store_list = leader_client - .list_stores(tonic::Request::new(db_query_types::ListStores {})) + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: None, + })) .await .expect("leader ListStores should succeed") .into_inner(); @@ -321,13 +327,17 @@ async fn test_three_node_cluster_replication_and_follower_list_stores_error() { assert!(replicated_store.predicate_indices.is_empty()); let list_stores_error = follower_one_client - .list_stores(tonic::Request::new(db_query_types::ListStores {})) + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: None, + })) .await .expect_err("follower ListStores should error in M2"); assert_eq!(list_stores_error.code(), Code::FailedPrecondition); let second_list_stores_error = follower_two_client - .list_stores(tonic::Request::new(db_query_types::ListStores {})) + .list_stores(tonic::Request::new(db_query_types::ListStores { + schema: None, + })) .await .expect_err("second follower ListStores should error in M2"); assert_eq!(second_list_stores_error.code(), Code::FailedPrecondition); diff --git a/ahnlich/db/src/tests/replication_store_tests.rs b/ahnlich/db/src/tests/replication_store_tests.rs index 7a7fb94a0..67432b511 100644 --- a/ahnlich/db/src/tests/replication_store_tests.rs +++ b/ahnlich/db/src/tests/replication_store_tests.rs @@ -64,6 +64,7 @@ fn create_store_query(store: &str, dimension: u32) -> query::CreateStore { create_predicates: Vec::new(), non_linear_indices: Vec::new(), error_if_exists: true, + schema: None, } } @@ -83,6 +84,7 @@ fn drop_store_query(store: &str) -> query::DropStore { query::DropStore { store: store.to_owned(), error_if_not_exists: true, + schema: None, } } diff --git a/ahnlich/types/src/ai/server.rs b/ahnlich/types/src/ai/server.rs index 2539184b3..682fc567b 100644 --- a/ahnlich/types/src/ai/server.rs +++ b/ahnlich/types/src/ai/server.rs @@ -75,6 +75,8 @@ pub struct AiStoreInfo { pub dimension: u32, #[prost(message, optional, tag = "7")] pub db_info: ::core::option::Option, + #[prost(string, optional, tag = "8")] + pub schema: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct EmbeddingWithMetadata { diff --git a/protos/ai/server.proto b/protos/ai/server.proto index 2492427e1..a941689ce 100644 --- a/protos/ai/server.proto +++ b/protos/ai/server.proto @@ -67,6 +67,7 @@ message AIStoreInfo { repeated string predicate_indices = 5; uint32 dimension = 6; optional db.server.StoreInfo db_info = 7; + optional string schema = 8; } message EmbeddingWithMetadata { diff --git a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go index 407d18760..4d0345415 100644 --- a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go @@ -7,11 +7,10 @@ package execution_provider import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go index 6e1dc787a..a7b8afbf1 100644 --- a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go @@ -7,11 +7,10 @@ package models import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go index a14bc4cfd..77fe5b270 100644 --- a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go @@ -7,15 +7,13 @@ package pipeline import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go index b57a656f9..49c0b0ae8 100644 --- a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go @@ -7,11 +7,10 @@ package preprocess import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go index 6437b74f0..4e5c1f783 100644 --- a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go @@ -7,12 +7,6 @@ package query import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - execution_provider "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/execution_provider" models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" preprocess "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/preprocess" @@ -20,6 +14,10 @@ import ( nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go index 64ea1dabf..e0cddecf9 100644 --- a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go @@ -7,12 +7,6 @@ package server import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" @@ -20,6 +14,10 @@ import ( _ "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -611,6 +609,7 @@ type AIStoreInfo struct { PredicateIndices []string `protobuf:"bytes,5,rep,name=predicate_indices,json=predicateIndices,proto3" json:"predicate_indices,omitempty"` Dimension uint32 `protobuf:"varint,6,opt,name=dimension,proto3" json:"dimension,omitempty"` DbInfo *server.StoreInfo `protobuf:"bytes,7,opt,name=db_info,json=dbInfo,proto3,oneof" json:"db_info,omitempty"` + Schema *string `protobuf:"bytes,8,opt,name=schema,proto3,oneof" json:"schema,omitempty"` } func (x *AIStoreInfo) Reset() { @@ -694,6 +693,13 @@ func (x *AIStoreInfo) GetDbInfo() *server.StoreInfo { return nil } +func (x *AIStoreInfo) GetSchema() string { + if x != nil && x.Schema != nil { + return *x.Schema + } + return "" +} + type EmbeddingWithMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -989,7 +995,7 @@ var file_ai_server_proto_rawDesc = []byte{ 0x75, 0x6e, 0x74, 0x22, 0x36, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x22, 0xbd, 0x02, 0x0a, 0x0b, + 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x22, 0xe5, 0x02, 0x0a, 0x0b, 0x41, 0x49, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x02, @@ -1008,46 +1014,48 @@ var file_ai_server_proto_rawDesc = []byte{ 0x52, 0x09, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x48, 0x00, 0x52, 0x06, 0x64, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x88, 0x01, 0x01, 0x42, - 0x0a, 0x0a, 0x08, 0x5f, 0x64, 0x62, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x15, - 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x09, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, - 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, - 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x65, 0x6d, 0x62, 0x65, - 0x64, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, - 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x55, 0x0a, 0x11, 0x4d, 0x75, 0x6c, 0x74, 0x69, - 0x70, 0x6c, 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x40, 0x0a, 0x0a, - 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x62, - 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x0a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xc5, - 0x01, 0x0a, 0x16, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, - 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x05, 0x69, 0x6e, 0x70, - 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, - 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x05, 0x69, 0x6e, - 0x70, 0x75, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, - 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x12, - 0x3a, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x62, 0x65, - 0x64, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x76, - 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x22, 0x57, 0x0a, 0x1a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, - 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, - 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, - 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, - 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x66, 0x6f, 0x48, 0x00, 0x52, 0x06, 0x64, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x88, 0x01, 0x01, 0x12, + 0x1b, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x64, 0x62, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x22, 0x89, 0x01, 0x0a, 0x15, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, + 0x67, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, + 0x09, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, + 0x65, 0x79, 0x52, 0x09, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, + 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x55, 0x0a, 0x11, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, + 0x64, 0x69, 0x6e, 0x67, 0x12, 0x40, 0x0a, 0x0a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x69, + 0x74, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x65, 0x6d, 0x62, 0x65, + 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xc5, 0x01, 0x0a, 0x16, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, + 0x67, 0x12, 0x28, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x6d, + 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, + 0x6c, 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x08, 0x6d, + 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x69, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x74, + 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x22, 0x57, + 0x0a, 0x1a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, + 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x06, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, + 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x52, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, + 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, + 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x61, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go index 42a32c2f7..190f0ccc3 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go @@ -7,11 +7,10 @@ package algorithms import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go index 26e5b0bab..90d3139d6 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go @@ -7,13 +7,11 @@ package nonlinear import ( - reflect "reflect" - sync "sync" - + algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/client/client.pb.go b/sdk/ahnlich-client-go/grpc/client/client.pb.go index 9e9d3b259..c8473bfe1 100644 --- a/sdk/ahnlich-client-go/grpc/client/client.pb.go +++ b/sdk/ahnlich-client-go/grpc/client/client.pb.go @@ -7,11 +7,10 @@ package client import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go index 51ce5ae88..616666020 100644 --- a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go @@ -7,16 +7,14 @@ package query import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go index 49d0ce65a..85fdb727a 100644 --- a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go @@ -7,17 +7,15 @@ package server import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go index 5469e84ea..791f70701 100644 --- a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go +++ b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go @@ -7,13 +7,11 @@ package keyval import ( - reflect "reflect" - sync "sync" - + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go index c33154adb..e94e96adf 100644 --- a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go +++ b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go @@ -7,11 +7,10 @@ package metadata import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go index a3b1f7276..7accab29c 100644 --- a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go +++ b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go @@ -7,13 +7,11 @@ package predicates import ( - reflect "reflect" - sync "sync" - + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go index fac3e2773..6acf33906 100644 --- a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go +++ b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go @@ -7,11 +7,10 @@ package server_types import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go index b130cfc8c..1d5ccbfb8 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go @@ -7,14 +7,12 @@ package ai_service import ( - reflect "reflect" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go index 70554e958..9f9e0332c 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go @@ -8,14 +8,12 @@ package ai_service import ( context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go index a7b44a42e..f699b2c10 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go @@ -8,14 +8,13 @@ package db_service import ( context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" + cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file @@ -41,6 +40,7 @@ const ( DBService_ListClients_FullMethodName = "/services.db_service.DBService/ListClients" DBService_ListStores_FullMethodName = "/services.db_service.DBService/ListStores" DBService_InfoServer_FullMethodName = "/services.db_service.DBService/InfoServer" + DBService_ClusterInfo_FullMethodName = "/services.db_service.DBService/ClusterInfo" DBService_Ping_FullMethodName = "/services.db_service.DBService/Ping" DBService_Pipeline_FullMethodName = "/services.db_service.DBService/Pipeline" ) @@ -71,6 +71,7 @@ type DBServiceClient interface { ListClients(ctx context.Context, in *query.ListClients, opts ...grpc.CallOption) (*server.ClientList, error) ListStores(ctx context.Context, in *query.ListStores, opts ...grpc.CallOption) (*server.StoreList, error) InfoServer(ctx context.Context, in *query.InfoServer, opts ...grpc.CallOption) (*server.InfoServer, error) + ClusterInfo(ctx context.Context, in *cluster.ClusterInfoQuery, opts ...grpc.CallOption) (*cluster.ClusterInfoResponse, error) Ping(ctx context.Context, in *query.Ping, opts ...grpc.CallOption) (*server.Pong, error) // * Pipeline method for all methods * Pipeline(ctx context.Context, in *pipeline.DBRequestPipeline, opts ...grpc.CallOption) (*pipeline.DBResponsePipeline, error) @@ -254,6 +255,16 @@ func (c *dBServiceClient) InfoServer(ctx context.Context, in *query.InfoServer, return out, nil } +func (c *dBServiceClient) ClusterInfo(ctx context.Context, in *cluster.ClusterInfoQuery, opts ...grpc.CallOption) (*cluster.ClusterInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(cluster.ClusterInfoResponse) + err := c.cc.Invoke(ctx, DBService_ClusterInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dBServiceClient) Ping(ctx context.Context, in *query.Ping, opts ...grpc.CallOption) (*server.Pong, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(server.Pong) @@ -300,6 +311,7 @@ type DBServiceServer interface { ListClients(context.Context, *query.ListClients) (*server.ClientList, error) ListStores(context.Context, *query.ListStores) (*server.StoreList, error) InfoServer(context.Context, *query.InfoServer) (*server.InfoServer, error) + ClusterInfo(context.Context, *cluster.ClusterInfoQuery) (*cluster.ClusterInfoResponse, error) Ping(context.Context, *query.Ping) (*server.Pong, error) // * Pipeline method for all methods * Pipeline(context.Context, *pipeline.DBRequestPipeline) (*pipeline.DBResponsePipeline, error) @@ -364,6 +376,9 @@ func (UnimplementedDBServiceServer) ListStores(context.Context, *query.ListStore func (UnimplementedDBServiceServer) InfoServer(context.Context, *query.InfoServer) (*server.InfoServer, error) { return nil, status.Errorf(codes.Unimplemented, "method InfoServer not implemented") } +func (UnimplementedDBServiceServer) ClusterInfo(context.Context, *cluster.ClusterInfoQuery) (*cluster.ClusterInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClusterInfo not implemented") +} func (UnimplementedDBServiceServer) Ping(context.Context, *query.Ping) (*server.Pong, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } @@ -697,6 +712,24 @@ func _DBService_InfoServer_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _DBService_ClusterInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(cluster.ClusterInfoQuery) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DBServiceServer).ClusterInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DBService_ClusterInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DBServiceServer).ClusterInfo(ctx, req.(*cluster.ClusterInfoQuery)) + } + return interceptor(ctx, in, info, handler) +} + func _DBService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(query.Ping) if err := dec(in); err != nil { @@ -808,6 +841,10 @@ var DBService_ServiceDesc = grpc.ServiceDesc{ MethodName: "InfoServer", Handler: _DBService_InfoServer_Handler, }, + { + MethodName: "ClusterInfo", + Handler: _DBService_ClusterInfo_Handler, + }, { MethodName: "Ping", Handler: _DBService_Ping_Handler, diff --git a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go index 88f9580bf..5c7f1f49d 100644 --- a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go @@ -16,11 +16,10 @@ package cluster import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go index d5a440ea8..cb2e80638 100644 --- a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go @@ -7,13 +7,11 @@ package info import ( - reflect "reflect" - sync "sync" - + server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - - server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go index 289811655..aa9a9050d 100644 --- a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go +++ b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go @@ -7,11 +7,10 @@ package similarity import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/version/version.pb.go b/sdk/ahnlich-client-go/grpc/version/version.pb.go index 3207ab183..a7474bc7d 100644 --- a/sdk/ahnlich-client-go/grpc/version/version.pb.go +++ b/sdk/ahnlich-client-go/grpc/version/version.pb.go @@ -7,11 +7,10 @@ package version import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/sdk/ahnlich-client-node/grpc/ai/server_pb.ts b/sdk/ahnlich-client-node/grpc/ai/server_pb.ts index 35eb22f0e..5f8385e31 100644 --- a/sdk/ahnlich-client-node/grpc/ai/server_pb.ts +++ b/sdk/ahnlich-client-node/grpc/ai/server_pb.ts @@ -542,6 +542,11 @@ export class AIStoreInfo extends Message { */ dbInfo?: StoreInfo; + /** + * @generated from field: optional string schema = 8; + */ + schema?: string; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -563,6 +568,7 @@ export class AIStoreInfo extends Message { }, { no: 6, name: "dimension", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 7, name: "db_info", kind: "message", T: StoreInfo, opt: true }, + { no: 8, name: "schema", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AIStoreInfo { diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py index 3a127c314..7e0eb8961 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/ai/server/__init__.py @@ -90,6 +90,7 @@ class AiStoreInfo(betterproto.Message): db_info: Optional["__db_server__.StoreInfo"] = betterproto.message_field( 7, optional=True ) + schema: Optional[str] = betterproto.string_field(8, optional=True) @dataclass(eq=False, repr=False) From 41be2d836db7535554dbac481ba8505ce1c80444 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Thu, 18 Jun 2026 12:52:56 +0100 Subject: [PATCH 26/28] fix: revert to custom string-based serde for StoreKeyId, LayerIndex, NodeId #[serde(transparent)] breaks JSON map key deserialization because serde_json's KeyDeserialize trait doesn't propagate through transparent newtypes. JSON map keys are always strings, and u64::deserialize chokes on strings. Restored custom serde that serializes as string and deserializes from both strings and numbers. --- ahnlich/similarity/src/hnsw/mod.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ahnlich/similarity/src/hnsw/mod.rs b/ahnlich/similarity/src/hnsw/mod.rs index 9e3e65adb..6718ba782 100644 --- a/ahnlich/similarity/src/hnsw/mod.rs +++ b/ahnlich/similarity/src/hnsw/mod.rs @@ -40,9 +40,6 @@ pub(crate) type NodeIdBuildHasher = std::hash::BuildHasherDefault; /// LayerIndex is just a wrapper around u16 to represent a layer in HNSW. -/// -/// Uses string-based serde since this type is used as JSON map keys, -/// which are always strings in JSON. #[derive(Debug, Clone, Copy, PartialEq, Hash)] pub struct LayerIndex(pub u16); @@ -99,9 +96,6 @@ impl Ord for LayerIndex { } /// NodeId wraps a u64 hash of the node's embedding to uniquely identify a node across all layers. -/// -/// Uses string-based serde for JSON compatibility since this type is used as JSON map keys, -/// which are always strings in JSON. Accepts both numbers and strings during deserialization. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct NodeId(pub u64); From e11a4c50311c56d02c3f5803c3b6e044db5f6cf1 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 19 Jun 2026 10:24:53 +0100 Subject: [PATCH 27/28] fix: align schema persistence behavior --- ahnlich/ai/src/engine/store.rs | 2 +- ahnlich/ai/src/engine/versioned.rs | 39 +- ahnlich/ai/src/tests/aiproxy_test.rs | 7 +- ahnlich/db/src/engine/store.rs | 18 +- ahnlich/db/src/engine/versioned.rs | 39 +- ahnlich/db/src/server/handler.rs | 13 +- .../db/src/tests/fixtures/db_v2_snapshot.json | 32 +- ahnlich/similarity/src/hnsw/mod.rs | 79 +--- .../execution_provider.pb.go | 5 +- .../grpc/ai/models/models.pb.go | 5 +- .../grpc/ai/pipeline/pipeline.pb.go | 10 +- .../grpc/ai/preprocess/preprocess.pb.go | 5 +- .../grpc/ai/query/query.pb.go | 10 +- .../grpc/ai/server/server.pb.go | 10 +- .../grpc/algorithm/algorithms/algorithm.pb.go | 5 +- .../grpc/algorithm/nonlinear/nonlinear.pb.go | 8 +- .../grpc/client/client.pb.go | 5 +- .../grpc/db/pipeline/pipeline.pb.go | 357 ++++++++++-------- .../grpc/db/query/query.pb.go | 10 +- .../grpc/db/server/server.pb.go | 10 +- .../grpc/keyval/keyval.pb.go | 8 +- .../grpc/metadata/metadata.pb.go | 5 +- .../grpc/predicates/predicate.pb.go | 8 +- .../grpc/server_types/server_types.pb.go | 5 +- .../grpc/services/ai_service/ai_service.pb.go | 8 +- .../services/ai_service/ai_service_grpc.pb.go | 8 +- .../grpc/services/db_service/db_service.pb.go | 237 ++++++------ .../services/db_service/db_service_grpc.pb.go | 8 +- .../grpc/shared/cluster/cluster.pb.go | 5 +- .../grpc/shared/info/info.pb.go | 8 +- .../grpc/similarity/similarity.pb.go | 5 +- .../grpc/version/version.pb.go | 5 +- .../grpc/db/pipeline_pb.ts | 21 +- 33 files changed, 549 insertions(+), 451 deletions(-) diff --git a/ahnlich/ai/src/engine/store.rs b/ahnlich/ai/src/engine/store.rs index 3181004f6..b0a2bb111 100644 --- a/ahnlich/ai/src/engine/store.rs +++ b/ahnlich/ai/src/engine/store.rs @@ -191,7 +191,7 @@ impl AIStoreHandler { Ok(()) } - /// matches LISTSTORES - to return statistics of all stores + /// matches LISTSTORES - to return statistics of all stores. /// When schema is None, defaults to the public schema. #[tracing::instrument(skip(self))] pub(crate) fn list_stores(&self, schema: Option<&Schema>) -> StdHashSet { diff --git a/ahnlich/ai/src/engine/versioned.rs b/ahnlich/ai/src/engine/versioned.rs index 6924116d8..ec64df9e9 100644 --- a/ahnlich/ai/src/engine/versioned.rs +++ b/ahnlich/ai/src/engine/versioned.rs @@ -15,6 +15,21 @@ pub const AI_MIN_VERSION: u32 = 1; type AiStoresV1 = HashMap; type AiStoresV2 = HashMap; +#[derive(Debug, Deserialize)] +struct TaggedAiStoresV1 { + stores: AiStoresV1, +} + +#[derive(Debug, Deserialize)] +struct TaggedAiStoresV2 { + stores: AiStoresV2, +} + +#[derive(Debug, Deserialize)] +struct AiVersionTag { + db_version: Option, +} + #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "db_version")] pub enum VersionedAiStores { @@ -32,9 +47,20 @@ impl VersionedPersistence for VersionedAiStores { fn load_and_migrate(bytes: &[u8]) -> Result { Self::validate_version(bytes)?; - match serde_json::from_slice::(bytes) { - Ok(versioned) => Ok(versioned), - Err(_) => { + match Self::snapshot_version(bytes) { + Some(1) => { + let tagged: TaggedAiStoresV1 = serde_json::from_slice(bytes)?; + Ok(VersionedAiStores::V1 { + stores: tagged.stores, + }) + } + Some(2) => { + let tagged: TaggedAiStoresV2 = serde_json::from_slice(bytes)?; + let stores = Self::migrate_v1n_to_v2(tagged.stores) + .map_err(PersistenceTaskError::MigrationError)?; + Ok(VersionedAiStores::V2 { stores }) + } + _ => { if let Ok(nested) = serde_json::from_slice::(bytes) { log::warn!("No db_version tag, detected schema-nested (V1n) format"); let stores = Self::migrate_v1n_to_v2(nested) @@ -50,6 +76,13 @@ impl VersionedPersistence for VersionedAiStores { } impl VersionedAiStores { + fn snapshot_version(bytes: &[u8]) -> Option { + serde_json::from_slice::(bytes) + .ok() + .and_then(|tag| tag.db_version) + .and_then(|version| version.parse::().ok()) + } + fn migrate_v1n_to_v2(v1_nested: AiStoresV2) -> Result { let stores = fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; diff --git a/ahnlich/ai/src/tests/aiproxy_test.rs b/ahnlich/ai/src/tests/aiproxy_test.rs index 9626bfb63..9bcc40981 100644 --- a/ahnlich/ai/src/tests/aiproxy_test.rs +++ b/ahnlich/ai/src/tests/aiproxy_test.rs @@ -1478,6 +1478,8 @@ async fn test_ai_proxy_del_pred() { #[tokio::test] async fn test_ai_proxy_test_with_persistence() { + let _ = std::fs::remove_file(&*PERSISTENCE_FILE); + // Setup servers with persistence let server = Server::new(&CONFIG) .await @@ -2349,14 +2351,15 @@ async fn test_ai_schema_create_store_in_schema() { assert_eq!(response.stores.len(), 1); assert_eq!(response.stores[0].name, "AiCustomStore"); - // List stores with no filter - should return all 2 stores + // List stores with no filter - should default to public schema let message = ahnlich_types::ai::query::ListStores { schema: None }; let response = client .list_stores(tonic::Request::new(message)) .await .expect("Failed to list stores without filter") .into_inner(); - assert_eq!(response.stores.len(), 2); + assert_eq!(response.stores.len(), 1); + assert_eq!(response.stores[0].name, "AiPublicStore"); } /// Test: DropSchema through AI proxy diff --git a/ahnlich/db/src/engine/store.rs b/ahnlich/db/src/engine/store.rs index cec2e9fdb..1b90e92ca 100644 --- a/ahnlich/db/src/engine/store.rs +++ b/ahnlich/db/src/engine/store.rs @@ -38,24 +38,10 @@ type StoreEntryWithSimilarity = (EmbeddingKey, Arc, Similarity); /// potentially larger /// We should be only able to generate a store key id from a 1D vector except during tests -#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +#[serde(transparent)] pub(crate) struct StoreKeyId(u64); -impl Serialize for StoreKeyId { - fn serialize(&self, serializer: S) -> Result { - serializer.collect_str(&self.0) - } -} - -impl<'de> Deserialize<'de> for StoreKeyId { - fn deserialize>(deserializer: D) -> Result { - use serde::de; - let s = String::deserialize(deserializer)?; - let val = s.parse::().map_err(de::Error::custom)?; - Ok(StoreKeyId(val)) - } -} - #[cfg(test)] impl From for StoreKeyId { fn from(value: u64) -> Self { diff --git a/ahnlich/db/src/engine/versioned.rs b/ahnlich/db/src/engine/versioned.rs index ba677d0f5..e842c35c3 100644 --- a/ahnlich/db/src/engine/versioned.rs +++ b/ahnlich/db/src/engine/versioned.rs @@ -15,6 +15,21 @@ pub const DB_MIN_VERSION: u32 = 1; type DbStoresV1 = HashMap; type DbStoresV2 = HashMap; +#[derive(Debug, Deserialize)] +struct TaggedDbStoresV1 { + stores: DbStoresV1, +} + +#[derive(Debug, Deserialize)] +struct TaggedDbStoresV2 { + stores: DbStoresV2, +} + +#[derive(Debug, Deserialize)] +struct DbVersionTag { + db_version: Option, +} + #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "db_version")] pub enum VersionedDbStores { @@ -32,9 +47,20 @@ impl VersionedPersistence for VersionedDbStores { fn load_and_migrate(bytes: &[u8]) -> Result { Self::validate_version(bytes)?; - match serde_json::from_slice::(bytes) { - Ok(versioned) => Ok(versioned), - Err(_) => { + match Self::snapshot_version(bytes) { + Some(1) => { + let tagged: TaggedDbStoresV1 = serde_json::from_slice(bytes)?; + Ok(VersionedDbStores::V1 { + stores: tagged.stores, + }) + } + Some(2) => { + let tagged: TaggedDbStoresV2 = serde_json::from_slice(bytes)?; + let stores = Self::migrate_v1n_to_v2(tagged.stores) + .map_err(PersistenceTaskError::MigrationError)?; + Ok(VersionedDbStores::V2 { stores }) + } + _ => { if let Ok(nested) = serde_json::from_slice::(bytes) { log::warn!("No db_version tag, detected schema-nested (V1n) format"); let stores = Self::migrate_v1n_to_v2(nested) @@ -50,6 +76,13 @@ impl VersionedPersistence for VersionedDbStores { } impl VersionedDbStores { + fn snapshot_version(bytes: &[u8]) -> Option { + serde_json::from_slice::(bytes) + .ok() + .and_then(|tag| tag.db_version) + .and_then(|version| version.parse::().ok()) + } + fn migrate_v1n_to_v2(v1_nested: DbStoresV2) -> Result { let stores = fallible::try_new_arc_hashmap().map_err(|e| format!("Migration failed: {e}"))?; diff --git a/ahnlich/db/src/server/handler.rs b/ahnlich/db/src/server/handler.rs index 02c5b57d7..61e620db2 100644 --- a/ahnlich/db/src/server/handler.rs +++ b/ahnlich/db/src/server/handler.rs @@ -364,10 +364,17 @@ impl DbService for Server { let dropped = match &self.runtime { StoreRuntime::Cluster(cluster) => { - submit_db_command!(Some(cluster), query::DropSchema, params, DbCommand::DropSchema) - .await? + submit_db_command!( + Some(cluster), + query::DropSchema, + params, + DbCommand::DropSchema + ) + .await? + } + StoreRuntime::Standalone(store_handler) => { + operations::drop_schema(store_handler, params)? } - StoreRuntime::Standalone(store_handler) => operations::drop_schema(store_handler, params)?, }; Ok(tonic::Response::new(server::Del { diff --git a/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json b/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json index b398d830c..7cdf09b39 100644 --- a/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json +++ b/ahnlich/db/src/tests/fixtures/db_v2_snapshot.json @@ -14,8 +14,8 @@ { "value": { "color": "str:green", - "name": "str:item2", - "category": "str:vegetable" + "category": "str:vegetable", + "name": "str:item2" } } ], @@ -27,35 +27,35 @@ ], { "value": { + "color": "str:red", "name": "str:item1", - "category": "str:fruit", - "color": "str:red" + "category": "str:fruit" } } ] }, "predicate_indices": { "inner": { - "color": { - "str:red": [ - "11596182387809500963" + "category": { + "str:fruit": [ + 11596182387809500963 ], - "str:green": [ - "15178017180037765037" + "str:vegetable": [ + 15178017180037765037 ] }, - "category": { - "str:vegetable": [ - "15178017180037765037" + "color": { + "str:green": [ + 15178017180037765037 ], - "str:fruit": [ - "11596182387809500963" + "str:red": [ + 11596182387809500963 ] } }, "allowed_predicates": [ - "color", - "category" + "category", + "color" ] }, "non_linear_indices": { diff --git a/ahnlich/similarity/src/hnsw/mod.rs b/ahnlich/similarity/src/hnsw/mod.rs index 6718ba782..c3213d1fa 100644 --- a/ahnlich/similarity/src/hnsw/mod.rs +++ b/ahnlich/similarity/src/hnsw/mod.rs @@ -41,47 +41,10 @@ pub(crate) type NodeIdHashSet = std::collections::HashSet(&self, serializer: S) -> Result { - if serializer.is_human_readable() { - serializer.collect_str(&self.0) - } else { - self.0.serialize(serializer) - } - } -} - -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for LayerIndex { - fn deserialize>(deserializer: D) -> Result { - use serde::de; - if deserializer.is_human_readable() { - struct LayerIndexVisitor; - impl de::Visitor<'_> for LayerIndexVisitor { - type Value = LayerIndex; - fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - f.write_str("a u16 number or string representation") - } - fn visit_u16(self, v: u16) -> Result { - Ok(LayerIndex(v)) - } - fn visit_u64(self, v: u64) -> Result { - Ok(LayerIndex(v as u16)) - } - fn visit_str(self, v: &str) -> Result { - v.parse::().map(LayerIndex).map_err(de::Error::custom) - } - } - deserializer.deserialize_any(LayerIndexVisitor) - } else { - u16::deserialize(deserializer).map(LayerIndex) - } - } -} - impl Eq for LayerIndex {} impl PartialOrd for LayerIndex { @@ -97,44 +60,10 @@ impl Ord for LayerIndex { /// NodeId wraps a u64 hash of the node's embedding to uniquely identify a node across all layers. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", serde(transparent))] pub struct NodeId(pub u64); -#[cfg(feature = "serde")] -impl serde::Serialize for NodeId { - fn serialize(&self, serializer: S) -> Result { - if serializer.is_human_readable() { - serializer.collect_str(&self.0) - } else { - self.0.serialize(serializer) - } - } -} - -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for NodeId { - fn deserialize>(deserializer: D) -> Result { - use serde::de; - if deserializer.is_human_readable() { - struct NodeIdVisitor; - impl de::Visitor<'_> for NodeIdVisitor { - type Value = NodeId; - fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - f.write_str("a u64 number or string representation") - } - fn visit_u64(self, v: u64) -> Result { - Ok(NodeId(v)) - } - fn visit_str(self, v: &str) -> Result { - v.parse::().map(NodeId).map_err(de::Error::custom) - } - } - deserializer.deserialize_any(NodeIdVisitor) - } else { - u64::deserialize(deserializer).map(NodeId) - } - } -} - /// Node represents a single element in the HNSW graph. /// /// Each node stores: diff --git a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go index 4d0345415..407d18760 100644 --- a/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/execution_provider/execution_provider.pb.go @@ -7,10 +7,11 @@ package execution_provider import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go index a7b8afbf1..6e1dc787a 100644 --- a/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/models/models.pb.go @@ -7,10 +7,11 @@ package models import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go index 77fe5b270..a14bc4cfd 100644 --- a/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/pipeline/pipeline.pb.go @@ -7,13 +7,15 @@ package pipeline import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go index 49c0b0ae8..b57a656f9 100644 --- a/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/preprocess/preprocess.pb.go @@ -7,10 +7,11 @@ package preprocess import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go index 4e5c1f783..6437b74f0 100644 --- a/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/query/query.pb.go @@ -7,6 +7,12 @@ package query import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + execution_provider "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/execution_provider" models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" preprocess "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/preprocess" @@ -14,10 +20,6 @@ import ( nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go index e0cddecf9..d404ca099 100644 --- a/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/ai/server/server.pb.go @@ -7,6 +7,12 @@ package server import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + models "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/models" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" @@ -14,10 +20,6 @@ import ( _ "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go index 190f0ccc3..42a32c2f7 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/algorithms/algorithm.pb.go @@ -7,10 +7,11 @@ package algorithms import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go index 90d3139d6..26e5b0bab 100644 --- a/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go +++ b/sdk/ahnlich-client-go/grpc/algorithm/nonlinear/nonlinear.pb.go @@ -7,11 +7,13 @@ package nonlinear import ( - algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/client/client.pb.go b/sdk/ahnlich-client-go/grpc/client/client.pb.go index c8473bfe1..9e9d3b259 100644 --- a/sdk/ahnlich-client-go/grpc/client/client.pb.go +++ b/sdk/ahnlich-client-go/grpc/client/client.pb.go @@ -7,10 +7,11 @@ package client import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go b/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go index 8a21d9037..eb2ace05d 100644 --- a/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/pipeline/pipeline.pb.go @@ -15,6 +15,7 @@ import ( query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" + cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" ) @@ -49,6 +50,7 @@ type DBQuery struct { // *DBQuery_ListClients // *DBQuery_Ping // *DBQuery_GetStore + // *DBQuery_ClusterInfo // *DBQuery_DropSchema Query isDBQuery_Query `protobuf_oneof:"query"` } @@ -211,6 +213,13 @@ func (x *DBQuery) GetGetStore() *query.GetStore { return nil } +func (x *DBQuery) GetClusterInfo() *cluster.ClusterInfoQuery { + if x, ok := x.GetQuery().(*DBQuery_ClusterInfo); ok { + return x.ClusterInfo + } + return nil +} + func (x *DBQuery) GetDropSchema() *query.DropSchema { if x, ok := x.GetQuery().(*DBQuery_DropSchema); ok { return x.DropSchema @@ -290,8 +299,12 @@ type DBQuery_GetStore struct { GetStore *query.GetStore `protobuf:"bytes,17,opt,name=get_store,json=getStore,proto3,oneof"` } +type DBQuery_ClusterInfo struct { + ClusterInfo *cluster.ClusterInfoQuery `protobuf:"bytes,18,opt,name=cluster_info,json=clusterInfo,proto3,oneof"` +} + type DBQuery_DropSchema struct { - DropSchema *query.DropSchema `protobuf:"bytes,18,opt,name=drop_schema,json=dropSchema,proto3,oneof"` + DropSchema *query.DropSchema `protobuf:"bytes,19,opt,name=drop_schema,json=dropSchema,proto3,oneof"` } func (*DBQuery_CreateStore) isDBQuery_Query() {} @@ -328,6 +341,8 @@ func (*DBQuery_Ping) isDBQuery_Query() {} func (*DBQuery_GetStore) isDBQuery_Query() {} +func (*DBQuery_ClusterInfo) isDBQuery_Query() {} + func (*DBQuery_DropSchema) isDBQuery_Query() {} type DBRequestPipeline struct { @@ -396,6 +411,7 @@ type DBServerResponse struct { // *DBServerResponse_CreateIndex // *DBServerResponse_Error // *DBServerResponse_StoreInfo + // *DBServerResponse_ClusterInfo Response isDBServerResponse_Response `protobuf_oneof:"response"` } @@ -522,6 +538,13 @@ func (x *DBServerResponse) GetStoreInfo() *server.StoreInfo { return nil } +func (x *DBServerResponse) GetClusterInfo() *cluster.ClusterInfoResponse { + if x, ok := x.GetResponse().(*DBServerResponse_ClusterInfo); ok { + return x.ClusterInfo + } + return nil +} + type isDBServerResponse_Response interface { isDBServerResponse_Response() } @@ -574,6 +597,10 @@ type DBServerResponse_StoreInfo struct { StoreInfo *server.StoreInfo `protobuf:"bytes,12,opt,name=store_info,json=storeInfo,proto3,oneof"` } +type DBServerResponse_ClusterInfo struct { + ClusterInfo *cluster.ClusterInfoResponse `protobuf:"bytes,13,opt,name=cluster_info,json=clusterInfo,proto3,oneof"` +} + func (*DBServerResponse_Unit) isDBServerResponse_Response() {} func (*DBServerResponse_Pong) isDBServerResponse_Response() {} @@ -598,6 +625,8 @@ func (*DBServerResponse_Error) isDBServerResponse_Response() {} func (*DBServerResponse_StoreInfo) isDBServerResponse_Response() {} +func (*DBServerResponse_ClusterInfo) isDBServerResponse_Response() {} + type DBResponsePipeline struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -652,129 +681,139 @@ var file_db_pipeline_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x0e, 0x64, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x64, 0x62, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x08, 0x0a, 0x07, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x3a, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, - 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x07, - 0x67, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, - 0x00, 0x52, 0x06, 0x67, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x08, 0x67, 0x65, 0x74, - 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x48, 0x00, - 0x52, 0x07, 0x67, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x09, 0x67, 0x65, 0x74, - 0x5f, 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, - 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x47, 0x0a, 0x11, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x48, 0x00, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x73, 0x0a, 0x21, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x6f, - 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x1d, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x41, 0x0a, 0x0f, 0x64, 0x72, 0x6f, 0x70, - 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, - 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x72, - 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6d, 0x0a, 0x1f, 0x64, - 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x1b, 0x64, - 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, - 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x03, 0x73, 0x65, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, 0x12, 0x2b, 0x0a, - 0x07, 0x64, 0x65, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, - 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, - 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x48, - 0x00, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x0a, 0x64, 0x72, - 0x6f, 0x70, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x09, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, - 0x12, 0x37, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x6f, 0x1a, 0x14, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, + 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x09, 0x0a, 0x07, 0x44, + 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x67, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, + 0x65, 0x74, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x06, 0x67, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x2e, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x65, 0x64, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, + 0x2f, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, + 0x12, 0x47, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x62, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, + 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x73, 0x0a, 0x21, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, + 0x1d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, + 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x41, + 0x0a, 0x0f, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x48, 0x00, 0x52, 0x0d, 0x64, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x6d, 0x0a, 0x1f, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, + 0x6e, 0x65, 0x61, 0x72, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x62, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, + 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x48, 0x00, 0x52, 0x1b, 0x64, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, + 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x21, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, + 0x73, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x4b, 0x65, 0x79, + 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, + 0x6c, 0x50, 0x72, 0x65, 0x64, 0x48, 0x00, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, + 0x12, 0x34, 0x0a, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x09, 0x64, 0x72, 0x6f, + 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, + 0x37, 0x0a, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x69, + 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x69, 0x73, 0x74, + 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, + 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x09, 0x67, 0x65, + 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x48, 0x00, 0x52, 0x08, 0x67, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x45, 0x0a, + 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, + 0x00, 0x52, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x07, 0x0a, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x71, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, + 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xa7, 0x05, 0x0a, 0x10, + 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x25, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x48, + 0x00, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x38, + 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, + 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x38, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, - 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0b, 0x6c, 0x69, 0x73, - 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x48, - 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x24, - 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, - 0x70, 0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x08, 0x67, - 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x5f, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x42, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2e, - 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xdd, - 0x04, 0x0a, 0x10, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, - 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x70, 0x6f, - 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, - 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x00, - 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x03, - 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, - 0x12, 0x22, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x00, 0x52, - 0x03, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x5f, - 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, 0x67, - 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x22, 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x44, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, - 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x0a, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, - 0x0a, 0x12, 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, - 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, - 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x62, 0x2f, 0x70, 0x69, - 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x3b, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x03, 0x73, 0x65, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, 0x12, 0x22, 0x0a, + 0x03, 0x67, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, + 0x74, 0x12, 0x30, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x5f, 0x6e, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x74, 0x53, + 0x69, 0x6d, 0x4e, 0x12, 0x22, 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, + 0x48, 0x00, 0x52, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x69, 0x6e, 0x66, + 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, + 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x48, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x12, 0x44, 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, + 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, + 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x64, 0x62, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x3b, 0x70, 0x69, + 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -812,19 +851,21 @@ var file_db_pipeline_proto_goTypes = []any{ (*query.ListClients)(nil), // 18: db.query.ListClients (*query.Ping)(nil), // 19: db.query.Ping (*query.GetStore)(nil), // 20: db.query.GetStore - (*query.DropSchema)(nil), // 21: db.query.DropSchema - (*server.Unit)(nil), // 22: db.server.Unit - (*server.Pong)(nil), // 23: db.server.Pong - (*server.ClientList)(nil), // 24: db.server.ClientList - (*server.StoreList)(nil), // 25: db.server.StoreList - (*server.InfoServer)(nil), // 26: db.server.InfoServer - (*server.Set)(nil), // 27: db.server.Set - (*server.Get)(nil), // 28: db.server.Get - (*server.GetSimN)(nil), // 29: db.server.GetSimN - (*server.Del)(nil), // 30: db.server.Del - (*server.CreateIndex)(nil), // 31: db.server.CreateIndex - (*info.ErrorResponse)(nil), // 32: shared.info.ErrorResponse - (*server.StoreInfo)(nil), // 33: db.server.StoreInfo + (*cluster.ClusterInfoQuery)(nil), // 21: shared.cluster.ClusterInfoQuery + (*query.DropSchema)(nil), // 22: db.query.DropSchema + (*server.Unit)(nil), // 23: db.server.Unit + (*server.Pong)(nil), // 24: db.server.Pong + (*server.ClientList)(nil), // 25: db.server.ClientList + (*server.StoreList)(nil), // 26: db.server.StoreList + (*server.InfoServer)(nil), // 27: db.server.InfoServer + (*server.Set)(nil), // 28: db.server.Set + (*server.Get)(nil), // 29: db.server.Get + (*server.GetSimN)(nil), // 30: db.server.GetSimN + (*server.Del)(nil), // 31: db.server.Del + (*server.CreateIndex)(nil), // 32: db.server.CreateIndex + (*info.ErrorResponse)(nil), // 33: shared.info.ErrorResponse + (*server.StoreInfo)(nil), // 34: db.server.StoreInfo + (*cluster.ClusterInfoResponse)(nil), // 35: shared.cluster.ClusterInfoResponse } var file_db_pipeline_proto_depIdxs = []int32{ 4, // 0: db.pipeline.DBQuery.create_store:type_name -> db.query.CreateStore @@ -844,26 +885,28 @@ var file_db_pipeline_proto_depIdxs = []int32{ 18, // 14: db.pipeline.DBQuery.list_clients:type_name -> db.query.ListClients 19, // 15: db.pipeline.DBQuery.ping:type_name -> db.query.Ping 20, // 16: db.pipeline.DBQuery.get_store:type_name -> db.query.GetStore - 21, // 17: db.pipeline.DBQuery.drop_schema:type_name -> db.query.DropSchema - 0, // 18: db.pipeline.DBRequestPipeline.queries:type_name -> db.pipeline.DBQuery - 22, // 19: db.pipeline.DBServerResponse.unit:type_name -> db.server.Unit - 23, // 20: db.pipeline.DBServerResponse.pong:type_name -> db.server.Pong - 24, // 21: db.pipeline.DBServerResponse.client_list:type_name -> db.server.ClientList - 25, // 22: db.pipeline.DBServerResponse.store_list:type_name -> db.server.StoreList - 26, // 23: db.pipeline.DBServerResponse.info_server:type_name -> db.server.InfoServer - 27, // 24: db.pipeline.DBServerResponse.set:type_name -> db.server.Set - 28, // 25: db.pipeline.DBServerResponse.get:type_name -> db.server.Get - 29, // 26: db.pipeline.DBServerResponse.get_sim_n:type_name -> db.server.GetSimN - 30, // 27: db.pipeline.DBServerResponse.del:type_name -> db.server.Del - 31, // 28: db.pipeline.DBServerResponse.create_index:type_name -> db.server.CreateIndex - 32, // 29: db.pipeline.DBServerResponse.error:type_name -> shared.info.ErrorResponse - 33, // 30: db.pipeline.DBServerResponse.store_info:type_name -> db.server.StoreInfo - 2, // 31: db.pipeline.DBResponsePipeline.responses:type_name -> db.pipeline.DBServerResponse - 32, // [32:32] is the sub-list for method output_type - 32, // [32:32] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 21, // 17: db.pipeline.DBQuery.cluster_info:type_name -> shared.cluster.ClusterInfoQuery + 22, // 18: db.pipeline.DBQuery.drop_schema:type_name -> db.query.DropSchema + 0, // 19: db.pipeline.DBRequestPipeline.queries:type_name -> db.pipeline.DBQuery + 23, // 20: db.pipeline.DBServerResponse.unit:type_name -> db.server.Unit + 24, // 21: db.pipeline.DBServerResponse.pong:type_name -> db.server.Pong + 25, // 22: db.pipeline.DBServerResponse.client_list:type_name -> db.server.ClientList + 26, // 23: db.pipeline.DBServerResponse.store_list:type_name -> db.server.StoreList + 27, // 24: db.pipeline.DBServerResponse.info_server:type_name -> db.server.InfoServer + 28, // 25: db.pipeline.DBServerResponse.set:type_name -> db.server.Set + 29, // 26: db.pipeline.DBServerResponse.get:type_name -> db.server.Get + 30, // 27: db.pipeline.DBServerResponse.get_sim_n:type_name -> db.server.GetSimN + 31, // 28: db.pipeline.DBServerResponse.del:type_name -> db.server.Del + 32, // 29: db.pipeline.DBServerResponse.create_index:type_name -> db.server.CreateIndex + 33, // 30: db.pipeline.DBServerResponse.error:type_name -> shared.info.ErrorResponse + 34, // 31: db.pipeline.DBServerResponse.store_info:type_name -> db.server.StoreInfo + 35, // 32: db.pipeline.DBServerResponse.cluster_info:type_name -> shared.cluster.ClusterInfoResponse + 2, // 33: db.pipeline.DBResponsePipeline.responses:type_name -> db.pipeline.DBServerResponse + 34, // [34:34] is the sub-list for method output_type + 34, // [34:34] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name } func init() { file_db_pipeline_proto_init() } @@ -939,6 +982,7 @@ func file_db_pipeline_proto_init() { (*DBQuery_ListClients)(nil), (*DBQuery_Ping)(nil), (*DBQuery_GetStore)(nil), + (*DBQuery_ClusterInfo)(nil), (*DBQuery_DropSchema)(nil), } file_db_pipeline_proto_msgTypes[2].OneofWrappers = []any{ @@ -954,6 +998,7 @@ func file_db_pipeline_proto_init() { (*DBServerResponse_CreateIndex)(nil), (*DBServerResponse_Error)(nil), (*DBServerResponse_StoreInfo)(nil), + (*DBServerResponse_ClusterInfo)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go index 616666020..51ce5ae88 100644 --- a/sdk/ahnlich-client-go/grpc/db/query/query.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/query/query.pb.go @@ -7,14 +7,16 @@ package query import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + algorithms "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/algorithms" nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" predicates "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/predicates" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go index 85fdb727a..49d0ce65a 100644 --- a/sdk/ahnlich-client-go/grpc/db/server/server.pb.go +++ b/sdk/ahnlich-client-go/grpc/db/server/server.pb.go @@ -7,15 +7,17 @@ package server import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + nonlinear "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/algorithm/nonlinear" client "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/client" keyval "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/keyval" info "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/info" similarity "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/similarity" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go index 791f70701..5469e84ea 100644 --- a/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go +++ b/sdk/ahnlich-client-go/grpc/keyval/keyval.pb.go @@ -7,11 +7,13 @@ package keyval import ( - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go index e94e96adf..c33154adb 100644 --- a/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go +++ b/sdk/ahnlich-client-go/grpc/metadata/metadata.pb.go @@ -7,10 +7,11 @@ package metadata import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go index 7accab29c..a3b1f7276 100644 --- a/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go +++ b/sdk/ahnlich-client-go/grpc/predicates/predicate.pb.go @@ -7,11 +7,13 @@ package predicates import ( - metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + metadata "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/metadata" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go index 6acf33906..fac3e2773 100644 --- a/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go +++ b/sdk/ahnlich-client-go/grpc/server_types/server_types.pb.go @@ -7,10 +7,11 @@ package server_types import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go index 1d5ccbfb8..b130cfc8c 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service.pb.go @@ -7,12 +7,14 @@ package ai_service import ( + reflect "reflect" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go index 9f9e0332c..70554e958 100644 --- a/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/ai_service/ai_service_grpc.pb.go @@ -8,12 +8,14 @@ package ai_service import ( context "context" - pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" - query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" - server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/pipeline" + query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/query" + server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/ai/server" ) // This is a compile-time assertion to ensure that this generated file diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go index b6ee2cf89..27d7f2e5b 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service.pb.go @@ -15,6 +15,7 @@ import ( pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" + cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" ) const ( @@ -33,82 +34,88 @@ var file_services_db_service_proto_rawDesc = []byte{ 0x1a, 0x11, 0x64, 0x62, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x64, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x64, 0x62, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xca, 0x08, 0x0a, 0x09, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x0f, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x2e, 0x64, - 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x60, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, - 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x27, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, - 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, - 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, - 0x07, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x47, - 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x1a, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x34, 0x0a, - 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x14, 0x2e, - 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x0d, 0x2e, 0x64, 0x62, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x44, 0x72, 0x6f, - 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x2e, 0x64, 0x62, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x44, 0x65, 0x6c, 0x12, 0x54, 0x0a, 0x1b, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, - 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x25, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, - 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, - 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x2a, 0x0a, 0x06, 0x44, 0x65, 0x6c, - 0x4b, 0x65, 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, - 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x2c, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, - 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x50, - 0x72, 0x65, 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x44, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x09, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, - 0x12, 0x13, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, - 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, - 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x14, 0x2e, 0x64, 0x62, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x39, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x14, - 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x04, 0x50, - 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, - 0x69, 0x6e, 0x67, 0x1a, 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, - 0x12, 0x1e, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, - 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, - 0x1a, 0x1f, 0x2e, 0x64, 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, - 0x42, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x64, 0x65, 0x76, 0x65, 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, - 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2f, 0x64, 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x64, - 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa0, 0x09, 0x0a, 0x09, 0x44, + 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0f, + 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x12, + 0x44, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x19, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x16, 0x2e, + 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x60, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, + 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, + 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, + 0x16, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, + 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, + 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x64, 0x12, 0x11, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, + 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x12, 0x11, 0x2e, 0x64, + 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x4e, 0x1a, + 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x69, 0x6d, 0x4e, 0x12, 0x34, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, + 0x12, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x1a, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x03, 0x53, 0x65, 0x74, + 0x12, 0x0d, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x1a, + 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x12, + 0x38, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x17, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, + 0x50, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x54, 0x0a, 0x1b, 0x44, 0x72, 0x6f, + 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x25, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x4e, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x65, 0x61, + 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, + 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, + 0x2a, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x2e, 0x64, 0x62, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x1a, 0x0e, 0x2e, 0x64, 0x62, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x2c, 0x0a, 0x07, 0x44, + 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x12, 0x11, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x50, 0x72, 0x65, 0x64, 0x1a, 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x09, 0x44, 0x72, 0x6f, + 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x13, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x0e, 0x2e, 0x64, 0x62, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x44, + 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x1a, + 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x12, + 0x3b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, + 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x15, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, + 0x1a, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x1a, 0x15, 0x2e, 0x64, 0x62, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x12, 0x54, 0x0a, 0x0b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x20, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x1a, 0x23, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, + 0x0e, 0x2e, 0x64, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x1a, + 0x0f, 0x2e, 0x64, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6e, 0x67, + 0x12, 0x4b, 0x0a, 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x64, + 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x1f, 0x2e, 0x64, + 0x62, 0x2e, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x56, 0x5a, + 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x65, + 0x6e, 0x39, 0x36, 0x2f, 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2f, 0x73, 0x64, 0x6b, 0x2f, + 0x61, 0x68, 0x6e, 0x6c, 0x69, 0x63, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, + 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x64, 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x64, 0x62, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_services_db_service_proto_goTypes = []any{ @@ -129,20 +136,22 @@ var file_services_db_service_proto_goTypes = []any{ (*query.ListClients)(nil), // 14: db.query.ListClients (*query.ListStores)(nil), // 15: db.query.ListStores (*query.InfoServer)(nil), // 16: db.query.InfoServer - (*query.Ping)(nil), // 17: db.query.Ping - (*pipeline.DBRequestPipeline)(nil), // 18: db.pipeline.DBRequestPipeline - (*server.Unit)(nil), // 19: db.server.Unit - (*server.CreateIndex)(nil), // 20: db.server.CreateIndex - (*server.Get)(nil), // 21: db.server.Get - (*server.GetSimN)(nil), // 22: db.server.GetSimN - (*server.StoreInfo)(nil), // 23: db.server.StoreInfo - (*server.Set)(nil), // 24: db.server.Set - (*server.Del)(nil), // 25: db.server.Del - (*server.ClientList)(nil), // 26: db.server.ClientList - (*server.StoreList)(nil), // 27: db.server.StoreList - (*server.InfoServer)(nil), // 28: db.server.InfoServer - (*server.Pong)(nil), // 29: db.server.Pong - (*pipeline.DBResponsePipeline)(nil), // 30: db.pipeline.DBResponsePipeline + (*cluster.ClusterInfoQuery)(nil), // 17: shared.cluster.ClusterInfoQuery + (*query.Ping)(nil), // 18: db.query.Ping + (*pipeline.DBRequestPipeline)(nil), // 19: db.pipeline.DBRequestPipeline + (*server.Unit)(nil), // 20: db.server.Unit + (*server.CreateIndex)(nil), // 21: db.server.CreateIndex + (*server.Get)(nil), // 22: db.server.Get + (*server.GetSimN)(nil), // 23: db.server.GetSimN + (*server.StoreInfo)(nil), // 24: db.server.StoreInfo + (*server.Set)(nil), // 25: db.server.Set + (*server.Del)(nil), // 26: db.server.Del + (*server.ClientList)(nil), // 27: db.server.ClientList + (*server.StoreList)(nil), // 28: db.server.StoreList + (*server.InfoServer)(nil), // 29: db.server.InfoServer + (*cluster.ClusterInfoResponse)(nil), // 30: shared.cluster.ClusterInfoResponse + (*server.Pong)(nil), // 31: db.server.Pong + (*pipeline.DBResponsePipeline)(nil), // 32: db.pipeline.DBResponsePipeline } var file_services_db_service_proto_depIdxs = []int32{ 0, // 0: services.db_service.DBService.CreateStore:input_type -> db.query.CreateStore @@ -162,29 +171,31 @@ var file_services_db_service_proto_depIdxs = []int32{ 14, // 14: services.db_service.DBService.ListClients:input_type -> db.query.ListClients 15, // 15: services.db_service.DBService.ListStores:input_type -> db.query.ListStores 16, // 16: services.db_service.DBService.InfoServer:input_type -> db.query.InfoServer - 17, // 17: services.db_service.DBService.Ping:input_type -> db.query.Ping - 18, // 18: services.db_service.DBService.Pipeline:input_type -> db.pipeline.DBRequestPipeline - 19, // 19: services.db_service.DBService.CreateStore:output_type -> db.server.Unit - 20, // 20: services.db_service.DBService.CreatePredIndex:output_type -> db.server.CreateIndex - 20, // 21: services.db_service.DBService.CreateNonLinearAlgorithmIndex:output_type -> db.server.CreateIndex - 21, // 22: services.db_service.DBService.GetKey:output_type -> db.server.Get - 21, // 23: services.db_service.DBService.GetPred:output_type -> db.server.Get - 22, // 24: services.db_service.DBService.GetSimN:output_type -> db.server.GetSimN - 23, // 25: services.db_service.DBService.GetStore:output_type -> db.server.StoreInfo - 24, // 26: services.db_service.DBService.Set:output_type -> db.server.Set - 25, // 27: services.db_service.DBService.DropPredIndex:output_type -> db.server.Del - 25, // 28: services.db_service.DBService.DropNonLinearAlgorithmIndex:output_type -> db.server.Del - 25, // 29: services.db_service.DBService.DelKey:output_type -> db.server.Del - 25, // 30: services.db_service.DBService.DelPred:output_type -> db.server.Del - 25, // 31: services.db_service.DBService.DropStore:output_type -> db.server.Del - 25, // 32: services.db_service.DBService.DropSchema:output_type -> db.server.Del - 26, // 33: services.db_service.DBService.ListClients:output_type -> db.server.ClientList - 27, // 34: services.db_service.DBService.ListStores:output_type -> db.server.StoreList - 28, // 35: services.db_service.DBService.InfoServer:output_type -> db.server.InfoServer - 29, // 36: services.db_service.DBService.Ping:output_type -> db.server.Pong - 30, // 37: services.db_service.DBService.Pipeline:output_type -> db.pipeline.DBResponsePipeline - 19, // [19:38] is the sub-list for method output_type - 0, // [0:19] is the sub-list for method input_type + 17, // 17: services.db_service.DBService.ClusterInfo:input_type -> shared.cluster.ClusterInfoQuery + 18, // 18: services.db_service.DBService.Ping:input_type -> db.query.Ping + 19, // 19: services.db_service.DBService.Pipeline:input_type -> db.pipeline.DBRequestPipeline + 20, // 20: services.db_service.DBService.CreateStore:output_type -> db.server.Unit + 21, // 21: services.db_service.DBService.CreatePredIndex:output_type -> db.server.CreateIndex + 21, // 22: services.db_service.DBService.CreateNonLinearAlgorithmIndex:output_type -> db.server.CreateIndex + 22, // 23: services.db_service.DBService.GetKey:output_type -> db.server.Get + 22, // 24: services.db_service.DBService.GetPred:output_type -> db.server.Get + 23, // 25: services.db_service.DBService.GetSimN:output_type -> db.server.GetSimN + 24, // 26: services.db_service.DBService.GetStore:output_type -> db.server.StoreInfo + 25, // 27: services.db_service.DBService.Set:output_type -> db.server.Set + 26, // 28: services.db_service.DBService.DropPredIndex:output_type -> db.server.Del + 26, // 29: services.db_service.DBService.DropNonLinearAlgorithmIndex:output_type -> db.server.Del + 26, // 30: services.db_service.DBService.DelKey:output_type -> db.server.Del + 26, // 31: services.db_service.DBService.DelPred:output_type -> db.server.Del + 26, // 32: services.db_service.DBService.DropStore:output_type -> db.server.Del + 26, // 33: services.db_service.DBService.DropSchema:output_type -> db.server.Del + 27, // 34: services.db_service.DBService.ListClients:output_type -> db.server.ClientList + 28, // 35: services.db_service.DBService.ListStores:output_type -> db.server.StoreList + 29, // 36: services.db_service.DBService.InfoServer:output_type -> db.server.InfoServer + 30, // 37: services.db_service.DBService.ClusterInfo:output_type -> shared.cluster.ClusterInfoResponse + 31, // 38: services.db_service.DBService.Ping:output_type -> db.server.Pong + 32, // 39: services.db_service.DBService.Pipeline:output_type -> db.pipeline.DBResponsePipeline + 20, // [20:40] is the sub-list for method output_type + 0, // [0:20] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go index f699b2c10..36ff36bd1 100644 --- a/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go +++ b/sdk/ahnlich-client-go/grpc/services/db_service/db_service_grpc.pb.go @@ -8,13 +8,15 @@ package db_service import ( context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + pipeline "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/pipeline" query "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/query" server "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/db/server" cluster "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/shared/cluster" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file diff --git a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go index 5c7f1f49d..88f9580bf 100644 --- a/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/cluster/cluster.pb.go @@ -16,10 +16,11 @@ package cluster import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go index cb2e80638..d5a440ea8 100644 --- a/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go +++ b/sdk/ahnlich-client-go/grpc/shared/info/info.pb.go @@ -7,11 +7,13 @@ package info import ( - server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + server_types "github.com/deven96/ahnlich/sdk/ahnlich-client-go/grpc/server_types" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go index aa9a9050d..289811655 100644 --- a/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go +++ b/sdk/ahnlich-client-go/grpc/similarity/similarity.pb.go @@ -7,10 +7,11 @@ package similarity import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-go/grpc/version/version.pb.go b/sdk/ahnlich-client-go/grpc/version/version.pb.go index a7474bc7d..3207ab183 100644 --- a/sdk/ahnlich-client-go/grpc/version/version.pb.go +++ b/sdk/ahnlich-client-go/grpc/version/version.pb.go @@ -7,10 +7,11 @@ package version import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts b/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts index f92ef33cd..75588b49f 100644 --- a/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts +++ b/sdk/ahnlich-client-node/grpc/db/pipeline_pb.ts @@ -32,6 +32,7 @@ import { Ping, Set, } from "./query_pb.js"; +import { ClusterInfoQuery, ClusterInfoResponse } from "../shared/cluster_pb.js"; import { ClientList, CreateIndex, @@ -176,7 +177,14 @@ export class DBQuery extends Message { } | { /** - * @generated from field: db.query.DropSchema drop_schema = 18; + * @generated from field: shared.cluster.ClusterInfoQuery cluster_info = 18; + */ + value: ClusterInfoQuery; + case: "clusterInfo"; + } + | { + /** + * @generated from field: db.query.DropSchema drop_schema = 19; */ value: DropSchema; case: "dropSchema"; @@ -220,7 +228,8 @@ export class DBQuery extends Message { { no: 15, name: "list_clients", kind: "message", T: ListClients, oneof: "query" }, { no: 16, name: "ping", kind: "message", T: Ping, oneof: "query" }, { no: 17, name: "get_store", kind: "message", T: GetStore, oneof: "query" }, - { no: 18, name: "drop_schema", kind: "message", T: DropSchema, oneof: "query" }, + { no: 18, name: "cluster_info", kind: "message", T: ClusterInfoQuery, oneof: "query" }, + { no: 19, name: "drop_schema", kind: "message", T: DropSchema, oneof: "query" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DBQuery { @@ -375,6 +384,13 @@ export class DBServerResponse extends Message { value: StoreInfo; case: "storeInfo"; } + | { + /** + * @generated from field: shared.cluster.ClusterInfoResponse cluster_info = 13; + */ + value: ClusterInfoResponse; + case: "clusterInfo"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -397,6 +413,7 @@ export class DBServerResponse extends Message { { no: 10, name: "create_index", kind: "message", T: CreateIndex, oneof: "response" }, { no: 11, name: "error", kind: "message", T: ErrorResponse, oneof: "response" }, { no: 12, name: "store_info", kind: "message", T: StoreInfo, oneof: "response" }, + { no: 13, name: "cluster_info", kind: "message", T: ClusterInfoResponse, oneof: "response" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DBServerResponse { From d00ea7cef87d8bc5e761d00c7da5dcf251c516b3 Mon Sep 17 00:00:00 2001 From: Gregorian Rayne Date: Fri, 19 Jun 2026 10:46:46 +0100 Subject: [PATCH 28/28] fix: regenerate Python stubs after proto field renumbering --- .../grpc/db/pipeline/__init__.py | 9 ++++- .../grpc/services/db_service/__init__.py | 37 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py index 874223e14..63392e964 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/db/pipeline/__init__.py @@ -8,6 +8,7 @@ import betterproto +from ...shared import cluster as __shared_cluster__ from ...shared import info as __shared_info__ from .. import query as _query__ from .. import server as _server__ @@ -40,7 +41,10 @@ class DbQuery(betterproto.Message): list_clients: "_query__.ListClients" = betterproto.message_field(15, group="query") ping: "_query__.Ping" = betterproto.message_field(16, group="query") get_store: "_query__.GetStore" = betterproto.message_field(17, group="query") - drop_schema: "_query__.DropSchema" = betterproto.message_field(18, group="query") + cluster_info: "__shared_cluster__.ClusterInfoQuery" = betterproto.message_field( + 18, group="query" + ) + drop_schema: "_query__.DropSchema" = betterproto.message_field(19, group="query") @dataclass(eq=False, repr=False) @@ -66,6 +70,9 @@ class DbServerResponse(betterproto.Message): 11, group="response" ) store_info: "_server__.StoreInfo" = betterproto.message_field(12, group="response") + cluster_info: "__shared_cluster__.ClusterInfoResponse" = betterproto.message_field( + 13, group="response" + ) @dataclass(eq=False, repr=False) diff --git a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py index c31ab5d07..d788d34dc 100644 --- a/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py +++ b/sdk/ahnlich-client-py/ahnlich_client_py/grpc/services/db_service/__init__.py @@ -13,6 +13,7 @@ from ...db import pipeline as __db_pipeline__ from ...db import query as __db_query__ from ...db import server as __db_server__ +from ...shared import cluster as __shared_cluster__ if TYPE_CHECKING: import grpclib.server @@ -310,6 +311,23 @@ async def info_server( metadata=metadata, ) + async def cluster_info( + self, + shared_cluster_cluster_info_query: "__shared_cluster__.ClusterInfoQuery", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "__shared_cluster__.ClusterInfoResponse": + return await self._unary_unary( + "/services.db_service.DBService/ClusterInfo", + shared_cluster_cluster_info_query, + __shared_cluster__.ClusterInfoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def ping( self, db_query_ping: "__db_query__.Ping", @@ -432,6 +450,11 @@ async def info_server( ) -> "__db_server__.InfoServer": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def cluster_info( + self, shared_cluster_cluster_info_query: "__shared_cluster__.ClusterInfoQuery" + ) -> "__shared_cluster__.ClusterInfoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def ping(self, db_query_ping: "__db_query__.Ping") -> "__db_server__.Pong": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -570,6 +593,14 @@ async def __rpc_info_server( response = await self.info_server(request) await stream.send_message(response) + async def __rpc_cluster_info( + self, + stream: "grpclib.server.Stream[__shared_cluster__.ClusterInfoQuery, __shared_cluster__.ClusterInfoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.cluster_info(request) + await stream.send_message(response) + async def __rpc_ping( self, stream: "grpclib.server.Stream[__db_query__.Ping, __db_server__.Pong]" ) -> None: @@ -689,6 +720,12 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: __db_query__.InfoServer, __db_server__.InfoServer, ), + "/services.db_service.DBService/ClusterInfo": grpclib.const.Handler( + self.__rpc_cluster_info, + grpclib.const.Cardinality.UNARY_UNARY, + __shared_cluster__.ClusterInfoQuery, + __shared_cluster__.ClusterInfoResponse, + ), "/services.db_service.DBService/Ping": grpclib.const.Handler( self.__rpc_ping, grpclib.const.Cardinality.UNARY_UNARY,