Name

foreign_key_list — List all foreign keys in the given table

Common Usage

PRAGMA [database.]foreign_key_list( table_name );

Description

The foreign_key_list pragma lists all the foreign key references that are part of the specified table. That list will contain one row for each column of each foreign key contained within the table.

Column nameColumn typeMeaning
id IntegerForeign key ID number
seq IntegerColumn sequence number for this key
table TextName of foreign table
from TextLocal column name
to TextForeign column name
on_update TextON UPDATE action
on_delete TextON DELETE action
match TextAlways NONE

See Also

foreign_keys

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.