I'm just getting started learning SQLite. It would be nice to be able to see the details for a table, like MySQL's DESCRIBE [table]
. PRAGMA table_info [table]
isn't good enough, as it only has basic information (for example, it doesn't show if a column is a field of some sort or not). Does SQLite have a way to do this?
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- SQL/SQL-LITE - Counting records after filtering
- Why sometimes there is one of more gap(s) in the v
To prevent that people are mislead by some of the comments to the other answers:
.schema
orquery from sqlite_master
not gives any output, it indicates a non-existenttablename
, e.g. this may also be caused by a;
semicolon at the end for.schema
,.tables
, ... Or just because the table really not exists. That.schema
just doesn't work is very unlikely and then a bug report should be filed at the sqlite project.sqlite
, is more likely to be supported than that the language provides awrapper
/library
for every program (which not only is prone to incompleteness by the very nature of the masses of programs out there, but also is counter actingsingle-source principle
, complicatingmaintenance
, furthering the chaos of data in the world).(Put up as answer as no permission to comment yet.)
To see all tables:
To see a particular table:
Are you looking for the SQL used to generate a table? For that, you can query the
sqlite_master
table:The SQLite command line utility has a
.schema TABLENAME
command that shows you the create statements.