Create IN filter expressions for subqueries#1920
Merged
dereuromark merged 5 commits intopropelorm:masterfrom Dec 19, 2022
Merged
Create IN filter expressions for subqueries#1920dereuromark merged 5 commits intopropelorm:masterfrom
dereuromark merged 5 commits intopropelorm:masterfrom
Conversation
dereuromark
reviewed
Dec 8, 2022
src/Propel/Runtime/ActiveQuery/Criterion/AbstractInnerQueryCriterion.php
Outdated
Show resolved
Hide resolved
36eaf51 to
19cd3ab
Compare
Codecov ReportBase: 73.25% // Head: 88.34% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1920 +/- ##
=============================================
+ Coverage 73.25% 88.34% +15.08%
- Complexity 7917 7942 +25
=============================================
Files 227 230 +3
Lines 21133 21201 +68
=============================================
+ Hits 15480 18729 +3249
+ Misses 5653 2472 -3181
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
asmarovydlo
reviewed
Dec 12, 2022
src/Propel/Runtime/ActiveQuery/Criterion/AbstractInnerQueryCriterion.php
Outdated
Show resolved
Hide resolved
asmarovydlo
approved these changes
Dec 16, 2022
asmarovydlo
reviewed
Dec 16, 2022
Contributor
Author
|
PR for documentation is at propelorm/propelorm.github.com#429 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows to create IN queries like
WHERE column IN (SELECT otherColumn FROM ...).It can be done by using the
filterBy()methods:which will generate a statement like:
For known relations, there are
useInQuery()methods which work similar as theuseQuery()methods:Propel creates convenience methods for existing relations on query classes like
AuthorQuery::useInBookQuery(), which is easier to use thanuseInQuery('Book').NOT INqueries are created by passingCRITERIA::NOT_INtofilterBy()or theuseNotInQuery()method.I have build a similar thing for
EXISTS, so this is mostly just abstracting from that.