Created
May 11, 2015 22:39
-
-
Save mirekfranc/519ce967c1c9f2cbd310 to your computer and use it in GitHub Desktop.
small script to dump sqlite database files to stdin...
This file contains 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
import sqlite3 | |
import sys | |
for f in sys.argv[1:]: | |
print "== FILE: " + f + " ==" | |
with sqlite3.connect(f) as con: | |
for (table,) in con.cursor().execute("SELECT name FROM sqlite_master WHERE type='table';"): | |
print "=== TABLE: " + table + " ===" | |
for row in con.cursor().execute("SELECT * FROM " + table + ";"): | |
print row |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment