migration of the profile from the previous year
This commit is contained in:
2
client
2
client
Submodule client updated: a2e1881ca6...4d45b25c75
@@ -173,6 +173,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
".komp_ac.table_definition.TableDefinitionResponse",
|
".komp_ac.table_definition.TableDefinitionResponse",
|
||||||
"#[derive(serde::Serialize, serde::Deserialize)]"
|
"#[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(
|
.type_attribute(
|
||||||
".komp_ac.table_definition.GetColumnAliasRenameHistoryRequest",
|
".komp_ac.table_definition.GetColumnAliasRenameHistoryRequest",
|
||||||
"#[derive(serde::Serialize, serde::Deserialize)]"
|
"#[derive(serde::Serialize, serde::Deserialize)]"
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ service TableDefinition {
|
|||||||
// Pure data retrieval - no business logic.
|
// Pure data retrieval - no business logic.
|
||||||
rpc GetProfileDetails(GetProfileDetailsRequest) returns (GetProfileDetailsResponse);
|
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.
|
// Returns the stored rename history for column aliases in one profile.
|
||||||
rpc GetColumnAliasRenameHistory(GetColumnAliasRenameHistoryRequest) returns (GetColumnAliasRenameHistoryResponse);
|
rpc GetColumnAliasRenameHistory(GetColumnAliasRenameHistoryRequest) returns (GetColumnAliasRenameHistoryResponse);
|
||||||
|
|
||||||
@@ -160,6 +163,21 @@ message GetProfileDetailsResponse {
|
|||||||
repeated TableDetail tables = 2;
|
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.
|
// Request to fetch recorded column alias rename history for one profile.
|
||||||
message GetColumnAliasRenameHistoryRequest {
|
message GetColumnAliasRenameHistoryRequest {
|
||||||
string profile_name = 1;
|
string profile_name = 1;
|
||||||
|
|||||||
Binary file not shown.
@@ -142,6 +142,30 @@ pub struct GetProfileDetailsResponse {
|
|||||||
#[prost(message, repeated, tag = "2")]
|
#[prost(message, repeated, tag = "2")]
|
||||||
pub tables: ::prost::alloc::vec::Vec<TableDetail>,
|
pub tables: ::prost::alloc::vec::Vec<TableDetail>,
|
||||||
}
|
}
|
||||||
|
/// 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.
|
/// Request to fetch recorded column alias rename history for one profile.
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
@@ -469,6 +493,36 @@ pub mod table_definition_client {
|
|||||||
);
|
);
|
||||||
self.inner.unary(req, path, codec).await
|
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<super::CopyProfileRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::CopyProfileResponse>,
|
||||||
|
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.
|
/// Returns the stored rename history for column aliases in one profile.
|
||||||
pub async fn get_column_alias_rename_history(
|
pub async fn get_column_alias_rename_history(
|
||||||
&mut self,
|
&mut self,
|
||||||
@@ -611,6 +665,14 @@ pub mod table_definition_server {
|
|||||||
tonic::Response<super::GetProfileDetailsResponse>,
|
tonic::Response<super::GetProfileDetailsResponse>,
|
||||||
tonic::Status,
|
tonic::Status,
|
||||||
>;
|
>;
|
||||||
|
/// Copies one complete profile into a new profile without copying table data.
|
||||||
|
async fn copy_profile(
|
||||||
|
&self,
|
||||||
|
request: tonic::Request<super::CopyProfileRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::CopyProfileResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
/// Returns the stored rename history for column aliases in one profile.
|
/// Returns the stored rename history for column aliases in one profile.
|
||||||
async fn get_column_alias_rename_history(
|
async fn get_column_alias_rename_history(
|
||||||
&self,
|
&self,
|
||||||
@@ -903,6 +965,51 @@ pub mod table_definition_server {
|
|||||||
};
|
};
|
||||||
Box::pin(fut)
|
Box::pin(fut)
|
||||||
}
|
}
|
||||||
|
"/komp_ac.table_definition.TableDefinition/CopyProfile" => {
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
struct CopyProfileSvc<T: TableDefinition>(pub Arc<T>);
|
||||||
|
impl<
|
||||||
|
T: TableDefinition,
|
||||||
|
> tonic::server::UnaryService<super::CopyProfileRequest>
|
||||||
|
for CopyProfileSvc<T> {
|
||||||
|
type Response = super::CopyProfileResponse;
|
||||||
|
type Future = BoxFuture<
|
||||||
|
tonic::Response<Self::Response>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
|
fn call(
|
||||||
|
&mut self,
|
||||||
|
request: tonic::Request<super::CopyProfileRequest>,
|
||||||
|
) -> Self::Future {
|
||||||
|
let inner = Arc::clone(&self.0);
|
||||||
|
let fut = async move {
|
||||||
|
<T as TableDefinition>::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" => {
|
"/komp_ac.table_definition.TableDefinition/GetColumnAliasRenameHistory" => {
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
struct GetColumnAliasRenameHistorySvc<T: TableDefinition>(
|
struct GetColumnAliasRenameHistorySvc<T: TableDefinition>(
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: 5110c89efc...e2909537f5
Submodule tui-canvas updated: b7aa87cf6b...38702e44fa
Reference in New Issue
Block a user