Remove with sqldb in SQL Select

This commit is contained in:
Donald Zou 2024-12-30 20:31:24 +08:00
parent e0bc6a10d0
commit bf6f58eb5e

View File

@ -1638,13 +1638,13 @@ sqldb.isolation_level = None
cursor = sqldb.cursor() cursor = sqldb.cursor()
def sqlSelect(statement: str, paramters: tuple = ()) -> sqlite3.Cursor: def sqlSelect(statement: str, paramters: tuple = ()) -> sqlite3.Cursor:
with sqldb: try:
try: cursor = sqldb.cursor()
cursor = sqldb.cursor() return cursor.execute(statement, paramters)
return cursor.execute(statement, paramters) except Exception as e:
except Exception as e: print("[WGDashboard] SQLite Error:" + str(error) + " | Statement: " + statement)
print("[WGDashboard] SQLite Error:" + str(error) + " | Statement: " + statement) return []
return []
def sqlUpdate(statement: str, paramters: tuple = ()) -> sqlite3.Cursor: def sqlUpdate(statement: str, paramters: tuple = ()) -> sqlite3.Cursor: