WMGZON/controllers/database/database.py

31 lines
637 B
Python
Raw Normal View History

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