Skip to content

Commit

Permalink
Do not use sqlite-only args when using non-sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
pycui committed Jul 16, 2023
1 parent 91dab3f commit b1be209
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion realtime_ai_character/database/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL")

connect_args = {"check_same_thread": False} if SQLALCHEMY_DATABASE_URL.startswith(
"sqlite") else {}

engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
SQLALCHEMY_DATABASE_URL, connect_args=connect_args
)

SessionLocal = sessionmaker(
Expand Down

0 comments on commit b1be209

Please sign in to comment.