This commit is contained in:
parent
ef7d93b244
commit
8b547bd786
16
database.py
16
database.py
|
@ -1,20 +1,20 @@
|
||||||
# TODO: Datenbank Klasse (CRUD)
|
# TODO: Datenbank Klasse (CRUD)
|
||||||
import mysqlx
|
import mysql.connector
|
||||||
|
|
||||||
|
|
||||||
def create_database(db_cursor):
|
def create_database(db_cursor, database_name):
|
||||||
# TODO Datenbank erstellen
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def create_table(db_cursor, database_name):
|
|
||||||
query = f'CREATE DATABASE {database_name}'
|
query = f'CREATE DATABASE {database_name}'
|
||||||
try:
|
try:
|
||||||
db_cursor.execute(query)
|
db_cursor.execute(query)
|
||||||
except mysqlx.Error as err:
|
except mysql.connector.Error as err:
|
||||||
print('Something went wrong', err)
|
print('Something went wrong', err)
|
||||||
|
|
||||||
|
|
||||||
|
def create_table(db_cursor):
|
||||||
|
# TODO Frage / Antwort Tabellen erstellen
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def add(db_cursor):
|
def add(db_cursor):
|
||||||
# TODO Frage / Antwort hinzufügen
|
# TODO Frage / Antwort hinzufügen
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user