From 7f931a7d6d380981cb5b969210af16218574e5d7 Mon Sep 17 00:00:00 2001 From: Priec Date: Tue, 11 Aug 2026 23:45:09 +0200 Subject: [PATCH] v archivation7 deleted data --- client | 2 +- common/proto/tables_data.proto | 39 ++++++++++- common/src/proto/descriptor.bin | Bin 162227 -> 164646 bytes common/src/proto/komp_ac.tables_data.rs | 87 +++++++++++++++++++++++- server | 2 +- 5 files changed, 123 insertions(+), 7 deletions(-) diff --git a/client b/client index a7da2562..637eb6a0 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit a7da256200ce1f2b63f7ca6b764f40400a2203cb +Subproject commit 637eb6a04d767bedc459344dad1b4269002e46f6 diff --git a/common/proto/tables_data.proto b/common/proto/tables_data.proto index 7c9d953a..769f1cfa 100644 --- a/common/proto/tables_data.proto +++ b/common/proto/tables_data.proto @@ -299,6 +299,37 @@ message GetTableDataVersionRequest { int64 version = 4; } +// A link resolved exactly as the source row stored it, together with the +// target row's current state. The physical companion version column remains +// an internal implementation detail. +enum ResolvedTableLinkStatus { + CURRENT = 0; + SUPERSEDED = 1; + UNAVAILABLE = 2; + DELETED = 3; +} + +message ResolvedTableLinkVersion { + int64 version = 1; + map data = 2; + repeated string row_display_values = 3; + repeated string row_display_columns = 4; +} + +message ResolvedTableLinkUpdate { + int64 version = 1; + map data = 2; + repeated string row_display_values = 3; + repeated string changed_fields = 4; +} + +message ResolvedTableLink { + int64 id = 1; + ResolvedTableLinkVersion saved = 2; + ResolvedTableLinkStatus status = 3; + ResolvedTableLinkUpdate newer = 4; +} + // Row payload: all columns returned as strings. message GetTableDataResponse { // Map of column_name → stringified value for: @@ -317,8 +348,12 @@ message GetTableDataResponse { repeated string row_display_values = 2; repeated string row_display_columns = 3; - // Version paired with each global-link column in this row. - map link_versions = 4; + // Links keyed by their public column name. Each value contains the row as + // saved by this record and the newest available state of the linked row. + map resolved_links = 4; + + // The generation returned by this response. Zero is never returned. + int64 row_version = 5; } // Count non-deleted rows. diff --git a/common/src/proto/desc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C-$}nor)6>rcwa_<7v?d6WDj<^(DkiBx zma+R=2)1ucX^nGBHhRkaeYZEqU+@>j_=9(x31TC=d6CjeODCSQJ z2-+!%HwCo_UY7zjVH2R=K7b$(kT?*qS#XQh;Y*a{~k>K*_{gYkGl+ zJ2)+m4U)k$O*NdG&wP2ncZs^PA1S(c;q)WsIIi%)aeil)Y`r=%SS}Uh{c9P+xU6$V zVMrIx7shez;zkxP0e=DvT+ZT$z^5oVxU<yNDaRD3bUiUUOXC7{x8kf64qOK(8DU zVgA%$eo)~C=SMvyHWnKFCIG~W?$YuNGAdTEsgu1f?1mZlh%(t8@uVC!Ez|a&1>1B- zY|CHTJMNGW=2R<|g9W{1+7%rmmWlTUg8j_D1*otTr2bh*kqQC#D3%HYs1R_ET9>eP zbXHo6-lx!SUUH09q|!*d&+qGvke236^uYVjqII442IT|7f#OR9MCJpk_iq+JP(Gkc z8+%C0P{_5+NiB$?aE@zv8;fY+O*`+c j8>crm;v0qY(ojGY&QmNQ%m75;Jf+fu(W+f>E1iD<4X#^- delta 864 zcmYk3&1+LZ6vZvyn!Y8}FPvEDy2>OE!-Wkw-jGDwdx-e44M;ij{ILVpz_k|H@Tq&ST=-B8~10 zCJW_y_1WzarPiP1R0gxB=D7KvPByYEDsN>FU{2Z2;78L~K+o`PuW*lWF~@Q9dlqw( z{%agYP`G#DIN09AOgPAdu?z2M{tMhNf^Z0<*<9SjDoYc%iGWca;4U>IZ4+ZLjZTGU z&hoF!w$gM@{(O!vTR|{`0N?{Db1C$j8kH2{f<_A3Ln6sX>>LQA1xyTvpd><_1WIZR zlR!x=h`1J0QVUzjOZQ>e4#-OBVz|+7+-WbCOf59kpB^pE>;=N0Zw)0vEYz+<;2Bx4`m SphhzG5ehH4*Q%9zCG`*KsGHva diff --git a/common/src/proto/komp_ac.tables_data.rs b/common/src/proto/komp_ac.tables_data.rs index efbb92a8..8876d849 100644 --- a/common/src/proto/komp_ac.tables_data.rs +++ b/common/src/proto/komp_ac.tables_data.rs @@ -245,6 +245,45 @@ pub struct GetTableDataVersionRequest { #[prost(int64, tag = "4")] pub version: i64, } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResolvedTableLinkVersion { + #[prost(int64, tag = "1")] + pub version: i64, + #[prost(map = "string, string", tag = "2")] + pub data: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + #[prost(string, repeated, tag = "3")] + pub row_display_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "4")] + pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResolvedTableLinkUpdate { + #[prost(int64, tag = "1")] + pub version: i64, + #[prost(map = "string, string", tag = "2")] + pub data: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + #[prost(string, repeated, tag = "3")] + pub row_display_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "4")] + pub changed_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResolvedTableLink { + #[prost(int64, tag = "1")] + pub id: i64, + #[prost(message, optional, tag = "2")] + pub saved: ::core::option::Option, + #[prost(enumeration = "ResolvedTableLinkStatus", tag = "3")] + pub status: i32, + #[prost(message, optional, tag = "4")] + pub newer: ::core::option::Option, +} /// Row payload: all columns returned as strings. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTableDataResponse { @@ -269,9 +308,16 @@ pub struct GetTableDataResponse { pub row_display_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(string, repeated, tag = "3")] pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Version paired with each global-link column in this row. - #[prost(map = "string, int64", tag = "4")] - pub link_versions: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + /// Links keyed by their public column name. Each value contains the row as + /// saved by this record and the newest available state of the linked row. + #[prost(map = "string, message", tag = "4")] + pub resolved_links: ::std::collections::HashMap< + ::prost::alloc::string::String, + ResolvedTableLink, + >, + /// The generation returned by this response. Zero is never returned. + #[prost(int64, tag = "5")] + pub row_version: i64, } /// Count non-deleted rows. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -296,6 +342,41 @@ pub struct GetTableDataByPositionRequest { #[prost(int32, tag = "3")] pub position: i32, } +/// A link resolved exactly as the source row stored it, together with the +/// target row's current state. The physical companion version column remains +/// an internal implementation detail. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ResolvedTableLinkStatus { + Current = 0, + Superseded = 1, + Unavailable = 2, + Deleted = 3, +} +impl ResolvedTableLinkStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Current => "CURRENT", + Self::Superseded => "SUPERSEDED", + Self::Unavailable => "UNAVAILABLE", + Self::Deleted => "DELETED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CURRENT" => Some(Self::Current), + "SUPERSEDED" => Some(Self::Superseded), + "UNAVAILABLE" => Some(Self::Unavailable), + "DELETED" => Some(Self::Deleted), + _ => None, + } + } +} /// Generated client implementations. pub mod tables_data_client { #![allow( diff --git a/server b/server index d939afd6..e412608d 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit d939afd69c62ecd940526547157b7ce97fb5e239 +Subproject commit e412608da1a6fd9ff1e74b9719df2d39649eb92b