如何查找 SQLite 数据库中所有列的信息?

How to find information on all columns in a SQLite database?

在线搜索,很容易找到获取SQL站点中所有列的信息的方法table:使用pragma table_info(name)和[=的名称16=]。但是我见过的每个 SQL 数据库都有一些方法可以同时获取整个数据库所有列的信息,结果集中的某些列链接回 table 中拥有该列的列问题。

SQL网站支持吗?或者只能通过对每个人进行单独查询来完成table?

可以查询tablesqlite_master得到数据库的所有table然后用table赋值函数pragma_table_info()得到对于每个 table 它的列:

WITH all_tables AS (SELECT name FROM sqlite_master WHERE type = 'table') 
SELECT at.name table_name, pti.*
FROM all_tables at INNER JOIN pragma_table_info(at.name) pti
ORDER BY table_name;