Skip to content
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

Fixed DatabaseIntrospection.get_relations() docstring. #15074

Merged
merged 1 commit into from Nov 10, 2021

Conversation

timgraham
Copy link
Member

The foreign keys are "in" the given table, not "to" it.

The foreign keys are "in" the given table, not "to" it.
Copy link
Member

@charettes charettes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Barely related but when reviewing #14878 I've noticed that get_key_columns and get_relations serve the exact same purpose but happen to return the data in different format so it might be worth deprecating one if favor of the other. Also, the whole SQLite implementation that includes complex regexes can be replaced with a simple call to 'PRAGMA foreign_key_list(%s)' % self.connection.ops.quote_name(table_name).

@felixxm
Copy link
Member

felixxm commented Nov 10, 2021

@timgraham Good catch 🎯 Thanks 👍

@felixxm felixxm merged commit afea68c into django:main Nov 10, 2021
@felixxm
Copy link
Member

felixxm commented Nov 10, 2021

Barely related but when reviewing #14878 I've noticed that get_key_columns and get_relations serve the exact same purpose but happen to return the data in different format so it might be worth deprecating one if favor of the other.

Good idea, see #15075. IMO, we can remove it without a deprecation period.

@timgraham timgraham deleted the get_relations-comment branch November 10, 2021 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants