Docs for SQLite's foreign_key_list($table)

AFAICT SQLite's foreign_key_list($table_name) pragma returns a list of 8 elements in this order (i.e. with these interpretations):

1: COUNT
2: KEY_SEQ
3: FKTABLE_NAME
4: PKCOLUMN_NAME
5: FKCOLUMN_NAME
6: UPDATE_RULE
7: DELETE_RULE
8: UNKNOWN

If anyone can explain the last item, or offer corrections, please advise.

2 Comments

According to Using SQLite by Jay A. Kreibich the elements are:
id Integer "Foreign key ID number"
seq Integer "Column sequence number for this key"
table Text "Name of foreign table"
from Text "Local column name"
to Text "Foreign column name"
on_update Text "ON UPDATE action"
on_delete Text "ON DELETE action"
match Text "Always NONE"

Leave a comment

About Ron Savage

user-pic I try to write all code in Perl, but find I end up writing in bash, CSS, HTML, JS, and SQL, and doing database design, just to get anything done...