Skip to content

Commit cd43993

Browse files
committed
Fix database engine initialization
Stupid Python and how it handles local vs. global variables.
1 parent 77f872c commit cd43993

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
def init_db_engine(settings: CARPIFastAPISettings) -> None:
13+
global _engine
1314
_engine = create_engine(
1415
url=f"{settings.db_dialect}+{settings.db_api}"
1516
+ f"://{settings.db_username}:{settings.db_password}"

0 commit comments

Comments
 (0)