Skip to content

Use ForeignKey target accessors instead of splitting colspecs - #1861

Closed
gyanu2507 wants to merge 1 commit into
sqlalchemy:mainfrom
gyanu2507:fk-target-accessors
Closed

Use ForeignKey target accessors instead of splitting colspecs#1861
gyanu2507 wants to merge 1 commit into
sqlalchemy:mainfrom
gyanu2507:fk-target-accessors

Conversation

@gyanu2507

Copy link
Copy Markdown

Alembic was splitting ForeignKey._get_colspec() on ".", which cannot tell a dot inside a name from the separator between schema/table/column. SQLAlchemy 2.1 exposes target_tokens / target_table_key / target_column for this.

Wired those in through sqla_compat, with the old split as a fallback on 2.0.

Fixes #1860

SQLAlchemy 2.1 tracks schema/table/column separately so a dot inside a
name is not a separator. Use those public attributes when present and
keep the old split as a fallback for 2.0.
@sqla-tester

Copy link
Copy Markdown
Collaborator

Hi, and thanks for the pull request!

This project accepts pull requests only for issues that a maintainer has already marked with the open for pull requests label. That way we can settle on an approach before anyone spends time writing code.

This pull request references issue #1860, which hasn't been marked open for pull requests, so the change isn't authorized yet and I'm closing it automatically. Once a maintainer adds the label to #1860, reopen this pull request and it will stay open. If #1860 needs more detail before that can happen, a complete runnable example is usually the missing piece, and adding one to the issue is the fastest way to get there.

This is automatic and procedural. It isn't a judgment on your change, and nothing you've written here is lost.

Thanks for your interest in the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use SQLAlchemy 2.1 ForeignKey target accessors instead of splitting the dotted colspec

2 participants