22

Is there some command like "show columns from TABLENAME"? I only know that .dump command, but that's really dumb in this case. It puts out all the data, too.

I need something to just see the table structure.

Thanks
  • 39,609
  • 71
  • 204
  • 317

4 Answers4

55

You'll need to use a PRAGMA.

PRAGMA table_info(TABLENAME);

DNS
  • 35,783
  • 18
  • 87
  • 126
  • Thanks, I was looking for a command to serve the same purpose as the "Show Columns from tablename" command that I can use when I'm working with mysql. when working with sqlite instead, and this does the job nicely – Kit Ramos Jul 25 '12 at 15:33
10

select * from sqlite_master

should work I think.

Mladen Mihajlovic
  • 5,555
  • 4
  • 39
  • 52
6

in SQLite 3, do:

.schema TABLENAME

0

Another way, you can use SQLite Manager Add-on for Firefox

https://addons.mozilla.org/vi/firefox/addon/sqlite-manager/

Frank Nguyen
  • 6,293
  • 3
  • 36
  • 37