Refactor Database.py to conditionally set the database URI

This commit is contained in:
Théophile Diot 2024-09-23 11:59:44 +02:00
parent f180404c8d
commit 1263484e52
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -129,7 +129,7 @@ class Database:
match.group("database"), f"{match.group('database')}+psycopg"
) # ? This is strongly recommended as psycopg is the new way to connect to postgresql
self.database_uri = sqlalchemy_string
self.database_uri = "" if sqlalchemy_string == sqlalchemy_string_readonly else sqlalchemy_string
self.database_uri_readonly = sqlalchemy_string_readonly
error = False