Skip to content

Commit 4373189

Browse files
authored
Fix purge csv tables CLI by using the csv db connection (#294)
1 parent ceefc7a commit 4373189

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

udata_hydra/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,14 @@ async def purge_csv_tables(quiet: bool = False) -> None:
371371
error_count = 0
372372

373373
conn_csv = await connection(db_name="csv")
374+
log.debug(f"{len(tables_to_delete)} tables to delete")
374375
for table in tables_to_delete:
375376
try:
376377
async with conn_main.transaction():
377378
async with conn_csv.transaction():
378379
log.debug(f'Deleting table "{table}"')
379380
await conn_csv.execute(f'DROP TABLE IF EXISTS "{table}"')
380-
await conn_main.execute(
381+
await conn_csv.execute(
381382
"DELETE FROM tables_index WHERE parsing_table = $1", table
382383
)
383384
await conn_main.execute(

0 commit comments

Comments
 (0)