legacy removed

This commit is contained in:
Filipriec
2026-09-01 12:32:59 +02:00
parent 73092a55f9
commit 494eb890d8
6 changed files with 17 additions and 171 deletions

View File

@@ -55,9 +55,6 @@ service TableDefinition {
// 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);
// Returns the unified append-only history for column and option aliases.
rpc GetAliasChangeHistory(GetAliasChangeHistoryRequest) returns (GetAliasChangeHistoryResponse);
@@ -463,31 +460,6 @@ message CopyProfileResponse {
int32 scripts_copied = 4;
}
// Request to fetch recorded column alias rename history for one profile.
message GetColumnAliasRenameHistoryRequest {
string profile_name = 1;
// Filter. When omitted, returns all tables in the profile.
optional int64 table_definition_id = 2;
}
// One recorded column alias rename.
message ColumnAliasRenameHistoryEntry {
int64 id = 1;
string profile_name = 2;
int64 table_definition_id = 3;
string table_name = 4;
string old_column_name = 5;
string new_column_name = 6;
string created_at = 7;
}
// Response with stored column alias rename history rows.
message GetColumnAliasRenameHistoryResponse {
string profile_name = 1;
repeated ColumnAliasRenameHistoryEntry entries = 2;
}
enum AliasChangeKind {
ALIAS_CHANGE_KIND_UNSPECIFIED = 0;
ALIAS_CHANGE_KIND_COLUMN = 1;

Binary file not shown.

View File

@@ -447,44 +447,6 @@ pub struct CopyProfileResponse {
#[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)]
pub struct GetColumnAliasRenameHistoryRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
/// Filter. When omitted, returns all tables in the profile.
#[prost(int64, optional, tag = "2")]
pub table_definition_id: ::core::option::Option<i64>,
}
/// One recorded column alias rename.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ColumnAliasRenameHistoryEntry {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub profile_name: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub table_definition_id: i64,
#[prost(string, tag = "4")]
pub table_name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub old_column_name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub new_column_name: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub created_at: ::prost::alloc::string::String,
}
/// Response with stored column alias rename history rows.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetColumnAliasRenameHistoryResponse {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<ColumnAliasRenameHistoryEntry>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAliasChangeHistoryRequest {
@@ -1459,36 +1421,6 @@ pub mod table_definition_client {
);
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,
request: impl tonic::IntoRequest<super::GetColumnAliasRenameHistoryRequest>,
) -> std::result::Result<
tonic::Response<super::GetColumnAliasRenameHistoryResponse>,
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/GetColumnAliasRenameHistory",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"GetColumnAliasRenameHistory",
),
);
self.inner.unary(req, path, codec).await
}
/// Returns the unified append-only history for column and option aliases.
pub async fn get_alias_change_history(
&mut self,
@@ -1759,14 +1691,6 @@ pub mod table_definition_server {
tonic::Response<super::CopyProfileResponse>,
tonic::Status,
>;
/// Returns the stored rename history for column aliases in one profile.
async fn get_column_alias_rename_history(
&self,
request: tonic::Request<super::GetColumnAliasRenameHistoryRequest>,
) -> std::result::Result<
tonic::Response<super::GetColumnAliasRenameHistoryResponse>,
tonic::Status,
>;
/// Returns the unified append-only history for column and option aliases.
async fn get_alias_change_history(
&self,
@@ -2423,60 +2347,6 @@ pub mod table_definition_server {
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/GetColumnAliasRenameHistory" => {
#[allow(non_camel_case_types)]
struct GetColumnAliasRenameHistorySvc<T: TableDefinition>(
pub Arc<T>,
);
impl<
T: TableDefinition,
> tonic::server::UnaryService<
super::GetColumnAliasRenameHistoryRequest,
> for GetColumnAliasRenameHistorySvc<T> {
type Response = super::GetColumnAliasRenameHistoryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::GetColumnAliasRenameHistoryRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::get_column_alias_rename_history(
&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 = GetColumnAliasRenameHistorySvc(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/GetAliasChangeHistory" => {
#[allow(non_camel_case_types)]
struct GetAliasChangeHistorySvc<T: TableDefinition>(pub Arc<T>);

View File

@@ -1190,16 +1190,16 @@ impl GrpcClient {
.into_inner())
}
pub async fn get_column_alias_rename_history(
pub async fn get_alias_change_history(
&mut self,
request: common::proto::komp_ac::table_definition::GetColumnAliasRenameHistoryRequest,
) -> Result<common::proto::komp_ac::table_definition::GetColumnAliasRenameHistoryResponse> {
request: common::proto::komp_ac::table_definition::GetAliasChangeHistoryRequest,
) -> Result<common::proto::komp_ac::table_definition::GetAliasChangeHistoryResponse> {
let request = self.authenticated_request(request)?;
Ok(self
.table_definition_client
.get_column_alias_rename_history(request)
.get_alias_change_history(request)
.await
.context("gRPC GetColumnAliasRenameHistory call failed")?
.context("gRPC GetAliasChangeHistory call failed")?
.into_inner())
}

2
server

Submodule server updated: 1804c1dd19...d7f3b28084

View File

@@ -20,8 +20,8 @@ use crate::{
definitions::{
common::Empty,
table_definition::{
GetColumnAliasRenameHistoryRequest, GetProfileDetailsRequest, GetTableCatalogRequest,
MoneyRounding, table_definition_client::TableDefinitionClient,
AliasChangeKind, GetAliasChangeHistoryRequest, GetProfileDetailsRequest,
GetTableCatalogRequest, MoneyRounding, table_definition_client::TableDefinitionClient,
},
},
pages::table_scope,
@@ -249,12 +249,16 @@ pub(crate) async fn load_page(
// The history is per profile; a selected table narrows it to that table.
let history = match inputs.selection.has_profile() {
true => {
let request = GetColumnAliasRenameHistoryRequest {
let request = GetAliasChangeHistoryRequest {
profile_name: inputs.selection.profile.clone(),
table_definition_id: detail.as_ref().map(|detail| detail.id),
column_id: None,
alias_kind: AliasChangeKind::Column as i32,
option_value: None,
limit: 0,
};
definitions
.get_column_alias_rename_history(
.get_alias_change_history(
authenticated_request(headers, request)
.map_err(|_| LoadError::Unauthenticated)?,
)
@@ -265,9 +269,9 @@ pub(crate) async fn load_page(
.into_iter()
.map(|entry| RenameEntry {
table_name: entry.table_name,
old_column_name: entry.old_column_name,
new_column_name: entry.new_column_name,
created_at: entry.created_at,
old_column_name: entry.old_alias.unwrap_or_default(),
new_column_name: entry.new_alias.unwrap_or_default(),
created_at: entry.changed_at,
})
.collect()
}