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

Document the use of spatial functions in primaryjoin conditions #222

Merged
merged 1 commit into from Apr 27, 2019

Conversation

elemoine
Copy link
Member

Fixes #220.

@elemoine
Copy link
Member Author

I'll merge this this afternoon or tomorrow if I there's no feedback.

@troyswanson
Copy link

I wonder if it would be helpful to provide an example the other way as well, to show the relationship from the treasure's perspective.

In other words, "what lake does this treasure live in?" vs "what treasure lives in this lake?"

Also, it might be helpful to discuss (very basic) lazy/eager loading strategies. With lazy loading, Iterating on the lake response and accessing the treasure attribute would get very expensive, since it would emit a new SQL query for every lake. Eager loading would eliminate that expense.

Related docs: https://docs.sqlalchemy.org/en/13/orm/loading_relationships.html#joined-eager-loading

@elemoine
Copy link
Member Author

I can add a backref to the relationship and a sentence to explain what it does.

I can also mention that the relationship is configured with the default lazy="select" strategy, with a link to the appropriate SQLA doc section.

And I think I'll stop there, to avoid rewriting the SQLA docs :)

Thanks for your suggestions!

@elemoine
Copy link
Member Author

I added more information. Will merge when the CI process is finished.

@elemoine elemoine merged commit 88bfa04 into master Apr 27, 2019
@elemoine elemoine deleted the ele_relationship-docs branch April 27, 2019 16:43
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.

How to do a spacial join?
2 participants