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

View File

@@ -47,17 +47,15 @@ service TablesData {
// - Updates the row and returns the id; queues search indexing (best effort)
rpc PutTableData(PutTableDataRequest) returns (PutTableDataResponse);
// 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.
rpc PutTableDataConfirmed(PutTableDataRequest) returns (PutTableDataResponse);
// Performs a PUT after the user explicitly accepted changing a referenced version.
rpc PutTableDataConfirmed(PutTableDataConfirmedRequest) returns (PutTableDataResponse);
// Lists the other profiles whose rows currently point at this global row.
rpc GetGlobalTableUpdateImpact(GlobalTableUpdateImpactRequest) returns (GlobalTableUpdateImpactResponse);
// Lists profiles whose rows currently point at this row version.
rpc GetTableUpdateImpact(TableUpdateImpactRequest) returns (TableUpdateImpactResponse);
// 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.
rpc ArchiveGlobalTableData(ArchiveGlobalTableDataRequest) returns (ArchiveGlobalTableDataResponse);
rpc ArchiveTableData(ArchiveTableDataRequest) returns (ArchiveTableDataResponse);
// Soft-delete a single record (sets deleted = true) if it exists and is not already deleted.
//
@@ -80,8 +78,8 @@ service TablesData {
// - If the physical table is missing but the definition exists, returns INTERNAL
rpc GetTableData(GetTableDataRequest) returns (GetTableDataResponse);
// Fetches one exact version of a global row.
rpc GetGlobalTableDataVersion(GetGlobalTableDataVersionRequest) returns (GetTableDataResponse);
// Fetches one exact version of a row.
rpc GetTableDataVersion(GetTableDataVersionRequest) returns (GetTableDataResponse);
// Count non-deleted rows in a table.
//
@@ -214,6 +212,11 @@ message PutTableDataRequest {
int64 expected_revision = 5;
}
message PutTableDataConfirmedRequest {
PutTableDataRequest update = 1;
repeated string expected_affected_profiles = 2;
}
// Update response.
message PutTableDataResponse {
// True if the update succeeded (or no-op on empty data).
@@ -229,24 +232,24 @@ message PutTableDataResponse {
int64 row_revision = 4;
}
message GlobalTableUpdateImpactRequest {
message TableUpdateImpactRequest {
string profile_name = 1;
string table_name = 2;
int64 id = 3;
}
message GlobalTableUpdateImpactResponse {
message TableUpdateImpactResponse {
repeated string affected_profiles = 1;
}
message ArchiveGlobalTableDataRequest {
message ArchiveTableDataRequest {
string profile_name = 1;
string table_name = 2;
int64 id = 3;
int64 expected_revision = 4;
}
message ArchiveGlobalTableDataResponse {
message ArchiveTableDataResponse {
bool success = 1;
int64 archived_version = 2;
string archived_at = 3;
@@ -289,7 +292,7 @@ message GetTableDataRequest {
}
message GetGlobalTableDataVersionRequest {
message GetTableDataVersionRequest {
string profile_name = 1;
string table_name = 2;
int64 id = 3;