Feat: add add tribe

This commit is contained in:
2022-12-26 19:21:00 +01:00
parent fe92433311
commit f73ad3a34d
3 changed files with 48 additions and 3 deletions

View File

@@ -6,8 +6,8 @@ def create_tribe_table(conn) -> None:
cursor.execute(
"""
CREATE TABLE IF NOT EXISTS tribes(
name TEXT PRIMARY KEY UNIQUE,
level TEXT
name VARCHAR PRIMARY KEY UNIQUE,
level VARCHAR
)
"""
)

View File

@@ -7,7 +7,16 @@ class TribeSQLiteRepository(AbstractRepository):
self.conn = conn
def add(self, tribe: Tribe) -> None:
pass
cursor = self.conn.cursor()
cursor.execute(
"""
INSERT INTO tribes(name, level) VALUES (?, ?)
""",
(
tribe.name,
tribe.level,
),
)
def update(self, name: str, tribe: Tribe) -> None:
pass