Auto-update: Tue Jul 30 16:45:22 PDT 2024
This commit is contained in:
parent
8d3383dc9b
commit
b2a71a3dc5
1 changed files with 3 additions and 4 deletions
|
@ -503,7 +503,6 @@ class APIConfig(BaseModel):
|
|||
|
||||
|
||||
|
||||
|
||||
async def ensure_sync_trigger(self, conn, table_name):
|
||||
await conn.execute(f"""
|
||||
CREATE OR REPLACE FUNCTION update_version_and_server_id()
|
||||
|
@ -683,7 +682,6 @@ class APIConfig(BaseModel):
|
|||
return total_changes
|
||||
|
||||
|
||||
|
||||
async def apply_batch_changes(self, conn, table_name, changes, has_primary_key):
|
||||
if not changes:
|
||||
return 0
|
||||
|
@ -718,10 +716,10 @@ class APIConfig(BaseModel):
|
|||
debug(f"Generated insert query for {table_name}: {insert_query}")
|
||||
|
||||
affected_rows = 0
|
||||
async for change in tqdm(changes, desc=f"Syncing {table_name}", unit="row"):
|
||||
for change in tqdm(changes, desc=f"Syncing {table_name}", unit="row"):
|
||||
values = [change[col] for col in columns]
|
||||
debug(f"Executing query for {table_name} with values: {values}")
|
||||
result = await conn.execute(insert_query, *values)
|
||||
result = await conn.execute(insert_query, *values) # Pass values as separate arguments
|
||||
affected_rows += int(result.split()[-1])
|
||||
|
||||
return affected_rows
|
||||
|
@ -733,6 +731,7 @@ class APIConfig(BaseModel):
|
|||
|
||||
|
||||
|
||||
|
||||
async def sync_spatial_ref_sys(self, source_conn, dest_conn):
|
||||
try:
|
||||
# Get all entries from the source
|
||||
|
|
Loading…
Reference in a new issue