From cb4c5b40a6aa8800581c89a892dc550e7893ac23 Mon Sep 17 00:00:00 2001 From: caetano melone Date: Wed, 21 Feb 2024 22:23:04 -0800 Subject: [PATCH] fix: avoid extraneous select statement in insert_node --- gantry/db/insert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gantry/db/insert.py b/gantry/db/insert.py index 2829256..e4f0923 100644 --- a/gantry/db/insert.py +++ b/gantry/db/insert.py @@ -45,7 +45,7 @@ async def insert_node(db: aiosqlite.Connection, node: dict) -> int: # this check ensures that something was inserted # and not relying on lastrowid, which could be anything if cursor.rowcount > 0: - pk = cursor.lastrowid + return cursor.lastrowid pk = await get_node(db, node["uuid"])