versioning of FK for archiving
This commit is contained in:
@@ -47,6 +47,18 @@ 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);
|
||||
|
||||
// Lists the other profiles whose rows currently point at this global row.
|
||||
rpc GetGlobalTableUpdateImpact(GlobalTableUpdateImpactRequest) returns (GlobalTableUpdateImpactResponse);
|
||||
|
||||
// Snapshots the current version of a global row and advances its version.
|
||||
// Existing references remain immutable; new references use the new version.
|
||||
rpc ArchiveGlobalTableData(ArchiveGlobalTableDataRequest) returns (ArchiveGlobalTableDataResponse);
|
||||
|
||||
// Soft-delete a single record (sets deleted = true) if it exists and is not already deleted.
|
||||
//
|
||||
// Behavior:
|
||||
@@ -68,6 +80,9 @@ 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);
|
||||
|
||||
// Count non-deleted rows in a table.
|
||||
//
|
||||
// Behavior:
|
||||
@@ -214,6 +229,32 @@ message PutTableDataResponse {
|
||||
int64 row_revision = 4;
|
||||
}
|
||||
|
||||
message GlobalTableUpdateImpactRequest {
|
||||
string profile_name = 1;
|
||||
string table_name = 2;
|
||||
int64 id = 3;
|
||||
}
|
||||
|
||||
message GlobalTableUpdateImpactResponse {
|
||||
repeated string affected_profiles = 1;
|
||||
}
|
||||
|
||||
message ArchiveGlobalTableDataRequest {
|
||||
string profile_name = 1;
|
||||
string table_name = 2;
|
||||
int64 id = 3;
|
||||
int64 expected_revision = 4;
|
||||
}
|
||||
|
||||
message ArchiveGlobalTableDataResponse {
|
||||
bool success = 1;
|
||||
int64 archived_version = 2;
|
||||
string archived_at = 3;
|
||||
repeated string affected_profiles = 4;
|
||||
int64 current_version = 5;
|
||||
int64 row_revision = 6;
|
||||
}
|
||||
|
||||
// Soft-delete a single row.
|
||||
message DeleteTableDataRequest {
|
||||
// Required. Profile (schema) name.
|
||||
@@ -245,6 +286,14 @@ message GetTableDataRequest {
|
||||
|
||||
// Required. Id of the row to fetch.
|
||||
int64 id = 3;
|
||||
|
||||
}
|
||||
|
||||
message GetGlobalTableDataVersionRequest {
|
||||
string profile_name = 1;
|
||||
string table_name = 2;
|
||||
int64 id = 3;
|
||||
int64 version = 4;
|
||||
}
|
||||
|
||||
// Row payload: all columns returned as strings.
|
||||
@@ -264,6 +313,9 @@ message GetTableDataResponse {
|
||||
// identified by its id alone.
|
||||
repeated string row_display_values = 2;
|
||||
repeated string row_display_columns = 3;
|
||||
|
||||
// Version paired with each global-link column in this row.
|
||||
map<string, int64> link_versions = 4;
|
||||
}
|
||||
|
||||
// Count non-deleted rows.
|
||||
|
||||
Reference in New Issue
Block a user