Some of the information here may be outdated, please check the book instead
[edit]

sql.log logs only CREATE, DROP, and ALTER table.

INSERTs, UPDATEs and SELECTs are logged one at the time in the db._lastsql string.

To check whether caching is used you can do

db._lastsql=None
rows=db(...).select(...,cache=(cache.ram,60))
if db._lastsql:
    print 'SQL WAS EXECUTED AND RESULT CACHED:',db._lastsql
else:
    print 'SQL WAS NOT EXECUTED, DATA RETRIEVED FROM CACHE'
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.