aliasing now move column position also

This commit is contained in:
Priec
2026-08-14 21:23:14 +02:00
parent 5792a1f533
commit c3f5046c85
17 changed files with 164 additions and 86 deletions

View File

@@ -45,8 +45,9 @@ service TableDefinition {
// Returns the stored rename history for column aliases in one profile.
rpc GetColumnAliasRenameHistory(GetColumnAliasRenameHistoryRequest) returns (GetColumnAliasRenameHistoryResponse);
// Renames a user-visible column alias while keeping the physical column unchanged.
rpc RenameColumnAlias(RenameColumnAliasRequest) returns (RenameColumnAliasResponse);
// Atomically replaces the aliases and presentation order of a table's columns.
// Physical column names and identities remain unchanged.
rpc SetColumnPresentation(SetColumnPresentationRequest) returns (SetColumnPresentationResponse);
// Drops a table and its metadata, then deletes the profile if it becomes empty.
rpc DeleteTable(DeleteTableRequest) returns (DeleteTableResponse);
@@ -106,12 +107,12 @@ message PostTableDefinitionRequest {
// is required to be named after its own type, and what it expands into is the
// backend's to decide. The name is only ever a display name over a physical
// column, though, so it is free to be anything: this is where that choice is
// made, instead of a RenameColumnAlias call afterwards.
// made, instead of a SetColumnPresentation call afterwards.
//
// ACCOUNTING, PHONE and IBAN generated columns may be renamed: their
// relationships are recorded by physical column, so the rest of the system can
// find them without knowing their display names. ACCOUNTING_TRANSFER connectors
// are the exception and are refused here exactly as RenameColumnAlias refuses
// are the exception and are refused here exactly as SetColumnPresentation refuses
// them.
message GeneratedColumnAlias {
// The name the backend would otherwise give the column: one of ACCOUNTING's
@@ -389,6 +390,9 @@ message ColumnBehavior {
// True when clients may offer this column in an alias rename picker.
bool renameable = 4;
// Stable public identity used when updating this column's presentation.
int64 column_id = 5;
}
// A script that targets a specific column in a table.
@@ -400,18 +404,25 @@ message ScriptInfo {
string description = 5;
}
// Request to rename one user-visible column alias in a table.
message RenameColumnAliasRequest {
string profile_name = 1;
string table_name = 2;
string old_column_name = 3;
string new_column_name = 4;
// One column's desired public presentation. Its position in the containing
// repeated field is its presentation order.
message ColumnPresentation {
// Stable public identity of the table_definition_columns row.
int64 column_id = 1;
string alias = 2;
}
// Response after renaming one column alias.
message RenameColumnAliasResponse {
// Atomically replaces every user-visible column alias and their order.
message SetColumnPresentationRequest {
string profile_name = 1;
string table_name = 2;
repeated ColumnPresentation columns = 3;
}
message SetColumnPresentationResponse {
bool success = 1;
string message = 2;
repeated ColumnPresentation columns = 3;
}
// Request to delete one table definition entirely.