From 469fd620a331d3b66ad8400a261e6494dbf63519 Mon Sep 17 00:00:00 2001 From: dal Date: Thu, 24 Apr 2025 11:48:22 -0600 Subject: [PATCH] sync job fix --- api/libs/stored_values/src/jobs.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/libs/stored_values/src/jobs.rs b/api/libs/stored_values/src/jobs.rs index aba8838f4..6c4325d3d 100644 --- a/api/libs/stored_values/src/jobs.rs +++ b/api/libs/stored_values/src/jobs.rs @@ -171,11 +171,12 @@ pub async fn sync_distinct_values_chunk( loop { let distinct_sql = format!( - "SELECT DISTINCT {q}{col}{q} FROM {q}{schema}{q}.{q}{table}{q} ORDER BY 1 NULLS LAST LIMIT {limit} OFFSET {offset}", + "SELECT DISTINCT {q}{col}{q} FROM {q}{db}{q}.{q}{schema}{q}.{q}{table}{q} ORDER BY 1 NULLS LAST LIMIT {limit} OFFSET {offset}", q = quote, - col = q(&column_name), - schema = q(&schema_name), - table = q(&table_name), + col = q(&column_name.to_uppercase()), + db = q(&database_name.to_uppercase()), + schema = q(&schema_name.to_uppercase()), + table = q(&table_name.to_uppercase()), limit = SYNC_CHUNK_LIMIT, offset = offset );