🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat(django-google-spanner): implement full foreign key introspection and backend test support #19145

Open

Description

@olavloite

Spanner and the Spanner Emulator now support FOREIGN KEY constraints, and django-google-spanner already enables supports_foreign_keys = True in normal usage. However, full foreign key support in the Django backend is still incomplete (previously tracked in archived googleapis/python-spanner-django#313).

Remaining Work

  • Implement foreign key constraint introspection in DatabaseIntrospection.get_constraints() (populate "foreign_key": (ref_table, ref_column) instead of skipping CONSTRAINT_TYPE == "FOREIGN KEY", and filter or handle any backing indexes generated by Spanner).
  • Enable DatabaseFeatures.can_introspect_foreign_keys = True.
  • Enable supports_foreign_keys and DatabaseSchemaEditor.sql_create_fk under RUNNING_SPANNER_BACKEND_TESTS=1 (or handle Spanner-specific FK limitations cleanly in features.py).
  • Update docs/limitations.rst to reflect current foreign key support.

Activity

  1. added
    api: spanner
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: spanner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions