@@ -368,13 +368,13 @@ async def create_embedding(
368368 await db .query_raw (
369369 f"""
370370 UPDATE { vector_store_table }
371- SET file_counts = jsonb_set(
372- COALESCE(file_counts, '{{"in_progress": 0, "completed": 0, "failed": 0, "cancelled": 0, "total": 0}}'::jsonb),
373- '{{completed}}',
374- (COALESCE(file_counts->>'completed', '0')::int + 1)::text::jsonb
375- ),
371+ SET
376372 file_counts = jsonb_set(
377- file_counts,
373+ jsonb_set(
374+ COALESCE(file_counts, '{{"in_progress": 0, "completed": 0, "failed": 0, "cancelled": 0, "total": 0}}'::jsonb),
375+ '{{completed}}',
376+ (COALESCE(file_counts->>'completed', '0')::int + 1)::text::jsonb
377+ ),
378378 '{{total}}',
379379 (COALESCE(file_counts->>'total', '0')::int + 1)::text::jsonb
380380 ),
@@ -468,13 +468,13 @@ async def create_embeddings_batch(
468468 await db .query_raw (
469469 f"""
470470 UPDATE { vector_store_table }
471- SET file_counts = jsonb_set(
472- COALESCE(file_counts, '{{"in_progress": 0, "completed": 0, "failed": 0, "cancelled": 0, "total": 0}}'::jsonb),
473- '{{completed}}',
474- (COALESCE(file_counts->>'completed', '0')::int + $2)::text::jsonb
475- ),
471+ SET
476472 file_counts = jsonb_set(
477- file_counts,
473+ jsonb_set(
474+ COALESCE(file_counts, '{{"in_progress": 0, "completed": 0, "failed": 0, "cancelled": 0, "total": 0}}'::jsonb),
475+ '{{completed}}',
476+ (COALESCE(file_counts->>'completed', '0')::int + $2)::text::jsonb
477+ ),
478478 '{{total}}',
479479 (COALESCE(file_counts->>'total', '0')::int + $2)::text::jsonb
480480 ),
0 commit comments