SQLite PRAGMA

PRAGMA foreign_key_list

This pragma returns one row for each foreign key constraint created by a REFERENCES clause in the CREATE TABLE statement of table "table-name".

PRAGMA foreign_key_list(table-name);

On the sample database

What PRAGMA foreign_key_list(playlist_tracks) returns on the sample database, in SQLite 3.54.1 as built for the browser by sql.js:

idseqtablefromtoon_updateon_deletematch
00trackstrack_ididNO ACTIONNO ACTIONNONE
10playlistsplaylist_ididNO ACTIONCASCADENONE

What the SQLite documentation says

This pragma returns one row for each foreign key constraint created by a REFERENCES clause in the CREATE TABLE statement of table "table-name".

From sqlite.org's pragma documentation for SQLite 3.54.1, in the public domain.

← foreign_key_check · foreign_keys →