auto recomputation fields are now available

This commit is contained in:
Priec
2026-07-16 00:46:47 +02:00
parent 53c7576872
commit fac1ada024
10 changed files with 23 additions and 9 deletions

2
client

Submodule client updated: cf925ae05b...405182ec8d

View File

@@ -157,6 +157,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
".komp_ac.table_definition.ColumnDefinition", ".komp_ac.table_definition.ColumnDefinition",
"#[derive(serde::Serialize, serde::Deserialize)]", "#[derive(serde::Serialize, serde::Deserialize)]",
) )
.field_attribute(
".komp_ac.table_definition.ColumnDefinition.recompute_on_dependency_change",
"#[serde(default)]",
)
.type_attribute( .type_attribute(
".komp_ac.table_definition.TableLink", ".komp_ac.table_definition.TableLink",
"#[derive(serde::Serialize, serde::Deserialize)]" "#[derive(serde::Serialize, serde::Deserialize)]"

View File

@@ -130,6 +130,10 @@ message ColumnDefinition {
// MONEY rounding applied before a value is stored. // MONEY rounding applied before a value is stored.
MoneyRounding rounding = 4; MoneyRounding rounding = 4;
// When true, the submitted script result is validated normally and the
// stored value is also refreshed when one of its dependencies later changes.
bool recompute_on_dependency_change = 5;
} }
// Response after table creation (success + DDL preview). // Response after table creation (success + DDL preview).

View File

@@ -90,9 +90,6 @@ message PostTableScriptRequest {
// Optional. Free-text description stored alongside the script (no functional effect). // Optional. Free-text description stored alongside the script (no functional effect).
string description = 4; string description = 4;
// When true, changing any referenced field recomputes the target column.
// When false, the script only validates direct writes to its own table.
bool recompute_on_dependency_change = 5;
} }
// Response after creating or updating a script. // Response after creating or updating a script.

View File

@@ -71,4 +71,8 @@ message TableColumn {
// True if the column is part of the table's PRIMARY KEY. // True if the column is part of the table's PRIMARY KEY.
// Typically true for the "id" column created by the system. // Typically true for the "id" column created by the system.
bool is_primary_key = 4; bool is_primary_key = 4;
// True for a user-defined column whose logic should be recomputed whenever
// one of its dependencies changes. False for system and foreign-key columns.
bool recompute_on_dependency_change = 5;
} }

Binary file not shown.

View File

@@ -91,6 +91,11 @@ pub struct ColumnDefinition {
/// MONEY rounding applied before a value is stored. /// MONEY rounding applied before a value is stored.
#[prost(enumeration = "MoneyRounding", tag = "4")] #[prost(enumeration = "MoneyRounding", tag = "4")]
pub rounding: i32, pub rounding: i32,
/// When true, the submitted script result is validated normally and the
/// stored value is also refreshed when one of its dependencies later changes.
#[prost(bool, tag = "5")]
#[serde(default)]
pub recompute_on_dependency_change: bool,
} }
/// Response after table creation (success + DDL preview). /// Response after table creation (success + DDL preview).
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]

View File

@@ -51,10 +51,6 @@ pub struct PostTableScriptRequest {
/// Optional. Free-text description stored alongside the script (no functional effect). /// Optional. Free-text description stored alongside the script (no functional effect).
#[prost(string, tag = "4")] #[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String, pub description: ::prost::alloc::string::String,
/// When true, changing any referenced field recomputes the target column.
/// When false, the script only validates direct writes to its own table.
#[prost(bool, tag = "5")]
pub recompute_on_dependency_change: bool,
} }
/// Response after creating or updating a script. /// Response after creating or updating a script.
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]

View File

@@ -54,6 +54,10 @@ pub struct TableColumn {
/// Typically true for the "id" column created by the system. /// Typically true for the "id" column created by the system.
#[prost(bool, tag = "4")] #[prost(bool, tag = "4")]
pub is_primary_key: bool, pub is_primary_key: bool,
/// True for a user-defined column whose logic should be recomputed whenever
/// one of its dependencies changes. False for system and foreign-key columns.
#[prost(bool, tag = "5")]
pub recompute_on_dependency_change: bool,
} }
/// Generated client implementations. /// Generated client implementations.
pub mod table_structure_service_client { pub mod table_structure_service_client {

2
server

Submodule server updated: 32ec7b1bd7...fe085e6a2c