recopytex/backend/repository/tribe_sqlite_repository.py

30 lines
694 B
Python
Raw Normal View History

2022-12-26 17:07:23 +00:00
from backend.model.tribe import Tribe
from backend.repository.abstract_repository import AbstractRepository
class TribeSQLiteRepository(AbstractRepository):
def __init__(self, conn) -> None:
self.conn = conn
def add(self, tribe: Tribe) -> None:
pass
def update(self, name: str, tribe: Tribe) -> None:
pass
def get(self, name: str) -> Tribe:
pass
def list(self) -> list[Tribe]:
cursor = self.conn.cursor()
cursor.execute(
"""
SELECT * FROM tribes
"""
)
rows = cursor.fetchall()
return [Tribe(*r) for r in rows]
def delete(self, tribe: Tribe) -> None:
pass