mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
Updated both logger to use native column type
This commit is contained in:
@@ -1805,6 +1805,7 @@ class DashboardConfig:
|
||||
"Database":{
|
||||
"type": "sqlite",
|
||||
"host": "",
|
||||
"port": "",
|
||||
"username": "",
|
||||
"password": ""
|
||||
},
|
||||
@@ -1834,7 +1835,7 @@ class DashboardConfig:
|
||||
|
||||
def getConnectionString(self, database) -> str or None:
|
||||
if self.GetConfig("Database", "type")[1] == "sqlite":
|
||||
return f'sqlite:///{os.path.join(CONFIGURATION_PATH, "db", f".db")}'
|
||||
return f'sqlite:///{os.path.join(CONFIGURATION_PATH, "db", f"{database}.db")}'
|
||||
elif self.GetConfig("Database", "type")[1] == "postgresql":
|
||||
return f'postgresql+psycopg2://{self.GetConfig("Database", "username")[1]}:{self.GetConfig("Database", "password")[1]}@{self.GetConfig("Database", "host")[1]}/{database}'
|
||||
return None
|
||||
|
Reference in New Issue
Block a user