For some reason I can't find a way to get the equivalents of sqlite's interactive shell commands:
.tables .dump
using the Python sqlite3 API.
Is there anything like that?
In Python:
con = sqlite3.connect('database.db') cursor = con.cursor() cursor.execute("SELECT name FROM sqlite_master WHERE type='table';") print(cursor.fetchall())
Watch out for my other answer. There is a much faster way using pandas.
1.4m articles
1.4m replys
5 comments
56.9k users