Initial commit

This commit is contained in:
2026-11-05 08:28:15 +00:00
commit 08582a4f70
65 changed files with 1886 additions and 0 deletions
@@ -0,0 +1,24 @@
from backend.code.modules.database.database import DatabaseModule
class AccountRepository():
def __init__(self, repo: DatabaseModule):
self.conn = repo.conn
self.cursor = repo.cursor
def SelectByUsername(self, username: str):
sql = '''
SELECT *
FROM user_accounts
WHERE username = ?
'''
self.cursor.execute(sql, [username])
return self.cursor.fetchone()
def InsertAccount(self, user_id: int, username: str, locked: bool = False, active: bool = True):
sql = '''
INSERT INTO user_accounts(user_id, username, locked, active)
VALUES(?, ?, ?, ?)
'''
self.cursor.execute(sql, [user_id, username, locked, active])
self.conn.commit()
return self.cursor.lastrowid