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
  • 40,109
  • 71
  • 208
  • 322

4 Answers4

55

You'll need to use a PRAGMA.

PRAGMA table_info(TABLENAME);

DNS
  • 37,249
  • 18
  • 95
  • 132
  • 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
  • 6,095
  • 7
  • 40
  • 55
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,493
  • 3
  • 38
  • 37