Pruefungskatalog/database.py

31 lines
539 B
Python
Raw Normal View History

2022-03-17 13:07:35 +01:00
# TODO: Datenbank Klasse (CRUD)
2022-03-18 09:29:41 +01:00
import mysql.connector
2022-03-17 13:22:44 +01:00
2022-03-18 09:32:08 +01:00
def create(db_cursor, name):
query = f'CREATE DATABASE {name}'
2022-03-18 09:26:05 +01:00
try:
db_cursor.execute(query)
2022-03-18 09:29:41 +01:00
except mysql.connector.Error as err:
2022-03-18 09:26:05 +01:00
print('Something went wrong', err)
2022-03-17 13:07:35 +01:00
2022-03-17 13:22:44 +01:00
def add(db_cursor):
2022-03-17 13:07:35 +01:00
# TODO Frage / Antwort hinzufügen
return
2022-03-18 09:32:08 +01:00
def read(db_cursor):
2022-03-17 13:07:35 +01:00
# TODO Frage / Antwort auslesen
return
2022-03-18 09:32:08 +01:00
def update(db_cursor):
2022-03-17 13:07:35 +01:00
# TODO Frage / Antwort Aktualisieren
return
2022-03-18 09:32:08 +01:00
def del_(db_cursor):
# TODO Frage / Antwort löschen
2022-03-17 13:07:35 +01:00
return