Show sql-requests with create_engine(..., echo=True) #345
-
Hi there! I began to use fastapi with ormar. When I create engine with argement echo=True, application don't show sql-requests. How i can do it? I have tried run application with other mods (release/debug), and added logger. All attempts is failed. import ormar
from config import DATABASE_URL, SQL_ECHO
import databases
import sqlalchemy
metadata = sqlalchemy.MetaData()
database = databases.Database(str(DATABASE_URL))
engine = sqlalchemy.create_engine(str(DATABASE_URL), echo=SQL_ECHO) Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That's because the
If there is no debug mode in databases it can probably be an enhancement proposal for |
Beta Was this translation helpful? Give feedback.
That's because the
sqlalchemy
is not used to run the queries.ormar
runs the queries withencode\databases
so you need to search for a debug feature there, not sure if it's implemented, you need to check the source code as the documentation is super basic.If there is no debug mode in databases it can probably be an enhancement proposal for
ormar
.