Merge branch 'Auth'

This commit is contained in:
Anton Kamalov
2024-10-22 21:48:58 +03:00
10 changed files with 99 additions and 63 deletions

View File

@@ -1,6 +1,6 @@
from .DBconnect import DBContextManager
def select_list(db_config, sql):
def select_list(db_config, sql) -> list:
with DBContextManager(db_config) as cursor:
if cursor is None:
raise ValueError("Cursor not created")
@@ -9,4 +9,4 @@ def select_list(db_config, sql):
result = cursor.fetchall()
schema = [item[0] for item in cursor.description]
lst = [dict(zip(schema, row)) for row in result]
return schema, lst
return lst