add: add user method to database and init table

This commit is contained in:
starnakin 2023-06-03 22:51:12 +02:00
parent d2d6fc9947
commit 15cd72414e
3 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class Database:
for key, value in content.keys(): for key, value in content.keys():
command += f"{key} {value}, " command += f"{key} {value}, "
command += ")" command += ")"
self.cursor.execute(command)
def create_user_table(self): def create_user_table(self):
self.cursor.execute("SHOW TABLES"); self.cursor.execute("SHOW TABLES");

View File

@ -7,3 +7,4 @@ user = config.database.get("user")
password = config.database.get("password") password = config.database.get("password")
database = Database.Database(host, port, user, password) database = Database.Database(host, port, user, password)
database.create_user_table()

View File

@ -1,4 +1,5 @@
import flask import flask
import database
app = flask.Flask(__name__) app = flask.Flask(__name__)