Auto-update: Tue Jul 30 16:57:13 PDT 2024

This commit is contained in:
sanj 2024-07-30 16:57:14 -07:00
parent 482731c96e
commit 23270b559f

View file

@ -720,13 +720,12 @@ class APIConfig(BaseModel):
# Prepare the statement
stmt = await conn.prepare(insert_query)
affected_rows = 0
values_list = [[change[col] for col in columns] for change in changes]
# Convert list of dicts to list of tuples
values_list = [tuple(change[col] for col in columns) for change in changes]
# Use executemany for batch insert
result = await stmt.executemany(values_list)
affected_rows = result.split()[-1] if result else 0
affected_rows = int(affected_rows) if affected_rows.isdigit() else 0
affected_rows = len(values_list) # Assume all rows were affected
return affected_rows
@ -737,8 +736,6 @@ class APIConfig(BaseModel):
async def sync_spatial_ref_sys(self, source_conn, dest_conn):
try:
# Get all entries from the source