0
是否有可能在peewee中計數查詢?如下 讓它在Django:在peewee中獲取SQL查詢計數
from django.db import connection
print len(connection.queries)
是否有可能在peewee中計數查詢?如下 讓它在Django:在peewee中獲取SQL查詢計數
from django.db import connection
print len(connection.queries)
你可以扮演就像here:子類Database
設置它數查詢:
def execute(*args, **kwargs):
self.counter += 1 # or put the query into some list, as you like
return super().execute(args, kwargs)