Created
February 12, 2014 00:02
-
-
Save apage43/8947106 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import sqlite3 | |
| import struct | |
| import sys | |
| def main(): | |
| conn = sqlite3.connect(sys.argv[1]) | |
| conn.row_factory = sqlite3.Row | |
| c = conn.cursor() | |
| for row in c.execute('SELECT * FROM cbb_msg'): | |
| (rev,) = struct.unpack_from('>Q', row['meta']) | |
| if row['cmd'] == 65: | |
| print 'Key: %s, Rev: %d' % (row['key'], rev) | |
| else: | |
| print '(Deleted) Key: %s, Rev: %d' % (row['key'], rev) | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment