I'm not sure, but maybe the queries are more readable if we replace '?' by the actual values:
=== modified file '_zeitgeist/engine/sql.py' --- _zeitgeist/engine/sql.py 2010-09-13 20:55:00 +0000 +++ _zeitgeist/engine/sql.py 2010-09-14 07:40:46 +0000 @@ -38,9 +38,11 @@
def explain_query(cursor, statement, arguments=()): log.debug("**********************************************") - log.debug("QUERY:\n%s (%s)\nPLAN:" % (statement,arguments)) + plan = "" for r in cursor.execute("EXPLAIN QUERY PLAN "+statement, arguments).fetchall(): - print r + plan += str(list(r)) + "\n" + statement = statement.replace("?", "%r") %tuple(arguments) + log.debug("QUERY:\n%s\nPLAN:\n%s" % (statement, plan)) log.debug("**********************************************")
class UnicodeCursor(sqlite3.Cursor):
But still, we can always adjust this in lp:zeitgeist itself, as it is for internal use only.
« Back to merge proposal
I'm not sure, but maybe the queries are more readable if we replace '?' by the actual values:
=== modified file '_zeitgeist/ engine/ sql.py' engine/ sql.py 2010-09-13 20:55:00 +0000 engine/ sql.py 2010-09-14 07:40:46 +0000
--- _zeitgeist/
+++ _zeitgeist/
@@ -38,9 +38,11 @@
def explain_ query(cursor, statement, arguments=()):
log.debug( "****** ******* ******* ******* ******* ******* *****") "QUERY: \n%s (%s)\nPLAN:" % (statement, arguments) ) execute( "EXPLAIN QUERY PLAN "+statement, arguments) .fetchall( ): replace( "?", "%r") %tuple(arguments) "QUERY: \n%s\nPLAN: \n%s" % (statement, plan))
log.debug( "****** ******* ******* ******* ******* ******* *****")
- log.debug(
+ plan = ""
for r in cursor.
- print r
+ plan += str(list(r)) + "\n"
+ statement = statement.
+ log.debug(
class UnicodeCursor( sqlite3. Cursor) :
But still, we can always adjust this in lp:zeitgeist itself, as it is for internal use only.