versioning of FK for archiving2

This commit is contained in:
Priec
2026-08-11 22:02:16 +02:00
parent dcc07ee708
commit d53c28c90a
7 changed files with 105 additions and 104 deletions

Binary file not shown.

View File

@@ -133,6 +133,15 @@ pub struct PutTableDataRequest {
#[prost(int64, tag = "5")]
pub expected_revision: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutTableDataConfirmedRequest {
#[prost(message, optional, tag = "1")]
pub update: ::core::option::Option<PutTableDataRequest>,
#[prost(string, repeated, tag = "2")]
pub expected_affected_profiles: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
}
/// Update response.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PutTableDataResponse {
@@ -150,7 +159,7 @@ pub struct PutTableDataResponse {
pub row_revision: i64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GlobalTableUpdateImpactRequest {
pub struct TableUpdateImpactRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
@@ -159,12 +168,12 @@ pub struct GlobalTableUpdateImpactRequest {
pub id: i64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GlobalTableUpdateImpactResponse {
pub struct TableUpdateImpactResponse {
#[prost(string, repeated, tag = "1")]
pub affected_profiles: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ArchiveGlobalTableDataRequest {
pub struct ArchiveTableDataRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
@@ -175,7 +184,7 @@ pub struct ArchiveGlobalTableDataRequest {
pub expected_revision: i64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ArchiveGlobalTableDataResponse {
pub struct ArchiveTableDataResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(int64, tag = "2")]
@@ -226,7 +235,7 @@ pub struct GetTableDataRequest {
pub id: i64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetGlobalTableDataVersionRequest {
pub struct GetTableDataVersionRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
@@ -497,12 +506,10 @@ pub mod tables_data_client {
);
self.inner.unary(req, path, codec).await
}
/// Performs a PUT after the user explicitly accepted its cross-profile impact.
/// This is meaningful only for global tables; ordinary tables behave exactly
/// like PutTableData.
/// Performs a PUT after the user explicitly accepted changing a referenced version.
pub async fn put_table_data_confirmed(
&mut self,
request: impl tonic::IntoRequest<super::PutTableDataRequest>,
request: impl tonic::IntoRequest<super::PutTableDataConfirmedRequest>,
) -> std::result::Result<
tonic::Response<super::PutTableDataResponse>,
tonic::Status,
@@ -529,12 +536,12 @@ pub mod tables_data_client {
);
self.inner.unary(req, path, codec).await
}
/// Lists the other profiles whose rows currently point at this global row.
pub async fn get_global_table_update_impact(
/// Lists profiles whose rows currently point at this row version.
pub async fn get_table_update_impact(
&mut self,
request: impl tonic::IntoRequest<super::GlobalTableUpdateImpactRequest>,
request: impl tonic::IntoRequest<super::TableUpdateImpactRequest>,
) -> std::result::Result<
tonic::Response<super::GlobalTableUpdateImpactResponse>,
tonic::Response<super::TableUpdateImpactResponse>,
tonic::Status,
> {
self.inner
@@ -547,25 +554,25 @@ pub mod tables_data_client {
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.tables_data.TablesData/GetGlobalTableUpdateImpact",
"/komp_ac.tables_data.TablesData/GetTableUpdateImpact",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.tables_data.TablesData",
"GetGlobalTableUpdateImpact",
"GetTableUpdateImpact",
),
);
self.inner.unary(req, path, codec).await
}
/// Snapshots the current version of a global row and advances its version.
/// Snapshots the current version of a row and advances its version.
/// Existing references remain immutable; new references use the new version.
pub async fn archive_global_table_data(
pub async fn archive_table_data(
&mut self,
request: impl tonic::IntoRequest<super::ArchiveGlobalTableDataRequest>,
request: impl tonic::IntoRequest<super::ArchiveTableDataRequest>,
) -> std::result::Result<
tonic::Response<super::ArchiveGlobalTableDataResponse>,
tonic::Response<super::ArchiveTableDataResponse>,
tonic::Status,
> {
self.inner
@@ -578,15 +585,12 @@ pub mod tables_data_client {
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.tables_data.TablesData/ArchiveGlobalTableData",
"/komp_ac.tables_data.TablesData/ArchiveTableData",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.tables_data.TablesData",
"ArchiveGlobalTableData",
),
GrpcMethod::new("komp_ac.tables_data.TablesData", "ArchiveTableData"),
);
self.inner.unary(req, path, codec).await
}
@@ -661,10 +665,10 @@ pub mod tables_data_client {
);
self.inner.unary(req, path, codec).await
}
/// Fetches one exact version of a global row.
pub async fn get_global_table_data_version(
/// Fetches one exact version of a row.
pub async fn get_table_data_version(
&mut self,
request: impl tonic::IntoRequest<super::GetGlobalTableDataVersionRequest>,
request: impl tonic::IntoRequest<super::GetTableDataVersionRequest>,
) -> std::result::Result<
tonic::Response<super::GetTableDataResponse>,
tonic::Status,
@@ -679,14 +683,14 @@ pub mod tables_data_client {
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.tables_data.TablesData/GetGlobalTableDataVersion",
"/komp_ac.tables_data.TablesData/GetTableDataVersion",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.tables_data.TablesData",
"GetGlobalTableDataVersion",
"GetTableDataVersion",
),
);
self.inner.unary(req, path, codec).await
@@ -832,31 +836,29 @@ pub mod tables_data_server {
tonic::Response<super::PutTableDataResponse>,
tonic::Status,
>;
/// Performs a PUT after the user explicitly accepted its cross-profile impact.
/// This is meaningful only for global tables; ordinary tables behave exactly
/// like PutTableData.
/// Performs a PUT after the user explicitly accepted changing a referenced version.
async fn put_table_data_confirmed(
&self,
request: tonic::Request<super::PutTableDataRequest>,
request: tonic::Request<super::PutTableDataConfirmedRequest>,
) -> std::result::Result<
tonic::Response<super::PutTableDataResponse>,
tonic::Status,
>;
/// Lists the other profiles whose rows currently point at this global row.
async fn get_global_table_update_impact(
/// Lists profiles whose rows currently point at this row version.
async fn get_table_update_impact(
&self,
request: tonic::Request<super::GlobalTableUpdateImpactRequest>,
request: tonic::Request<super::TableUpdateImpactRequest>,
) -> std::result::Result<
tonic::Response<super::GlobalTableUpdateImpactResponse>,
tonic::Response<super::TableUpdateImpactResponse>,
tonic::Status,
>;
/// Snapshots the current version of a global row and advances its version.
/// Snapshots the current version of a row and advances its version.
/// Existing references remain immutable; new references use the new version.
async fn archive_global_table_data(
async fn archive_table_data(
&self,
request: tonic::Request<super::ArchiveGlobalTableDataRequest>,
request: tonic::Request<super::ArchiveTableDataRequest>,
) -> std::result::Result<
tonic::Response<super::ArchiveGlobalTableDataResponse>,
tonic::Response<super::ArchiveTableDataResponse>,
tonic::Status,
>;
/// Soft-delete a single record (sets deleted = true) if it exists and is not already deleted.
@@ -892,10 +894,10 @@ pub mod tables_data_server {
tonic::Response<super::GetTableDataResponse>,
tonic::Status,
>;
/// Fetches one exact version of a global row.
async fn get_global_table_data_version(
/// Fetches one exact version of a row.
async fn get_table_data_version(
&self,
request: tonic::Request<super::GetGlobalTableDataVersionRequest>,
request: tonic::Request<super::GetTableDataVersionRequest>,
) -> std::result::Result<
tonic::Response<super::GetTableDataResponse>,
tonic::Status,
@@ -1151,7 +1153,7 @@ pub mod tables_data_server {
struct PutTableDataConfirmedSvc<T: TablesData>(pub Arc<T>);
impl<
T: TablesData,
> tonic::server::UnaryService<super::PutTableDataRequest>
> tonic::server::UnaryService<super::PutTableDataConfirmedRequest>
for PutTableDataConfirmedSvc<T> {
type Response = super::PutTableDataResponse;
type Future = BoxFuture<
@@ -1160,7 +1162,7 @@ pub mod tables_data_server {
>;
fn call(
&mut self,
request: tonic::Request<super::PutTableDataRequest>,
request: tonic::Request<super::PutTableDataConfirmedRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
@@ -1192,30 +1194,25 @@ pub mod tables_data_server {
};
Box::pin(fut)
}
"/komp_ac.tables_data.TablesData/GetGlobalTableUpdateImpact" => {
"/komp_ac.tables_data.TablesData/GetTableUpdateImpact" => {
#[allow(non_camel_case_types)]
struct GetGlobalTableUpdateImpactSvc<T: TablesData>(pub Arc<T>);
struct GetTableUpdateImpactSvc<T: TablesData>(pub Arc<T>);
impl<
T: TablesData,
> tonic::server::UnaryService<super::GlobalTableUpdateImpactRequest>
for GetGlobalTableUpdateImpactSvc<T> {
type Response = super::GlobalTableUpdateImpactResponse;
> tonic::server::UnaryService<super::TableUpdateImpactRequest>
for GetTableUpdateImpactSvc<T> {
type Response = super::TableUpdateImpactResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::GlobalTableUpdateImpactRequest,
>,
request: tonic::Request<super::TableUpdateImpactRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TablesData>::get_global_table_update_impact(
&inner,
request,
)
<T as TablesData>::get_table_update_impact(&inner, request)
.await
};
Box::pin(fut)
@@ -1227,7 +1224,7 @@ pub mod tables_data_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetGlobalTableUpdateImpactSvc(inner);
let method = GetTableUpdateImpactSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
@@ -1243,29 +1240,25 @@ pub mod tables_data_server {
};
Box::pin(fut)
}
"/komp_ac.tables_data.TablesData/ArchiveGlobalTableData" => {
"/komp_ac.tables_data.TablesData/ArchiveTableData" => {
#[allow(non_camel_case_types)]
struct ArchiveGlobalTableDataSvc<T: TablesData>(pub Arc<T>);
struct ArchiveTableDataSvc<T: TablesData>(pub Arc<T>);
impl<
T: TablesData,
> tonic::server::UnaryService<super::ArchiveGlobalTableDataRequest>
for ArchiveGlobalTableDataSvc<T> {
type Response = super::ArchiveGlobalTableDataResponse;
> tonic::server::UnaryService<super::ArchiveTableDataRequest>
for ArchiveTableDataSvc<T> {
type Response = super::ArchiveTableDataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ArchiveGlobalTableDataRequest>,
request: tonic::Request<super::ArchiveTableDataRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TablesData>::archive_global_table_data(
&inner,
request,
)
.await
<T as TablesData>::archive_table_data(&inner, request).await
};
Box::pin(fut)
}
@@ -1276,7 +1269,7 @@ pub mod tables_data_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ArchiveGlobalTableDataSvc(inner);
let method = ArchiveTableDataSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
@@ -1382,14 +1375,13 @@ pub mod tables_data_server {
};
Box::pin(fut)
}
"/komp_ac.tables_data.TablesData/GetGlobalTableDataVersion" => {
"/komp_ac.tables_data.TablesData/GetTableDataVersion" => {
#[allow(non_camel_case_types)]
struct GetGlobalTableDataVersionSvc<T: TablesData>(pub Arc<T>);
struct GetTableDataVersionSvc<T: TablesData>(pub Arc<T>);
impl<
T: TablesData,
> tonic::server::UnaryService<
super::GetGlobalTableDataVersionRequest,
> for GetGlobalTableDataVersionSvc<T> {
> tonic::server::UnaryService<super::GetTableDataVersionRequest>
for GetTableDataVersionSvc<T> {
type Response = super::GetTableDataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
@@ -1397,16 +1389,11 @@ pub mod tables_data_server {
>;
fn call(
&mut self,
request: tonic::Request<
super::GetGlobalTableDataVersionRequest,
>,
request: tonic::Request<super::GetTableDataVersionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TablesData>::get_global_table_data_version(
&inner,
request,
)
<T as TablesData>::get_table_data_version(&inner, request)
.await
};
Box::pin(fut)
@@ -1418,7 +1405,7 @@ pub mod tables_data_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetGlobalTableDataVersionSvc(inner);
let method = GetTableDataVersionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(