import sqlite3
from pathlib import Path
from typing import Optional
from repository.abstract_db_repository import AbstractDatabaseRepository
from repository.sqlite_init_tables import (
TELEGRAM_USER_MATRIX_CHATS_SQL,
TELEGRAM_USERS_SQL,
MATRIX_ROOMS_SQL,
)
TABLES_LIST = [
]
class SQLiteDatabaseRepository(AbstractDatabaseRepository):
def __init__(self, app, path: Path):
self.path = path
self.conn = sqlite3.connect(path)
@staticmethod
def create_tables(self) -> None:
"""Init tables in database"""
for table in TABLES_LIST:
self.conn.execute(table)
self.conn.commit()