Pruefungskatalog/database.py
2022-03-18 12:30:09 +01:00

32 lines
572 B
Python

# TODO: Datenbank Klasse (CRUD)
import mysql.connector
# Create Database or Table
def create(db_cursor, name, _type):
query = f'CREATE {_type} {name}'
try:
db_cursor.execute(query)
except mysql.connector.Error as err:
print('Something went wrong', err)
def add(db_cursor):
# TODO Frage / Antwort hinzufügen
return
def read(db_cursor):
# TODO Frage / Antwort auslesen
return
def update(db_cursor):
# TODO Frage / Antwort Aktualisieren
return
def del_(db_cursor):
# TODO Frage / Antwort löschen
return