diff --git a/src/database/get.py b/src/database/get.py index 99242ce..0e1c714 100644 --- a/src/database/get.py +++ b/src/database/get.py @@ -35,8 +35,8 @@ def get_accounts( if to_sort: statement = statement.order_by(models.Account.name) with sqlmodel.Session(engine) as session: - result = list(session.exec(statement)) - return result + result = session.exec(statement).fetchall() + return result def get_all_accounts( @@ -52,16 +52,16 @@ def get_all_accounts( .order_by(models.Account.name) ) with sqlmodel.Session(engine) as session: - result = session.exec(statement) - yield from ( - ( - account.name, - account.salt, - account.enc_login, - account.enc_password, - ) - for account in result + result = session.exec(statement).fetchall() + yield from ( + ( + account.name, + account.salt, + account.enc_login, + account.enc_password, ) + for account in result + ) def get_account_info(