From b765a3684c1346941a5d88bad1675459044956fc Mon Sep 17 00:00:00 2001 From: Priec Date: Thu, 16 Jul 2026 18:41:26 +0200 Subject: [PATCH] refering different tables that are not directly FK --- client | 2 +- common/proto/table_script.proto | 9 +++++++++ common/src/proto/descriptor.bin | Bin 96812 -> 97439 bytes common/src/proto/komp_ac.table_script.rs | 11 +++++++++++ server | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/client b/client index 643795a..6da324a 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 643795ac6f9dff97bd9595b344b0d659bb4c6c37 +Subproject commit 6da324a924df6c2a4917c2085e83816e9b464702 diff --git a/common/proto/table_script.proto b/common/proto/table_script.proto index 2d5a71f..7cb680a 100644 --- a/common/proto/table_script.proto +++ b/common/proto/table_script.proto @@ -70,6 +70,12 @@ message PostTableScriptRequest { // • current-table references are read directly from the active row // • other tables require an explicit link from the source table // (table_definition_links) or the request fails + // - Related collections use allowlisted aggregate shorthand: + // @sum(table.column), @min(table.column), @max(table.column), + // @count(table.column), @count_distinct(table.column), + // @any(table.boolean), @all(table.boolean), + // @count_rows(table), @exists(table) + // The related table must be a direct child or share exactly one parent. // - Raw SQL access is not supported; steel_query_sql is rejected // // Math operations: @@ -130,4 +136,7 @@ message ScriptDependency { string column = 3; // Deprecated legacy field. Raw SQL dependencies are no longer produced. string query_fragment = 4; + string operation = 5; + // Relationship table used to match the owner row to the related collection. + string via_table = 6; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index a79f34bc39455531c4ad27dda2921575013531e7..d1740074aed2bf2c4028e8b49ef9853f47fc8e02 100644 GIT binary patch delta 1823 zcmZWqO=ufe5Y~J9R@OenX|wTM z&WeBes+wDA`Tw^$YbR`4B7w|YJ?QxH32$ayXrP9cUq9&{ z0YN8Q2!n1!A$L8ODt6b9MjL?h&|6Jcg;{^}6V*y5iq#^zqZ+Lc?Naq-%WJ40L}#4P zRqmQokG*>;@Lko0!H;M9Pksye^le^}r=&^kXXwB6N{$R5`>b5lqXC%j-8gJa&kw>4 zgwIz;cpM-cB`nu18eg|N;0g^yV( zkM0jK3j=vDbo|LPMFuBEfPkhuGF_HaV3;OmdrD zxtb{;vwTz z%>#leU@3=)eaNtyRKCd*Ob!^!NslwpX7PyebD0;jBbakBJV2|GdqI7~YP4cR#jj+S zVGgM<#z!!xlJG9WBr-3ky9}d{?`baJUT^)+_mjP23T7wvm^GeJFg(C2tpH_1+xHpI zooEQbJR2Q}eP-Di74rie9g`nwDq;^nt-h;n(v_pz-)yxNow~%Oe}RUI1GVDB^`?q( z3xlrjh60v@6n%4NCVg-Ep}u}5X=@RsY3c`Vw9=hWT)QZQLJ5fdAQEY%Nt#6ZTI@e~ z3lXV;YZuDfxhzz1rQo7iE9%mPf*^`J&&-?2?wxnfId|sVJ5T?~=fCBP&-=7DlYH49 z;%qPebMPd7_xeZh>!RukCG&QZgEz-MTS%V0pW`PFeI4)ItRTJ3|KnXjNuVAt4Od=EPBiF>d|c9 zqMuhKI56@;UXEWLEliiG%V_Wm4rO0C1c!2OpL#@wkJ?glfL4d=0e|N)gM=v;6u7^m#(0{6&|s6&B>{kJ zvm?`CZQ6Z9O*64?=_wIbld_R*C!lL~bUKEnT|7Yox+WGc)q&We3sxrK(z1~Yl8C(3 z?M^9S(i$x|CQMq>=dB5dZ7QM^Nd%UGXPYvXnSrj|b*k2tJi!UK%5dIu+?E? MfVq6K@@?kvf7JMXga7~l diff --git a/common/src/proto/komp_ac.table_script.rs b/common/src/proto/komp_ac.table_script.rs index f190859..ca5cd46 100644 --- a/common/src/proto/komp_ac.table_script.rs +++ b/common/src/proto/komp_ac.table_script.rs @@ -29,6 +29,12 @@ pub struct PostTableScriptRequest { /// • current-table references are read directly from the active row /// • other tables require an explicit link from the source table /// (table_definition_links) or the request fails + /// * Related collections use allowlisted aggregate shorthand: + /// @sum(table.column), @min(table.column), @max(table.column), + /// @count(table.column), @count_distinct(table.column), + /// @any(table.boolean), @all(table.boolean), + /// @count_rows(table), @exists(table) + /// The related table must be a direct child or share exactly one parent. /// * Raw SQL access is not supported; steel_query_sql is rejected /// /// Math operations: @@ -107,6 +113,11 @@ pub struct ScriptDependency { /// Deprecated legacy field. Raw SQL dependencies are no longer produced. #[prost(string, tag = "4")] pub query_fragment: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub operation: ::prost::alloc::string::String, + /// Relationship table used to match the owner row to the related collection. + #[prost(string, tag = "6")] + pub via_table: ::prost::alloc::string::String, } /// Generated client implementations. pub mod table_script_client { diff --git a/server b/server index 37f329a..1bbb78b 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 37f329a2b20a569c5cb3cfc6f01c1f790d3631a9 +Subproject commit 1bbb78b494af32a13b6ab039d635df1cdae3cf6e