-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Clinical-Genomics/allow_demo_db
Use memory DB as default DB
- Loading branch information
Showing
3 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
from sqlmodel import create_engine, SQLModel | ||
from schug.config import DEMO_DB, settings | ||
from sqlmodel import SQLModel, create_engine | ||
|
||
from schug.config import settings | ||
DEMO_CONNECT_ARGS: dict = {"check_same_thread": False} | ||
|
||
engine = create_engine(settings.db_uri, echo=True) | ||
if settings.db_uri == DEMO_DB: | ||
engine = create_engine(settings.db_uri, connect_args=DEMO_CONNECT_ARGS, echo=True) | ||
else: | ||
engine = create_engine(settings.db_uri, echo=True) | ||
|
||
SQLModel.metadata.create_all(engine) |