在sqlite中是否有PRAGMA table_info(‘mytable’)的等效SELECT语句?基本上,我想获得与PRAGMA返回完全相同的结果集:cid,name,type,notnull,dflt_value和pk.虽然我知道通过C函数sqlite3_table_column_Metadata获取此信息的另一种方法,但我更喜欢使用SELECT语句.
根据
doc
原文链接:https://www.f2er.com/sqlite/197690.htmlPRAGMAs that return results and that have no side-effects can be
accessed from ordinary SELECT statements as table-valued functions.
For each participating PRAGMA,the corresponding table-valued function
has the same name as the PRAGMA with a 7-character “pragma_” prefix.
The PRAGMA argument and schema,if any,are passed as arguments to the
table-valued function.For example,information about the columns in an index can be read
using the index_info pragma as follows:PRAGMA index_info(‘idx52’); Or,the same content can be read using:
SELECT * FROM pragma_index_info(‘idx52’);
不应该这样做吗?