The .tables
, and .schema
"helper" functions don‘t look into ATTACHed databases: they just query the SQLITE_MASTER
table for the "main" database. Consequently, if you used
ATTACH some_file.db AS my_db;
then you need to do
SELECT name FROM my_db.sqlite_master WHERE type=‘table‘;
Note that temporary tables don‘t show up with .tables
either: you have to list sqlite_temp_master
for that:
SELECT name FROM sqlite_temp_master WHERE type=‘table‘;
"SELECT name FROM sqlite_master WHERE type=‘table‘"
works for me – vladkras Dec 15 ‘15 at 13:28CREATE TEMPORARY TABLE
SQL commands. Their contents are dropped when the current database connection is closed, and they are never saved to a database file. – Anthony Williams May 8 ‘17 at 14:37ATTACH "some_file.db" AS my_db;
It worked! – John_J Dec 25