List of tables, db schema, dump etc using the Python sqlite3 API

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.

Leave a Comment