This commit is contained in:
parent
ef7d93b244
commit
8b547bd786
16
database.py
16
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user