"how to list the tables in a sqlite database file that was opened with attach?" Code Answer

4

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';
By Icaro on June 15 2022

Answers related to “how to list the tables in a sqlite database file that was opened with attach?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.