How can I log queries in Sqlite3 with Python?

Viewed 9204

I'm using Sqlite3 database in my Python application and query it using parameters substitution.
For example:

cursor.execute('SELECT * FROM table WHERE id > ?', (10,))

Some queries do not return results properly and I would like to log them and try to query sqlite manually.
How can I log these queries with parameters instead of question marks?

2 Answers
Related