mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 00:06:18 +00:00
Update
This commit is contained in:
@@ -13,6 +13,11 @@ def ConnectionString(database) -> str or None:
|
||||
cn = f'mysql+mysqldb://{parser.get("Database", "username")}:{parser.get("Database", "password")}@{parser.get("Database", "host")}/{database}'
|
||||
else:
|
||||
cn = f'sqlite:///{os.path.join(sqlitePath, f"{database}.db")}'
|
||||
if not database_exists(cn):
|
||||
create_database(cn)
|
||||
try:
|
||||
if not database_exists(cn):
|
||||
create_database(cn)
|
||||
except Exception as e:
|
||||
print("[WGDashboard] Database error: " + str(e))
|
||||
exit(1)
|
||||
|
||||
return cn
|
Reference in New Issue
Block a user