Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an SQLite equivalent to MySQL's DESCRIBE [table]?

Tags:

sqlite

mysql

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?

like image 727
Matthew Avatar asked Jul 25 '10 18:07

Matthew


People also ask

How do you describe a table in SQLite?

Definition of SQLite Describe Table. SQLite provides the different commands to the user such as the describe command, in which we can see the detailed structure of the table. SQLite database uses the . schema command to describe the table; the .

How do I get table information in SQLite?

If you are running the sqlite3 command-line access program you can type ". tables" to get a list of all tables. Or you can type ". schema" to see the complete database schema including all tables and indices.


1 Answers

The SQLite command line utility has a .schema TABLENAME command that shows you the create statements.

like image 94
Ned Batchelder Avatar answered Sep 21 '22 10:09

Ned Batchelder