Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3
- import sys
- try:
- FILENAME = sys.argv[1]
- except IndexError:
- print "You must pass in a valid sqlite db."
- sys.exit(1)
- print FILENAME
- conn = sqlite3.connect(FILENAME)
- c1 = conn.cursor()
- c2 = conn.cursor()
- for table in c1.execute("SELECT name FROM sqlite_master WHERE type='table' order by name;"):
- print "\n%s" % table[0]
- c2.execute('SELECT * FROM %s' % table[0])
- for column in [x[0] for x in c2.description]:
- print " %s" % column
Add Comment
Please, Sign In to add comment