We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42e9924 commit 196bdc5Copy full SHA for 196bdc5
reflex/model.py
@@ -43,12 +43,9 @@ def get_engine(url: Optional[str] = None):
43
)
44
# Print the SQL queries if the log level is INFO or lower.
45
echo_db_query = os.environ.get("SQLALCHEMY_ECHO") == "True"
46
- return sqlmodel.create_engine(
47
- url,
48
- echo=echo_db_query,
49
- # Needed for the admin dash.
50
- connect_args={"check_same_thread": False},
51
- )
+ # Needed for the admin dash on sqlite.
+ connect_args = {"check_same_thread": False} if url.startswith("sqlite") else {}
+ return sqlmodel.create_engine(url, echo=echo_db_query, connect_args=connect_args)
52
53
54
class Model(Base, sqlmodel.SQLModel):
0 commit comments