From 2ad1c8262ba047419a54543825abc637b73f21d9 Mon Sep 17 00:00:00 2001 From: Priec Date: Thu, 16 Jul 2026 21:12:06 +0200 Subject: [PATCH] refering different tables that are not directly FK5 --- client | 2 +- common/proto/table_script.proto | 22 +++++ common/src/proto/descriptor.bin | Bin 97439 -> 98890 bytes common/src/proto/komp_ac.table_script.rs | 120 +++++++++++++++++++++++ server | 2 +- 5 files changed, 144 insertions(+), 2 deletions(-) diff --git a/client b/client index 6da324a..07c6efc 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 6da324a924df6c2a4917c2085e83816e9b464702 +Subproject commit 07c6efcc22a738dd422ddb19883737e2953e92f1 diff --git a/common/proto/table_script.proto b/common/proto/table_script.proto index 7cb680a..6dc01ff 100644 --- a/common/proto/table_script.proto +++ b/common/proto/table_script.proto @@ -42,6 +42,9 @@ service TableScript { // - Includes normalized dependency metadata from script_dependencies // - Returns an empty scripts list when the table has no scripts rpc GetTableScripts(GetTableScriptsRequest) returns (GetTableScriptsResponse); + + rpc GetScriptDependencyValues(GetScriptDependencyValuesRequest) + returns (GetScriptDependencyValuesResponse); } // Request to create or update a script bound to a specific table and column. @@ -140,3 +143,22 @@ message ScriptDependency { // Relationship table used to match the owner row to the related collection. string via_table = 6; } + +message GetScriptDependencyValuesRequest { + string profile_name = 1; + string table_name = 2; + int64 row_id = 3; + map row_data = 4; +} + +message ScriptDependencyValue { + string operation = 1; + string target_table = 2; + string column = 3; + string via_table = 4; + string value = 5; +} + +message GetScriptDependencyValuesResponse { + repeated ScriptDependencyValue values = 1; +} diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index d1740074aed2bf2c4028e8b49ef9853f47fc8e02..2f4c5cf0d380866a2ce341051e8275450a9e8e15 100644 GIT binary patch delta 2661 zcmZ{l-)|IE6vy}6xidR+w?G)$?e+)#fg09berO-6fFT4h3XiKOYAi18mTiK&rMr|A z15=@fA1PKDU{gvVlz%|eH#I&G72}iQlZX)>^}!fpjK29jGxyS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l{HVo5gf9<(hg8?$d*^A=R)TrHeP7|mZodtrX&e| z(s*#j00dyXx<)CK6rr4SrU<`X$?up%FMHr4xNdIy*%-CQZw^&w&UoP*S-GG_dqKe~ zSKpv6YX+hG_Q@Fa#1-FFlrJ(|KOa;XhU@2R>vVlLl+(_`q&_!h+HY0dX_xEIhzlBl zkgSpyL#3cfn`{i&O!GObU_R5{0h35b8G5tMBTDSiUU$}S(Dst;=R`6y2#-~=F;GaH zGwp?f;T+n_x6&<|7s)a~0Gl_DgaS5i_6Ew0Ah9?JhrL-4ZTgPrEx3gu$8BE-tS7I} z0v0sEAQnZkDpI(>7K<2nYtd{SVw{PsOE7dR5>bOGC&5KUj@uBK^^-z^i?DuW`gL9? zmq=Vx<@j=>@T8W?$`s4ew3XP_C2H!h5|dn_u5ROm+-R9Zr-`QE44JYL>@t;{w-W3! zb?~qSE}L4x_l}{JVkbRhu8^Nx(8JW^Dv3tTLBSQ$w-ULlgw^Ehdm_T*ps}3%I1g=> zYb2UY6tiP#Squ*{sJBs|Yn0{{V-#P>I$;ipF~-NzqHMfQn1qP}T_=n}-O?=NM%;09 zJK8u!Fgv+HL7hP`Jjg~~0j`F&Z<4Sh!DtIch49Cfo&WdeoPq!V diff --git a/common/src/proto/komp_ac.table_script.rs b/common/src/proto/komp_ac.table_script.rs index ca5cd46..e7a0596 100644 --- a/common/src/proto/komp_ac.table_script.rs +++ b/common/src/proto/komp_ac.table_script.rs @@ -119,6 +119,38 @@ pub struct ScriptDependency { #[prost(string, tag = "6")] pub via_table: ::prost::alloc::string::String, } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetScriptDependencyValuesRequest { + #[prost(string, tag = "1")] + pub profile_name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub table_name: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub row_id: i64, + #[prost(map = "string, string", tag = "4")] + pub row_data: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ScriptDependencyValue { + #[prost(string, tag = "1")] + pub operation: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub target_table: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub column: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub via_table: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub value: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetScriptDependencyValuesResponse { + #[prost(message, repeated, tag = "1")] + pub values: ::prost::alloc::vec::Vec, +} /// Generated client implementations. pub mod table_script_client { #![allow( @@ -307,6 +339,35 @@ pub mod table_script_client { ); self.inner.unary(req, path, codec).await } + pub async fn get_script_dependency_values( + &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_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.table_script.TableScript/GetScriptDependencyValues", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.table_script.TableScript", + "GetScriptDependencyValues", + ), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -362,6 +423,13 @@ pub mod table_script_server { tonic::Response, tonic::Status, >; + async fn get_script_dependency_values( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Manages column-computation scripts for user-defined tables. /// Each script belongs to a single table (table_definition_id) and populates @@ -542,6 +610,58 @@ pub mod table_script_server { }; Box::pin(fut) } + "/komp_ac.table_script.TableScript/GetScriptDependencyValues" => { + #[allow(non_camel_case_types)] + struct GetScriptDependencyValuesSvc(pub Arc); + impl< + T: TableScript, + > tonic::server::UnaryService< + super::GetScriptDependencyValuesRequest, + > for GetScriptDependencyValuesSvc { + type Response = super::GetScriptDependencyValuesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetScriptDependencyValuesRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_script_dependency_values( + &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 = GetScriptDependencyValuesSvc(inner); + let codec = tonic_prost::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) + } _ => { Box::pin(async move { let mut response = http::Response::new( diff --git a/server b/server index 1bbb78b..a7af82a 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 1bbb78b494af32a13b6ab039d635df1cdae3cf6e +Subproject commit a7af82a5dd8c3cc349e5d5de3325d339799cfffb