How to list all tables in a SQLite database that was opened with ATTACH?

Use ATTACH to open the database file:

ATTACH file.db AS my_db;

Then use:

SELECT name FROM my_db.sqlite_master WHERE type='table';

To show the tempoprary tables, you need to run this:

SELECT name FROM sqlite_temp_master WHERE type='table';

Need a good GUI tool for SQLite? Check out TablePlus. It’s native, beautiful, and available for free.

Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS

TablePlus GUI Tool SQLite