reference a value from other linked table

This commit is contained in:
Priec
2026-09-04 23:02:44 +02:00
parent 6689e6c7f9
commit 40e6b6dff3
5 changed files with 42 additions and 14 deletions

View File

@@ -121,9 +121,9 @@ message PostTableDefinitionRequest {
// allowed.
string table_name = 1;
// The table's columns, including its links and stored linked projections.
// A projection uses field_type FROM(link_column.source_column); its physical
// type and money metadata are inferred from the linked source column.
// The table's columns, including its links and stored linked values.
// A linked value uses ColumnDefinition.linked_value; its physical type and
// money metadata are inferred from the linked source column.
repeated ColumnDefinition columns = 3;
// Column names to index, matching names declared above. System columns
@@ -276,7 +276,7 @@ message AddTableColumnsRequest {
string table_name = 2;
// New user-defined columns only. Existing columns cannot be changed here.
// Stored linked projections use field_type FROM(link_column.source_column).
// Stored linked values use ColumnDefinition.linked_value.
repeated ColumnDefinition columns = 3;
// Optional indexes for the new columns only.
@@ -359,9 +359,6 @@ message ColumnDefinition {
// LINK(table) → BIGINT referencing that table in the same profile, indexed
// automatically. A table may hold several links to the same
// target as long as the columns are named differently.
// FROM(link.source) → stored, read-only copy of an atomic column reached
// through another column in this definition whose type is
// LINK(...). SQL type and money metadata are inferred.
string field_type = 2;
// MONEY rounding applied before a value is stored.
@@ -381,6 +378,19 @@ message ColumnDefinition {
// Enables a Boolean ledger on Boolean columns. ANY means
// one true contribution wins; ALL means one false contribution wins.
BooleanLedgerOperator boolean_ledger = 7;
// Defines this named column as a stored, read-only value copied through an
// existing LINK column. field_type and money metadata are inferred from the
// source column and must not be supplied by the caller.
optional LinkedValueDefinition linked_value = 8;
}
message LinkedValueDefinition {
// Exact display name of a LINK column in the table being defined.
string link_column = 1;
// Exact display name of an atomic column in the linked table.
string source_column = 2;
}
enum BooleanLedgerOperator {