From 4fdaa74565305753eafaf615da271312b9f8bf86 Mon Sep 17 00:00:00 2001 From: dal Date: Wed, 23 Apr 2025 11:58:14 -0600 Subject: [PATCH] ok sync job is unique --- .../rest/routes/datasets/deploy_datasets.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api/server/src/routes/rest/routes/datasets/deploy_datasets.rs b/api/server/src/routes/rest/routes/datasets/deploy_datasets.rs index 44a508378..280730e76 100644 --- a/api/server/src/routes/rest/routes/datasets/deploy_datasets.rs +++ b/api/server/src/routes/rest/routes/datasets/deploy_datasets.rs @@ -669,6 +669,30 @@ async fn deploy_datasets_handler( let tbl_name = req.name.clone(); // dataset name is table name here let col_name = col.name.clone(); + // ---- Check for database identifier ---- + if db_name.is_empty() { + error!( + dataset_name = %req.name, + column_name = %col_name, + "Database identifier (`database`) is missing or empty in the request for this dataset. Cannot set up stored values sync job for this column." + ); + // Optionally add a warning to the validation result + if let Some(validation) = results.iter_mut().find(|r| { + r.model_name == req.name + && r.data_source_name == req.data_source_name + }) { + // Add a specific warning/error type if desired + validation.add_error(ValidationError::internal_error(format!( + "Missing database identifier for searchable column '{}'.", + col_name + ))); + // Setting success = false might be too strong, depends on desired behavior. + // validation.success = false; + } + continue; // Skip sync job setup for this column + } + // ---- End Check ---- + info!( %dataset_id, column_name = %col_name,