Auto-update: Tue Jul 30 16:57:13 PDT 2024
This commit is contained in:
parent
482731c96e
commit
23270b559f
1 changed files with 3 additions and 6 deletions
|
@ -720,13 +720,12 @@ class APIConfig(BaseModel):
|
||||||
# Prepare the statement
|
# Prepare the statement
|
||||||
stmt = await conn.prepare(insert_query)
|
stmt = await conn.prepare(insert_query)
|
||||||
|
|
||||||
affected_rows = 0
|
# Convert list of dicts to list of tuples
|
||||||
values_list = [[change[col] for col in columns] for change in changes]
|
values_list = [tuple(change[col] for col in columns) for change in changes]
|
||||||
|
|
||||||
# Use executemany for batch insert
|
# Use executemany for batch insert
|
||||||
result = await stmt.executemany(values_list)
|
result = await stmt.executemany(values_list)
|
||||||
affected_rows = result.split()[-1] if result else 0
|
affected_rows = len(values_list) # Assume all rows were affected
|
||||||
affected_rows = int(affected_rows) if affected_rows.isdigit() else 0
|
|
||||||
|
|
||||||
return affected_rows
|
return affected_rows
|
||||||
|
|
||||||
|
@ -737,8 +736,6 @@ class APIConfig(BaseModel):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def sync_spatial_ref_sys(self, source_conn, dest_conn):
|
async def sync_spatial_ref_sys(self, source_conn, dest_conn):
|
||||||
try:
|
try:
|
||||||
# Get all entries from the source
|
# Get all entries from the source
|
||||||
|
|
Loading…
Reference in a new issue