Skip to content

Instantly share code, notes, and snippets.

@mirekfranc
Created May 11, 2015 22:39
Show Gist options
  • Save mirekfranc/519ce967c1c9f2cbd310 to your computer and use it in GitHub Desktop.
Save mirekfranc/519ce967c1c9f2cbd310 to your computer and use it in GitHub Desktop.
small script to dump sqlite database files to stdin...
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