Is there an SQLite equivalent to MySQL's DESCRIBE [table]?
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?
SQLite命令行实用程序有一个.schema TABLENAME
命令,用于显示创建语句。
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)
链接地址: http://www.djcxy.com/p/95948.html
上一篇: 轻量级的替代休眠?