diff --git a/database.py b/database.py index cc3ada6..574d536 100644 --- a/database.py +++ b/database.py @@ -1,20 +1,20 @@ # TODO: Datenbank Klasse (CRUD) -import mysqlx +import mysql.connector -def create_database(db_cursor): - # TODO Datenbank erstellen - return - - -def create_table(db_cursor, database_name): +def create_database(db_cursor, database_name): query = f'CREATE DATABASE {database_name}' try: db_cursor.execute(query) - except mysqlx.Error as err: + except mysql.connector.Error as err: print('Something went wrong', err) +def create_table(db_cursor): + # TODO Frage / Antwort Tabellen erstellen + return + + def add(db_cursor): # TODO Frage / Antwort hinzufügen return