fixed errant method name refactor, added docstrings
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
from typing import Callable
|
||||
|
||||
from icecream import ic
|
||||
|
||||
from app.db.conn import connect_db
|
||||
|
||||
|
||||
class BaseQueries:
|
||||
from icecream import ic
|
||||
"""
|
||||
Base class for all query classes.
|
||||
This class provides a connection to the database.
|
||||
|
||||
Should not be used directly; instead, inherit from this class and provide the table name.
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.table: str = None # type: ignore
|
||||
@@ -20,7 +27,7 @@ class BaseQueries:
|
||||
db.close()
|
||||
return data # type: ignore
|
||||
|
||||
async def select_one_series_by_id(self, id: int) -> dict | None:
|
||||
async def select_one_by_id(self, id: int) -> dict | None:
|
||||
query = f"SELECT * FROM {self.table} WHERE id = %s"
|
||||
db = self.connect_db()
|
||||
cursor = db.cursor(dictionary=True)
|
||||
|
||||
Reference in New Issue
Block a user