Is there a way of listing ALL foreign keys in a SQLite database?
They don’t seem to be stored in sqlite_master and PRAGMA foreign_key_list('table') only lists one at a time.
Alternatively, is there a way of listing what foreign keys reference a table?
With the SQLite shell, use the
.schemainstruction, and use GREP to filter lines containingREFERENCES.From
shell.cin the SQLite repository, today’s version in the trunk, two queries:and
The second one is probably what you are looking for.