From 2f7d7dcdbca14c3801de2f2a55966d51f0eafdfa Mon Sep 17 00:00:00 2001 From: Priec Date: Thu, 9 Jul 2026 16:38:25 +0200 Subject: [PATCH] migration of the profile from the previous year --- client | 2 +- common/build.rs | 8 ++ common/proto/table_definition.proto | 18 ++++ common/src/proto/descriptor.bin | Bin 86440 -> 87562 bytes common/src/proto/komp_ac.table_definition.rs | 107 +++++++++++++++++++ server | 2 +- tui-canvas | 2 +- 7 files changed, 136 insertions(+), 3 deletions(-) diff --git a/client b/client index a2e1881..4d45b25 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit a2e1881ca644746217f5685d98a97733fe5d9efd +Subproject commit 4d45b25c757d51f9f11a6fcf55d64171442346c1 diff --git a/common/build.rs b/common/build.rs index f15ef84..1d71c08 100644 --- a/common/build.rs +++ b/common/build.rs @@ -173,6 +173,14 @@ fn main() -> Result<(), Box> { ".komp_ac.table_definition.TableDefinitionResponse", "#[derive(serde::Serialize, serde::Deserialize)]" ) + .type_attribute( + ".komp_ac.table_definition.CopyProfileRequest", + "#[derive(serde::Serialize, serde::Deserialize)]" + ) + .type_attribute( + ".komp_ac.table_definition.CopyProfileResponse", + "#[derive(serde::Serialize, serde::Deserialize)]" + ) .type_attribute( ".komp_ac.table_definition.GetColumnAliasRenameHistoryRequest", "#[derive(serde::Serialize, serde::Deserialize)]" diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index d535eca..bcf966b 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -26,6 +26,9 @@ service TableDefinition { // Pure data retrieval - no business logic. rpc GetProfileDetails(GetProfileDetailsRequest) returns (GetProfileDetailsResponse); + // Copies one complete profile into a new profile without copying table data. + rpc CopyProfile(CopyProfileRequest) returns (CopyProfileResponse); + // Returns the stored rename history for column aliases in one profile. rpc GetColumnAliasRenameHistory(GetColumnAliasRenameHistoryRequest) returns (GetColumnAliasRenameHistoryResponse); @@ -160,6 +163,21 @@ message GetProfileDetailsResponse { repeated TableDetail tables = 2; } +// Request to copy one full profile into a new profile. +message CopyProfileRequest { + string source_profile_name = 1; + string target_profile_name = 2; + repeated string table_names = 3; +} + +// Response after copying a profile. +message CopyProfileResponse { + bool success = 1; + string message = 2; + int32 tables_copied = 3; + int32 scripts_copied = 4; +} + // Request to fetch recorded column alias rename history for one profile. message GetColumnAliasRenameHistoryRequest { string profile_name = 1; diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 7815935a2accd79c6ca93d879c848c20e492a56e..a930fce21e6cbc5539c9563f4fd2d7495402a051 100644 GIT binary patch delta 4786 zcmZWtYiv}<6~1To?%mzHUa$8q58J%fcEZD?+q9+yglV1FBy|HO5Gy1WlsaZf4aPR! z1xz5>5>f+^5EYX`6;UaKibqrkjSCf#$~zKJH3Zs12vNhM5)cW|ib@d@t@@prJG-g+ zZ@-!Iedo+~&phnCyMk~2CU|gQo_N?bxN+W5yXqI@dW}83tDo)bS=`x`nVVU@B9qN| zX*ZeeS<%;#StzT1oXjUQ@Pk^~mt{C2*WUMXCbzIxQx|q)xLl-Yd}MAyPklXpj2q3h zztojcVcGIPDu6gw4Y6Lf8kHpfr;==MPj@!smAfHX-!@$S<5a~Quf~ljN_JsKPj6>t z5p-yLaBhhn1RZ1Eqi$)oqp!0!SBSDzRLmdMVbyPuTP;s?R1bE|pAr-oLxa29uTjYo zH(IDd?q4*zh`KWJ`sQ+Zd{Ol4V}q}D{G1{eTHKHqB^^s)qBvflMowC?Ankxs;|%wM98hY?A2$e;nrW@>d_@U)fwA(~lD2dRl(B`% zLZFN-R2BkdEDCFJg>89utu;wLy|g7>8&0@a$hB=tSY9A4f4%hT#Iy)=9v*^VI#Ov6 zB+{csy9aeV=IZ2oT_4oe3CE8h9t*_{LVTTdOszGAWtT=sILJDf?*BOA$~j;&@faNj5)9y zQ1CM<8SH43zwenfwXr}JAU8%w_+$Zco43dT$d=Z7$FQ_`c0i z)d{F10D7}m;nM?57&*%QTvv{MY>^)>|66TKVWr$hEs>#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rbfG--Z{VT-RKK>bqfm~( z8}9up=Qhldu(uuvra<3x8i?3A!jCiFNI;m*5q_O<2g|wGPe|CE41yGB>j9eCq(U%^>h51zG%dlrqEh+`?zce#<`av-_8IU=ZFIwcbET zZn>`mg!e7}I?waZ+YHzBrM_!&T>tOImQ)+kRfPW6_%BlbWwNEJ0<&N93-KsoD>&V} zt~oHU3V$NWyjwdEf%9(dKqQ&xwe#, } +/// Request to copy one full profile into a new profile. +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct CopyProfileRequest { + #[prost(string, tag = "1")] + pub source_profile_name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub target_profile_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "3")] + pub table_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Response after copying a profile. +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct CopyProfileResponse { + #[prost(bool, tag = "1")] + pub success: bool, + #[prost(string, tag = "2")] + pub message: ::prost::alloc::string::String, + #[prost(int32, tag = "3")] + pub tables_copied: i32, + #[prost(int32, tag = "4")] + pub scripts_copied: i32, +} /// Request to fetch recorded column alias rename history for one profile. #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -469,6 +493,36 @@ pub mod table_definition_client { ); self.inner.unary(req, path, codec).await } + /// Copies one complete profile into a new profile without copying table data. + pub async fn copy_profile( + &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_definition.TableDefinition/CopyProfile", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.table_definition.TableDefinition", + "CopyProfile", + ), + ); + self.inner.unary(req, path, codec).await + } /// Returns the stored rename history for column aliases in one profile. pub async fn get_column_alias_rename_history( &mut self, @@ -611,6 +665,14 @@ pub mod table_definition_server { tonic::Response, tonic::Status, >; + /// Copies one complete profile into a new profile without copying table data. + async fn copy_profile( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// Returns the stored rename history for column aliases in one profile. async fn get_column_alias_rename_history( &self, @@ -903,6 +965,51 @@ pub mod table_definition_server { }; Box::pin(fut) } + "/komp_ac.table_definition.TableDefinition/CopyProfile" => { + #[allow(non_camel_case_types)] + struct CopyProfileSvc(pub Arc); + impl< + T: TableDefinition, + > tonic::server::UnaryService + for CopyProfileSvc { + type Response = super::CopyProfileResponse; + 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 { + ::copy_profile(&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 = CopyProfileSvc(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) + } "/komp_ac.table_definition.TableDefinition/GetColumnAliasRenameHistory" => { #[allow(non_camel_case_types)] struct GetColumnAliasRenameHistorySvc( diff --git a/server b/server index 5110c89..e290953 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 5110c89efce598888c87f759b4e16462ee48dba3 +Subproject commit e2909537f5693574442914a9dd95d6372b891c86 diff --git a/tui-canvas b/tui-canvas index b7aa87c..38702e4 160000 --- a/tui-canvas +++ b/tui-canvas @@ -1 +1 @@ -Subproject commit b7aa87cf6bb7cd5503288badec6e7decce605702 +Subproject commit 38702e44fa090872cf3bbc147c927081713886bb