From 1a189363b81c92aecf4a65724d92803bcecad239 Mon Sep 17 00:00:00 2001 From: Priec Date: Wed, 15 Jul 2026 18:34:02 +0200 Subject: [PATCH] with index get column dep. removed --- Cargo.toml | 2 +- client | 2 +- common/proto/table_definition.proto | 5 ++--- common/proto/table_script.proto | 14 ++++++++------ common/src/proto/descriptor.bin | Bin 89391 -> 89441 bytes common/src/proto/komp_ac.table_definition.rs | 5 +---- common/src/proto/komp_ac.table_script.rs | 18 ++++++++++-------- server | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 90c0ae8..486616c 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.18" +version = "0.8.23" edition = "2024" license = "GPL-3.0-or-later" authors = ["Filip Priečinský "] diff --git a/client b/client index 3eb0eff..4023272 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 3eb0effba1b074dbc792bd9ceb56849808b15067 +Subproject commit 4023272451240ebf6c8b5c3157181a69332cd727 diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index 6ebc2ea..94d0875 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -126,10 +126,9 @@ message ColumnDefinition { // s ≤ p and p ≥ 1. string field_type = 2; - // Once initially stored, this column can never be changed. - bool immutable = 3; + reserved 3; - // MONEY rounding applied before an immutable value is initially stored. + // MONEY rounding applied before a value is stored. MoneyRounding rounding = 4; } diff --git a/common/proto/table_script.proto b/common/proto/table_script.proto index 587ac53..ea25295 100644 --- a/common/proto/table_script.proto +++ b/common/proto/table_script.proto @@ -24,7 +24,7 @@ service TableScript { // - Validates math operations: prohibits using certain data types in math // - Enforces link constraints for structured table access: // • Allowed always: self-references (same table) - // • Structured access via steel_get_column / steel_get_column_with_index + // • Structured access via steel_get_column // requires an explicit link in table_definition_links // • Raw SQL access via steel_query_sql is permitted (still validated) // - Detects and rejects circular dependencies across all scripts in the schema @@ -67,8 +67,6 @@ message PostTableScriptRequest { // Referencing data: // - Structured table/column access (enforces link constraints): // (steel_get_column "table_name" "column_name") - // (steel_get_column_with_index "table_name" index "column_name") - // • index must be a non-negative integer literal // • self-references are allowed without links // • other tables require an explicit link from the source table // (table_definition_links) or the request fails @@ -87,13 +85,17 @@ message PostTableScriptRequest { // BIGINT, TEXT, BOOLEAN, DATE, TIMESTAMPTZ // // Dependency tracking and cycles: - // - Dependencies are extracted from steel_get_column(_with_index), get-var, + // - Dependencies are extracted from steel_get_column, get-var, // and steel_query_sql and stored in script_dependencies with context // - Cycles across tables are rejected (self-dependency is allowed) string script = 3; // 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. @@ -128,12 +130,12 @@ message StoredTableScript { string script = 4; string description = 5; repeated ScriptDependency dependencies = 6; + bool recompute_on_dependency_change = 7; } message ScriptDependency { string target_table = 1; string dependency_type = 2; string column = 3; - int64 index = 4; - string query_fragment = 5; + string query_fragment = 4; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index f13befb152ef8a5c4c750a136d9fbf876bcf925d..e2bb57027b512114e3c2001b6a2ed66c340e5b7d 100644 GIT binary patch delta 5176 zcma)=dvH|M9mn@~?%kW+yV*Q$Vo1WnOVknwi6~Zwu}m!?1%cLztvV<&fh-|y++cPC z4XxaSBx)W!nj1->gYsx6PB9hO&LHWGh@FucI=-6U-MOz_tXU_ckfLIu_4bzA^W(SG5ookzb z5K}DIj@w}-`fn5g-o;}DsEfqp@>~6q4tKG;uD-b~;Wnk*RJx@#(NJS66Co@)E?*-& zyQrX4qro_FlKn$ln5JVrNukaD_Kv#zCn<708cov_2&&h=(6O+(mxLvCXoF2J<>YCE zO)nKX_D`e&odf=g&ZRX2BqG5O;zo+9xtW5X7@+(Ddp;f(^X)~p#myYikl(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Y~n z?-y23FZ1`SqL<|8eQD|j5V(Mb%gSGxx&bS=Uz)m+WOSuK<>&z#Do5{1fy&Xl!qn-A zK&kJ3P1e8BeilA)Q}DI9^OSN7u9_AM1VupIf&rm;)wEzhC|)%!xRgD;W?C>1sDRoT zKxGYEFd(ScxCPIGGeu>-+aav=a?Iu*COZT!IXB}x%Gj4Knb|yda+e5oFb1725q1qg z=yVBmz;03$SbOEE&Am7F7AU-QuLvuCnOeG6ApDcDwC}rp!g^d#RZ33jsFZtUd9qKS zvHTozK6}tFkI8%M`%xlPo?#4f{UUsp0K$WQfqMwwL46LwWAdISXVyPv9KaY4ig53M zU_2(uD;ByBwYTNkrg?{F$U{#~q~FTVo*a-TwtOS5kv#F#HBpn7qqnW9tMDQ%*+uD9 zBOJUZ?fDw`*Lx*Pm#5oTH~zA{X>n^hn;Q}N&A>K_{q;uuw(QIQ{^`4Hza#27F282% z8ZocxVo_?2eCFAa`5S)y5sgVr!J{&r&NMDg=Nk2kvTMiFI>dLr3rG?@@VA&u+K9|cy#v&XkH`NMl=(d=m=hS>DE0BG+sWm&zrC`)WSGsEk*9L77(UJ8*^5=8PEi0H zMta{sE>N5=KKw@myR~Zcbs-AauT{8H#-Z-`k%z4=(((wh{cv=olIJJCy#{|7umk|S zT@wabz5MMpVUX3s-(G_tvsWrmYjNS$G~VReaFZ}We{C$NG)DNb7EMa?kh<$|ozy%O zSsBOHv!@dI=DCSN9J$?=p<1eQX^0T)b|S*alhy^Hx)oAby9V$nGB_%lO|4r zl={n~o2))WKaLdRsofOStKfa@J3Xe^0bx->>!4(`&j85U7BL zN`W$mmt>g1?KK@M!p&~I>Gwe30vawWuQ&Z3R#4aTzYiRj2%`<=;s^vPpuXGyf{Oo> taB*xvLIJDU;mt9^cZH24^otk>TtKrdAIC, + #[prost(bool, tag = "7")] + pub recompute_on_dependency_change: bool, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScriptDependency { @@ -110,9 +114,7 @@ pub struct ScriptDependency { pub dependency_type: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub column: ::prost::alloc::string::String, - #[prost(int64, tag = "4")] - pub index: i64, - #[prost(string, tag = "5")] + #[prost(string, tag = "4")] pub query_fragment: ::prost::alloc::string::String, } /// Generated client implementations. @@ -229,7 +231,7 @@ pub mod table_script_client { /// * Validates math operations: prohibits using certain data types in math /// * Enforces link constraints for structured table access: /// • Allowed always: self-references (same table) - /// • Structured access via steel_get_column / steel_get_column_with_index + /// • Structured access via steel_get_column /// requires an explicit link in table_definition_links /// • Raw SQL access via steel_query_sql is permitted (still validated) /// * Detects and rejects circular dependencies across all scripts in the schema @@ -328,7 +330,7 @@ pub mod table_script_server { /// * Validates math operations: prohibits using certain data types in math /// * Enforces link constraints for structured table access: /// • Allowed always: self-references (same table) - /// • Structured access via steel_get_column / steel_get_column_with_index + /// • Structured access via steel_get_column /// requires an explicit link in table_definition_links /// • Raw SQL access via steel_query_sql is permitted (still validated) /// * Detects and rejects circular dependencies across all scripts in the schema diff --git a/server b/server index 75ad74a..e826723 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 75ad74a9d8a19fa23e800afcbdcf67bec5582068 +Subproject commit e8267235bc9c066bc879f1c472f0ca32e7d55709