Skip to content

Commit

Permalink
Fix Unncssary caching warning for now.
Browse files Browse the repository at this point in the history
Refer to tiangolo/sqlmodel#189 for more info
  • Loading branch information
rabinadk1 committed Feb 4, 2022
1 parent f4b9365 commit 7e88a44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/app/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from fastapi import HTTPException
from sqlmodel import Session, SQLModel, create_engine
from sqlmodel.sql.expression import Select, SelectOfScalar

from .config import settings

Expand All @@ -13,6 +14,12 @@
echo=settings.database_echo,
)

# Fix Unncessary caching warning for now. Refer to
# https://github.com/tiangolo/sqlmodel/issues/189 for more info

SelectOfScalar.inherit_cache = True
Select.inherit_cache = True

# Make a Generic Type to get the original type completion back
ModelType = TypeVar("ModelType")

Expand Down

0 comments on commit 7e88a44

Please sign in to comment.