Smart curosr for Game Tables

This commit is contained in:
iamBadgers
2026-04-04 19:40:55 -07:00
parent d549f7d83d
commit 917870128d
4 changed files with 52 additions and 45 deletions

View File

@@ -82,11 +82,11 @@ class KeyService:
FROM game_keys
WHERE game_table_id IS NOT NULL""")
rows = smartCursor.fetchall()
return [KeyTable(row[0], row[1]) for row in rows]
def get_free_keys(self, cursor=None) -> KeyTable:
with SmartCursor(cursor, connection) as smartCursor:
with SmartCursor(cursor, self.connection) as smartCursor:
smartCursor.execute("""SELECT key, game_table_id
FROM game_keys
WHERE game_table_id IS NULL""")