How can one see the structure of a table in SQLite

2019-01-12 14:32发布

This question already has an answer here:

How can I see the structure of table in SQLite as desc was in Oracle?

标签: sqlite3
9条回答
疯言疯语
2楼-- · 2019-01-12 15:10

You should be able to see the schema by running

.schema <table>
查看更多
我想做一个坏孩纸
3楼-- · 2019-01-12 15:10

You can use the Firefox add-on called SQLite Manager to view the database's structure clearly.

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-01-12 15:15

I've implemented a SQLite table schema parser in PHP. You may check here: I implemented a sqlite table parser

https://github.com/maghead/sqlite-parser

The syntax follows the SQLite create table statement syntax: http://www.sqlite.org/lang_createtable.html

查看更多
倾城 Initia
5楼-- · 2019-01-12 15:16
PRAGMA table_info(table_name);

This will work for both: command-line and when executed against a connected database.

查看更多
干净又极端
6楼-- · 2019-01-12 15:18

You will get the structure by typing the command:

.schema <tableName>
查看更多
smile是对你的礼貌
7楼-- · 2019-01-12 15:21

.schema TableName

Where TableName is the name of the Table

查看更多
登录 后发表回答