Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

being able to dump the current to disk sql is really useful for debug…

…ging.
  • Loading branch information...
commit fa86cb2bca727294ce2e905ab5c15c26d270b7db 1 parent 2b2eabb
Mark Bucciarelli authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/pv/ext/SqlRoot.py
View
13 src/pv/ext/SqlRoot.py
@@ -26,3 +26,16 @@ def connect(self):
detect_types = sqlite3.PARSE_DECLTYPES,
isolation_level = "IMMEDIATE"
)
+
+ def dumpsql(self, fp):
+ '''
+ Sample usage:
+ log = Log(datadir)
+ root, replay = log.loadInitState(lambda : Hybrid())
+ fp = open(outfn, 'w')
+ root.sql.dumpsql(fp)
+ fp.close()
+ '''
+ for line in self.dbconn.iterdump():
+ s = '%s\n' % line
+ fp.write(s.encode('utf8'))
Please sign in to comment.
Something went wrong with that request. Please try again.