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

Massively simplify join logic #729

Merged
merged 3 commits into from
Feb 17, 2025
Merged

Massively simplify join logic #729

merged 3 commits into from
Feb 17, 2025

Conversation

laundmo
Copy link
Contributor

@laundmo laundmo commented Feb 4, 2025

I stumbled across this while investigating why the dal generated a cross join when i wanted a left join.

This PR adds a check to this, raising a ValueError if a joins ON condition doesn't contain the table name at all (very naive, but should catch the mistake in almost all cases)

It also vastly simplifies the join code, by collecting all the required info beforehand and deduplicating the join building.

@laundmo
Copy link
Contributor Author

laundmo commented Feb 4, 2025

Ah, of course my naive check for "hey, use an alias here!" fails for self-referencing tables... but i think i can check for that? sure.

@mdipierro mdipierro merged commit ea174b2 into web2py:master Feb 17, 2025
6 checks passed
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.

2 participants