diff --git a/client b/client index cf925ae..405182e 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit cf925ae05b44c9588067de5375a5204687fbf042 +Subproject commit 405182ec8d2b7a54e1ecb0bba2041d9e0a482155 diff --git a/common/build.rs b/common/build.rs index 9885bfc..a58bd0d 100644 --- a/common/build.rs +++ b/common/build.rs @@ -157,6 +157,10 @@ fn main() -> Result<(), Box> { ".komp_ac.table_definition.ColumnDefinition", "#[derive(serde::Serialize, serde::Deserialize)]", ) + .field_attribute( + ".komp_ac.table_definition.ColumnDefinition.recompute_on_dependency_change", + "#[serde(default)]", + ) .type_attribute( ".komp_ac.table_definition.TableLink", "#[derive(serde::Serialize, serde::Deserialize)]" diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index 94d0875..a731c5b 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -130,6 +130,10 @@ message ColumnDefinition { // MONEY rounding applied before a value is stored. 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). diff --git a/common/proto/table_script.proto b/common/proto/table_script.proto index 0c00dfe..0bf8c3c 100644 --- a/common/proto/table_script.proto +++ b/common/proto/table_script.proto @@ -90,9 +90,6 @@ message PostTableScriptRequest { // Optional. Free-text description stored alongside the script (no functional effect). 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. diff --git a/common/proto/table_structure.proto b/common/proto/table_structure.proto index 6cf493e..dd03a78 100644 --- a/common/proto/table_structure.proto +++ b/common/proto/table_structure.proto @@ -71,4 +71,8 @@ message TableColumn { // True if the column is part of the table's PRIMARY KEY. // Typically true for the "id" column created by the system. 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; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 4699519..43579ec 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.table_definition.rs b/common/src/proto/komp_ac.table_definition.rs index e2d8800..9883b21 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -91,6 +91,11 @@ pub struct ColumnDefinition { /// MONEY rounding applied before a value is stored. #[prost(enumeration = "MoneyRounding", tag = "4")] 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). #[derive(serde::Serialize, serde::Deserialize)] diff --git a/common/src/proto/komp_ac.table_script.rs b/common/src/proto/komp_ac.table_script.rs index c32c084..105e0a0 100644 --- a/common/src/proto/komp_ac.table_script.rs +++ b/common/src/proto/komp_ac.table_script.rs @@ -51,10 +51,6 @@ pub struct PostTableScriptRequest { /// Optional. Free-text description stored alongside the script (no functional effect). #[prost(string, tag = "4")] 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. #[derive(serde::Serialize, serde::Deserialize)] diff --git a/common/src/proto/komp_ac.table_structure.rs b/common/src/proto/komp_ac.table_structure.rs index 06be372..de44aaf 100644 --- a/common/src/proto/komp_ac.table_structure.rs +++ b/common/src/proto/komp_ac.table_structure.rs @@ -54,6 +54,10 @@ pub struct TableColumn { /// Typically true for the "id" column created by the system. #[prost(bool, tag = "4")] 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. pub mod table_structure_service_client { diff --git a/server b/server index 32ec7b1..fe085e6 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 32ec7b1bd74c7a3eb4f6e244292d44d68893ce75 +Subproject commit fe085e6a2c2e5eb3068c21b7b7e4f8da91a72691