Created base database controller and user database controller to allow for initial database control

This commit is contained in:
2024-01-01 20:19:57 +00:00
parent ef94773b8f
commit b1a22cb7bd
13 changed files with 84 additions and 14 deletions

View File

@@ -0,0 +1,31 @@
from abc import ABC, abstractmethod
import sqlite3
class DatabaseController(ABC):
__sqlitefile = "./data/wmgzon.db"
def __init__(self):
self._conn = None
try:
self._conn = sqlite3.connect(self.__sqlitefile)
except sqlite3.Error as e:
# Close the connection if still open
if self._conn:
self._conn.close()
print(e)
@abstractmethod
def create(self):
pass
@abstractmethod
def read(self):
pass
@abstractmethod
def update(self):
pass
@abstractmethod
def delete(self):
pass