diff options
Diffstat (limited to 'uploader/publications/models.py')
-rw-r--r-- | uploader/publications/models.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/uploader/publications/models.py b/uploader/publications/models.py index 2b0339b..b199991 100644 --- a/uploader/publications/models.py +++ b/uploader/publications/models.py @@ -1,6 +1,6 @@ """Module to handle persistence and retrieval of publication to/from MariaDB""" import logging -from typing import Iterable +from typing import Iterable, Optional from MySQLdb.cursors import DictCursor @@ -69,14 +69,6 @@ def update_publications(conn: Connection , publications: tuple[dict, ...]) -> tu return tuple() -def fetch_publications(conn: Connection) -> Iterable[dict]: - """Fetch publications from the database.""" - with conn.cursor(cursorclass=DictCursor) as cursor: - cursor.execute("SELECT * FROM Publication") - for row in cursor.fetchall(): - yield dict(row) - - def fetch_publication_by_id(conn: Connection, publication_id: int) -> dict: """Fetch a specific publication from the database.""" with conn.cursor(cursorclass=DictCursor) as cursor: |