diff --git a/Cargo.toml b/Cargo.toml index cb49e32..fb5d99d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "3" [workspace.package] # TODO: idk how to do the name, fix later # name = "komp_ac" -version = "0.8.27" +version = "0.8.29" edition = "2024" license = "GPL-3.0-or-later" authors = ["Filip Priečinský "] diff --git a/client b/client index f3b1f0c..25de354 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit f3b1f0c8026f96a90cfa08761d65601ed3026ddb +Subproject commit 25de3543713170e4d847d8487d244feacd68c5cc diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index 2e72c74..dbb3551 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -246,6 +246,19 @@ message TableDetail { repeated ScriptInfo scripts = 4; string base_currency = 5; string row_display_column = 6; + map column_behaviors = 7; +} + +// Server-owned behavior for one logical column returned in table details. +message ColumnBehavior { + // True when the server created the column as a companion of another column. + bool generated = 1; + + // True when clients must display but never submit edits for the column. + bool read_only = 2; + + // Logical source column name, empty for ordinary user-defined columns. + string generated_from = 3; } // A script that targets a specific column in a table. diff --git a/common/proto/table_structure.proto b/common/proto/table_structure.proto index d4a4d84..8def2fc 100644 --- a/common/proto/table_structure.proto +++ b/common/proto/table_structure.proto @@ -75,4 +75,13 @@ message TableColumn { // 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; + + // True when the server created this as a companion of another logical column. + bool generated = 6; + + // True when clients must not submit edits for this column. + bool read_only = 7; + + // Logical source column name, empty for ordinary and system columns. + string generated_from = 8; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index a641411..d379a7f 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 d1b8082..eeab0a0 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -247,6 +247,24 @@ pub struct TableDetail { pub base_currency: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub row_display_column: ::prost::alloc::string::String, + #[prost(map = "string, message", tag = "7")] + pub column_behaviors: ::std::collections::HashMap< + ::prost::alloc::string::String, + ColumnBehavior, + >, +} +/// Server-owned behavior for one logical column returned in table details. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ColumnBehavior { + /// True when the server created the column as a companion of another column. + #[prost(bool, tag = "1")] + pub generated: bool, + /// True when clients must display but never submit edits for the column. + #[prost(bool, tag = "2")] + pub read_only: bool, + /// Logical source column name, empty for ordinary user-defined columns. + #[prost(string, tag = "3")] + pub generated_from: ::prost::alloc::string::String, } /// A script that targets a specific column in a table. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] diff --git a/common/src/proto/komp_ac.table_structure.rs b/common/src/proto/komp_ac.table_structure.rs index 41cdcbb..17af7c3 100644 --- a/common/src/proto/komp_ac.table_structure.rs +++ b/common/src/proto/komp_ac.table_structure.rs @@ -58,6 +58,15 @@ pub struct TableColumn { /// one of its dependencies changes. False for system and foreign-key columns. #[prost(bool, tag = "5")] pub recompute_on_dependency_change: bool, + /// True when the server created this as a companion of another logical column. + #[prost(bool, tag = "6")] + pub generated: bool, + /// True when clients must not submit edits for this column. + #[prost(bool, tag = "7")] + pub read_only: bool, + /// Logical source column name, empty for ordinary and system columns. + #[prost(string, tag = "8")] + pub generated_from: ::prost::alloc::string::String, } /// Generated client implementations. pub mod table_structure_service_client { diff --git a/server b/server index f6ab9e9..8158629 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit f6ab9e951d3548ac349ddc28a0ed1d94c686db3c +Subproject commit 81586299e5babc1e8005ae0478c10c056700dc2b