What SQL can be used to list the tables, and the rows within those tables in a SQLite database file - once I have attached it with the ATTACH
command on the SQLite 3 command line tool??
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
It appears you need to go through the sqlite_master table, like this:
And then manually go through each table with a
SELECT
or similar to look at the rows.The
.DUMP
and.SCHEMA
commands doesn't appear to see the database at all.As of the latest versions of SQLite 3 you can issue:
to see all of your create statements.
I use this query to get it:
And to use in iOS:
Via a
union all
, combine all tables into one list.The ".schema" commando will list available tables and their rows, by showing you the statement used to create said tables:
There are a few steps to see the tables in an SQLite database:
List the tables in your database:
List how the table looks:
Print the entire table:
List all of the available SQLite prompt commands: