From 7e88a444775df0de1586b77fc9650f9287c0bb9b Mon Sep 17 00:00:00 2001 From: Rabin Adhikari Date: Fri, 4 Feb 2022 11:55:38 +0545 Subject: [PATCH] Fix Unncssary caching warning for now. Refer to https://github.com/tiangolo/sqlmodel/issues/189 for more info --- server/app/database.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/app/database.py b/server/app/database.py index 1bd06c30..6005e025 100644 --- a/server/app/database.py +++ b/server/app/database.py @@ -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 @@ -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")