Is there an SQLite equivalent to MySQL's DESCRIBE [table]?
The SQLite command line utility has a .schema TABLENAME
command that shows you the create statements.
PRAGMA table_info([tablename]);
Are you looking for the SQL used to generate a table? For that, you can query the sqlite_master
table:
sqlite> CREATE TABLE foo (bar INT, quux TEXT);
sqlite> SELECT * FROM sqlite_master;
table|foo|foo|2|CREATE TABLE foo (bar INT, quux TEXT)
sqlite> SELECT sql FROM sqlite_master WHERE name = 'foo';
CREATE TABLE foo (bar INT, quux TEXT)