Compare commits
3 Commits
v0.5.13
...
42181499fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42181499fe | ||
|
|
36249739d3 | ||
|
|
bbd7c29681 |
26
Cargo.lock
generated
26
Cargo.lock
generated
@@ -493,7 +493,7 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "canvas"
|
name = "canvas"
|
||||||
version = "0.5.10"
|
version = "0.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -585,7 +585,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "client"
|
name = "client"
|
||||||
version = "0.5.10"
|
version = "0.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -599,9 +599,12 @@ dependencies = [
|
|||||||
"prost 0.13.5",
|
"prost 0.13.5",
|
||||||
"prost-types 0.13.5",
|
"prost-types 0.13.5",
|
||||||
"ratatui",
|
"ratatui",
|
||||||
|
"regex",
|
||||||
"rstest",
|
"rstest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"steel-core",
|
||||||
|
"steel-decimal",
|
||||||
"strum 0.27.2",
|
"strum 0.27.2",
|
||||||
"strum_macros 0.27.2",
|
"strum_macros 0.27.2",
|
||||||
"time",
|
"time",
|
||||||
@@ -611,7 +614,6 @@ dependencies = [
|
|||||||
"tonic",
|
"tonic",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"tui-textarea",
|
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width 0.2.0",
|
"unicode-width 0.2.0",
|
||||||
"uuid",
|
"uuid",
|
||||||
@@ -638,7 +640,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "common"
|
name = "common"
|
||||||
version = "0.5.10"
|
version = "0.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"prost 0.13.5",
|
"prost 0.13.5",
|
||||||
"prost-build 0.14.1",
|
"prost-build 0.14.1",
|
||||||
@@ -3092,7 +3094,7 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "search"
|
name = "search"
|
||||||
version = "0.5.10"
|
version = "0.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"common",
|
"common",
|
||||||
@@ -3191,7 +3193,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server"
|
name = "server"
|
||||||
version = "0.5.10"
|
version = "0.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
@@ -4411,18 +4413,6 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a"
|
checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tui-textarea"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0a5318dd619ed73c52a9417ad19046724effc1287fb75cdcc4eca1d6ac1acbae"
|
|
||||||
dependencies = [
|
|
||||||
"crossterm",
|
|
||||||
"ratatui",
|
|
||||||
"regex",
|
|
||||||
"unicode-width 0.2.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typed-arena"
|
name = "typed-arena"
|
||||||
version = "2.0.2"
|
version = "2.0.2"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ resolver = "2"
|
|||||||
[workspace.package]
|
[workspace.package]
|
||||||
# TODO: idk how to do the name, fix later
|
# TODO: idk how to do the name, fix later
|
||||||
# name = "komp_ac"
|
# name = "komp_ac"
|
||||||
version = "0.5.10"
|
version = "0.6.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
authors = ["Filip Priečinský <filippriec@gmail.com>"]
|
authors = ["Filip Priečinský <filippriec@gmail.com>"]
|
||||||
|
|||||||
2
canvas
2
canvas
Submodule canvas updated: 172bbdf876...812ac2a428
2
client
2
client
Submodule client updated: 1703a1d045...2494066140
@@ -33,6 +33,15 @@ service TableScript {
|
|||||||
// - UPSERTS into table_scripts on (table_definitions_id, target_column)
|
// - UPSERTS into table_scripts on (table_definitions_id, target_column)
|
||||||
// and saves a normalized dependency list into script_dependencies
|
// and saves a normalized dependency list into script_dependencies
|
||||||
rpc PostTableScript(PostTableScriptRequest) returns (TableScriptResponse);
|
rpc PostTableScript(PostTableScriptRequest) returns (TableScriptResponse);
|
||||||
|
|
||||||
|
// Fetch all stored scripts for a specific table.
|
||||||
|
//
|
||||||
|
// Behavior:
|
||||||
|
// - Resolves the table from (profile_name, table_name)
|
||||||
|
// - Returns the stored, transformed script from table_scripts
|
||||||
|
// - Includes normalized dependency metadata from script_dependencies
|
||||||
|
// - Returns an empty scripts list when the table has no scripts
|
||||||
|
rpc GetTableScripts(GetTableScriptsRequest) returns (GetTableScriptsResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request to create or update a script bound to a specific table and column.
|
// Request to create or update a script bound to a specific table and column.
|
||||||
@@ -99,3 +108,32 @@ message TableScriptResponse {
|
|||||||
// - Warning if many dependencies may affect performance
|
// - Warning if many dependencies may affect performance
|
||||||
string warnings = 2;
|
string warnings = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetTableScriptsRequest {
|
||||||
|
// Required. Profile (schema) name.
|
||||||
|
string profile_name = 1;
|
||||||
|
|
||||||
|
// Required. Table name within the profile.
|
||||||
|
string table_name = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetTableScriptsResponse {
|
||||||
|
repeated StoredTableScript scripts = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StoredTableScript {
|
||||||
|
int64 id = 1;
|
||||||
|
string target_column = 2;
|
||||||
|
string target_column_type = 3;
|
||||||
|
string script = 4;
|
||||||
|
string description = 5;
|
||||||
|
repeated ScriptDependency dependencies = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ScriptDependency {
|
||||||
|
string target_table = 1;
|
||||||
|
string dependency_type = 2;
|
||||||
|
string column = 3;
|
||||||
|
int64 index = 4;
|
||||||
|
string query_fragment = 5;
|
||||||
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -68,6 +68,48 @@ pub struct TableScriptResponse {
|
|||||||
#[prost(string, tag = "2")]
|
#[prost(string, tag = "2")]
|
||||||
pub warnings: ::prost::alloc::string::String,
|
pub warnings: ::prost::alloc::string::String,
|
||||||
}
|
}
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct GetTableScriptsRequest {
|
||||||
|
/// Required. Profile (schema) name.
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub profile_name: ::prost::alloc::string::String,
|
||||||
|
/// Required. Table name within the profile.
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub table_name: ::prost::alloc::string::String,
|
||||||
|
}
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct GetTableScriptsResponse {
|
||||||
|
#[prost(message, repeated, tag = "1")]
|
||||||
|
pub scripts: ::prost::alloc::vec::Vec<StoredTableScript>,
|
||||||
|
}
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct StoredTableScript {
|
||||||
|
#[prost(int64, tag = "1")]
|
||||||
|
pub id: i64,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub target_column: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "3")]
|
||||||
|
pub target_column_type: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "4")]
|
||||||
|
pub script: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "5")]
|
||||||
|
pub description: ::prost::alloc::string::String,
|
||||||
|
#[prost(message, repeated, tag = "6")]
|
||||||
|
pub dependencies: ::prost::alloc::vec::Vec<ScriptDependency>,
|
||||||
|
}
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct ScriptDependency {
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub target_table: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
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")]
|
||||||
|
pub query_fragment: ::prost::alloc::string::String,
|
||||||
|
}
|
||||||
/// Generated client implementations.
|
/// Generated client implementations.
|
||||||
pub mod table_script_client {
|
pub mod table_script_client {
|
||||||
#![allow(
|
#![allow(
|
||||||
@@ -217,6 +259,42 @@ pub mod table_script_client {
|
|||||||
);
|
);
|
||||||
self.inner.unary(req, path, codec).await
|
self.inner.unary(req, path, codec).await
|
||||||
}
|
}
|
||||||
|
/// Fetch all stored scripts for a specific table.
|
||||||
|
///
|
||||||
|
/// Behavior:
|
||||||
|
/// - Resolves the table from (profile_name, table_name)
|
||||||
|
/// - Returns the stored, transformed script from table_scripts
|
||||||
|
/// - Includes normalized dependency metadata from script_dependencies
|
||||||
|
/// - Returns an empty scripts list when the table has no scripts
|
||||||
|
pub async fn get_table_scripts(
|
||||||
|
&mut self,
|
||||||
|
request: impl tonic::IntoRequest<super::GetTableScriptsRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::GetTableScriptsResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
> {
|
||||||
|
self.inner
|
||||||
|
.ready()
|
||||||
|
.await
|
||||||
|
.map_err(|e| {
|
||||||
|
tonic::Status::unknown(
|
||||||
|
format!("Service was not ready: {}", e.into()),
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
let codec = tonic::codec::ProstCodec::default();
|
||||||
|
let path = http::uri::PathAndQuery::from_static(
|
||||||
|
"/komp_ac.table_script.TableScript/GetTableScripts",
|
||||||
|
);
|
||||||
|
let mut req = request.into_request();
|
||||||
|
req.extensions_mut()
|
||||||
|
.insert(
|
||||||
|
GrpcMethod::new(
|
||||||
|
"komp_ac.table_script.TableScript",
|
||||||
|
"GetTableScripts",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
self.inner.unary(req, path, codec).await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Generated server implementations.
|
/// Generated server implementations.
|
||||||
@@ -256,6 +334,20 @@ pub mod table_script_server {
|
|||||||
tonic::Response<super::TableScriptResponse>,
|
tonic::Response<super::TableScriptResponse>,
|
||||||
tonic::Status,
|
tonic::Status,
|
||||||
>;
|
>;
|
||||||
|
/// Fetch all stored scripts for a specific table.
|
||||||
|
///
|
||||||
|
/// Behavior:
|
||||||
|
/// - Resolves the table from (profile_name, table_name)
|
||||||
|
/// - Returns the stored, transformed script from table_scripts
|
||||||
|
/// - Includes normalized dependency metadata from script_dependencies
|
||||||
|
/// - Returns an empty scripts list when the table has no scripts
|
||||||
|
async fn get_table_scripts(
|
||||||
|
&self,
|
||||||
|
request: tonic::Request<super::GetTableScriptsRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::GetTableScriptsResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
}
|
}
|
||||||
/// Manages column-computation scripts for user-defined tables.
|
/// Manages column-computation scripts for user-defined tables.
|
||||||
/// Each script belongs to a single table (table_definition_id) and populates
|
/// Each script belongs to a single table (table_definition_id) and populates
|
||||||
@@ -390,6 +482,51 @@ pub mod table_script_server {
|
|||||||
};
|
};
|
||||||
Box::pin(fut)
|
Box::pin(fut)
|
||||||
}
|
}
|
||||||
|
"/komp_ac.table_script.TableScript/GetTableScripts" => {
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
struct GetTableScriptsSvc<T: TableScript>(pub Arc<T>);
|
||||||
|
impl<
|
||||||
|
T: TableScript,
|
||||||
|
> tonic::server::UnaryService<super::GetTableScriptsRequest>
|
||||||
|
for GetTableScriptsSvc<T> {
|
||||||
|
type Response = super::GetTableScriptsResponse;
|
||||||
|
type Future = BoxFuture<
|
||||||
|
tonic::Response<Self::Response>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
|
fn call(
|
||||||
|
&mut self,
|
||||||
|
request: tonic::Request<super::GetTableScriptsRequest>,
|
||||||
|
) -> Self::Future {
|
||||||
|
let inner = Arc::clone(&self.0);
|
||||||
|
let fut = async move {
|
||||||
|
<T as TableScript>::get_table_scripts(&inner, request).await
|
||||||
|
};
|
||||||
|
Box::pin(fut)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let accept_compression_encodings = self.accept_compression_encodings;
|
||||||
|
let send_compression_encodings = self.send_compression_encodings;
|
||||||
|
let max_decoding_message_size = self.max_decoding_message_size;
|
||||||
|
let max_encoding_message_size = self.max_encoding_message_size;
|
||||||
|
let inner = self.inner.clone();
|
||||||
|
let fut = async move {
|
||||||
|
let method = GetTableScriptsSvc(inner);
|
||||||
|
let codec = tonic::codec::ProstCodec::default();
|
||||||
|
let mut grpc = tonic::server::Grpc::new(codec)
|
||||||
|
.apply_compression_config(
|
||||||
|
accept_compression_encodings,
|
||||||
|
send_compression_encodings,
|
||||||
|
)
|
||||||
|
.apply_max_message_size_config(
|
||||||
|
max_decoding_message_size,
|
||||||
|
max_encoding_message_size,
|
||||||
|
);
|
||||||
|
let res = grpc.unary(method, req).await;
|
||||||
|
Ok(res)
|
||||||
|
};
|
||||||
|
Box::pin(fut)
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
let mut response = http::Response::new(
|
let mut response = http::Response::new(
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: d21e08c823...6b0c3e63b4
Reference in New Issue
Block a user