Documentation for compound foreign key support, refs #594

- Changelog entries for all the compound foreign key work
- Upgrading guide notes the transform() behavior changes
- ForeignKey added to the API reference
- Updated .foreign_keys introspection example output

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Simon Willison 2026-07-05 14:45:08 -07:00
commit 42c1dd0d5f
5 changed files with 28 additions and 3 deletions

View file

@ -176,6 +176,9 @@ class ForeignKey:
are ``None`` - use ``columns`` and ``other_columns`` instead, and check
``is_compound``.
``on_delete`` and ``on_update`` hold the foreign key actions, e.g.
``"CASCADE"`` - ``"NO ACTION"`` if not set.
Prior to sqlite-utils 4.0 this was a ``namedtuple`` and could be unpacked
or indexed as ``(table, column, other_table, other_column)``. It is now a
dataclass - access its fields by name instead.