sqlite-utils/sqlite_utils
Claude 23bc93239e
Add update_incoming_fks parameter to transform()
When renaming columns that are referenced by foreign keys in other
tables, the transform() method now accepts update_incoming_fks=True
to automatically update those FK constraints.

Implementation:
- Added _get_incoming_fks_needing_update() helper to find tables
  with FKs pointing to renamed columns
- Modified transform() to collect SQL for updating incoming FKs
- Execute main transform first (so new column exists), then update
  incoming FKs, all within the same transaction
- Added _skip_fk_validation flag to allow generating SQL for FKs
  that reference columns that don't exist yet (will exist after
  main transform completes)

Includes test for basic column rename case with FK enforcement ON.
2026-01-21 14:53:04 +00:00
..
__init__.py prepare_connection plugin hook 2023-07-22 15:59:08 -07:00
__main__.py Support 'python -m sqlite_utils', closes #368 2022-01-08 18:33:22 -08:00
cli.py More type annotations (#697) 2025-12-16 22:11:47 -08:00
db.py Add update_incoming_fks parameter to transform() 2026-01-21 14:53:04 +00:00
hookspecs.py More type annotations (#697) 2025-12-16 22:11:47 -08:00
plugins.py More type annotations (#697) 2025-12-16 22:11:47 -08:00
py.typed py.typed file so mypy picks up the types, closes #331 2021-11-14 15:21:04 -08:00
recipes.py More type annotations (#697) 2025-12-16 22:11:47 -08:00
utils.py More type annotations (#697) 2025-12-16 22:11:47 -08:00