-
Notifications
You must be signed in to change notification settings - Fork 21
chore: re-write filter at from.at(-1) into queries where
#1373
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
Conversation
this is a preparation for #1361 and it also makes our lifes easier as the infix filter at this place is semantically equivalent to a regular `where` clause.
| expect(query).to.deep.equal( | ||
| cds.ql`SELECT from bookshop.Books as Books {Books.ID} | ||
| WHERE (Books.price > 5) and (Books.price < 12.13) | ||
| WHERE Books.price < 12.13 and Books.price > 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only wrap in parens if really needed
| } | ||
| WHERE EXISTS ( | ||
| SELECT 1 from bookshop.Books as $B where $B.author_ID = $a.ID | ||
| SELECT 1 from bookshop.Books as $B2 where $B2.author_ID = $a.ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alias order changes because infix filter at leaf are put at the very front of the queries where
| //(SMW) TODO I'd prefer to have the cond from the filter before the cond coming from the WHERE | ||
| // which, by the way, is the case in tests below where we have a path in FROM -> ??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done according to your wish @stewsk
this is a preparation for #1361 and it also makes our lifes easier as the infix filter at this place is semantically equivalent to a regular
whereclause.