Skip to content

bug: Support Retrieval of Cross-Schema Foreign Keys #681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

waltaskew
Copy link
Contributor

@waltaskew waltaskew commented Jun 2, 2025

Allow get_multi_foreign_keys to retrieve foreign keys between tables in different schemas. The current SQL used to retrieve them has a mistake in the JOINs, confusing the table_schema column and the constraint_schema column. This goes unnoticed as long as everything is in the same schema.

Include schema names in ALTER TABLE schema.table DROP CONSTRAINT fk_constraint DDL and quote the table name.

fixes: #638

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Jun 2, 2025
Allow `get_multi_foreign_keys` to retrieve foreign keys between tables
in different schemas. The current SQL used to retrieve them has a
mistake in the JOINs used to retrieve them, confusing the `table_schema`
column and the `constraint_schema` column. This goes unnoticed as long
as everything is in the same schema.

Include schemas names in ALTER TABLE schema.table DROP CONSTRAINT DDL
and quote the table name.

fixes: googleapis#638
@waltaskew waltaskew force-pushed the detect-cross-schema-fks branch from 9ff2066 to 2593ac7 Compare June 4, 2025 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema Support
1 participant