tortoise-orm icon indicating copy to clipboard operation
tortoise-orm copied to clipboard

How can i print sql with register_tortoise() in fastapi?

Open zyk-miao opened this issue 1 year ago • 3 comments

How can i print sql with register_tortoise() in fastapi?

zyk-miao avatar Feb 01 '24 03:02 zyk-miao

i want know too ~i have to use another script to insert my admin user 这个框架太难用了吧,一堆bug,现在想写测试用例,死活跑不起来,最骚的是官方给的例子跑不起来,真难顶

qingshuiyuyu avatar May 07 '24 06:05 qingshuiyuyu

ok,maybe you can look this page https://github.com/tortoise/tortoise-orm/issues/1576 if use it init admin

qingshuiyuyu avatar May 07 '24 07:05 qingshuiyuyu

How can i print sql with register_tortoise() in fastapi?

Hey @zyk-miao! What is your final goal? Would you like to know what SQL has been generated? If is that, you can change your logs. See it here https://tortoise.github.io/logging.html?h=log

fullonic avatar May 07 '24 10:05 fullonic