compiled, needs further progress
This commit is contained in:
@@ -5,6 +5,10 @@ use common::proto::multieko2::table_script::{PostTableScriptRequest, TableScript
|
||||
use crate::steel::validation::script::validate_script;
|
||||
use serde_json::Value;
|
||||
|
||||
// Add these imports for the execution module and ScriptOperation
|
||||
use crate::steel::handlers::execution;
|
||||
use crate::steel::handlers::ScriptOperation;
|
||||
|
||||
const SYSTEM_COLUMNS: &[&str] = &["id", "deleted", "created_at"];
|
||||
|
||||
fn validate_target_column(
|
||||
@@ -51,6 +55,15 @@ pub async fn post_table_script(
|
||||
.map_err(|e| Status::internal(format!("Database error: {}", e)))?
|
||||
.ok_or_else(|| Status::not_found("Table definition not found"))?;
|
||||
|
||||
// Use the full path to parse_script
|
||||
let operation = execution::parse_script(&request.script, &request.target_column)
|
||||
.map_err(|e| Status::invalid_argument(e.to_string()))?;
|
||||
|
||||
// Ensure the operation is valid (additional checks if needed)
|
||||
match operation {
|
||||
ScriptOperation::SetToColumn { .. } => {}, // Use directly without 'execution::'
|
||||
}
|
||||
|
||||
// Call validation functions
|
||||
validate_script(&request.script)
|
||||
.map_err(|e| Status::invalid_argument(e.to_string()))?;
|
||||
|
||||
Reference in New Issue
Block a user