steel decimal crate with a proper setup, needs so much work to be done to be finished
This commit is contained in:
@@ -3,11 +3,11 @@ use tonic::Status;
|
||||
use sqlx::{PgPool, Error as SqlxError};
|
||||
use common::proto::multieko2::table_script::{PostTableScriptRequest, TableScriptResponse};
|
||||
use serde_json::Value;
|
||||
use crate::steel::server::syntax_parser::SyntaxParser;
|
||||
use steel_decimal::SteelDecimal;
|
||||
|
||||
const SYSTEM_COLUMNS: &[&str] = &["id", "deleted", "created_at"];
|
||||
|
||||
// TODO MAKE SCRIPT PUSH ONLY TO THE EMPTY TABLES
|
||||
// TODO MAKE SCRIPT PUSH ONLY TO THE EMPTY TABLES
|
||||
/// Validates the target column and ensures it is not a system column.
|
||||
/// Returns the column type if valid.
|
||||
fn validate_target_column(
|
||||
@@ -68,9 +68,11 @@ pub async fn post_table_script(
|
||||
)
|
||||
.map_err(|e| Status::invalid_argument(e))?;
|
||||
|
||||
// Parse and transform the script using the syntax parser
|
||||
let parser = SyntaxParser::new();
|
||||
let parsed_script = parser.parse(&request.script, &table_def.table_name);
|
||||
// Use the steel_decimal for script transformation
|
||||
let steel_decimal = SteelDecimal::new();
|
||||
|
||||
// Transform the script using steel_decimal (no context needed for basic transformation)
|
||||
let parsed_script = steel_decimal.transform(&request.script);
|
||||
|
||||
// Insert the script into the database
|
||||
let script_record = sqlx::query!(
|
||||
|
||||
Reference in New Issue
Block a user