-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: assoc-like calc elements after exists predicate #831
Conversation
Association like calculated elements have been re-written by the compiler they essentially behave like unmanaged associations as their calculations have been incorporated into an on-condition which is handled elsewhere → We don't need to treat them any different than a regular unmanaged association.
it('exists cannot leverage calculated elements which is an expression', () => { | ||
// at the leaf of a where exists path, there must be an association | ||
expect(() => cqn4sql(CQL`SELECT from booksCalc.Books { ID } where exists authorFullName`, model)).to.throw( | ||
`Expecting path “authorFullName” following “EXISTS” predicate to end with association/composition, found “expression”`, |
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.
Should we just omit the , found “expression”
suffix, if the type cannot be determined?
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.
I would like most ', found an expression` , but that probably doesn't fit the msg schema.
But I think the information that it is an expression (and not a string) is helpful, so I wouldn't drop it
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.
I can do it, why not use the nice prosa :)
it('exists cannot leverage calculated elements which is an expression', () => { | ||
// at the leaf of a where exists path, there must be an association | ||
expect(() => cqn4sql(CQL`SELECT from booksCalc.Books { ID } where exists authorFullName`, model)).to.throw( | ||
`Expecting path “authorFullName” following “EXISTS” predicate to end with association/composition, found “expression”`, |
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.
I would like most ', found an expression` , but that probably doesn't fit the msg schema.
But I think the information that it is an expression (and not a string) is helpful, so I wouldn't drop it
🤖 I have created a release *beep* *boop* --- <details><summary>db-service: 1.14.0</summary> ## [1.14.0](db-service-v1.13.0...db-service-v1.14.0) (2024-10-15) ### Added * assoc-like calc elements after exists predicate ([#831](#831)) ([05f7d75](05f7d75)) ### Fixed * Improved behavioral consistency between the database services ([#837](#837)) ([b6f7187](b6f7187)) * Treat assoc-like calculated elements as unmanaged assocs ([#830](#830)) ([cbe0df7](cbe0df7)) </details> <details><summary>sqlite: 1.7.4</summary> ## [1.7.4](sqlite-v1.7.3...sqlite-v1.7.4) (2024-10-15) ### Fixed * Improved behavioral consistency between the database services ([#837](#837)) ([b6f7187](b6f7187)) </details> <details><summary>postgres: 1.10.1</summary> ## [1.10.1](postgres-v1.10.0...postgres-v1.10.1) (2024-10-15) ### Fixed * add cds schema for postgres build plugin ([#843](#843)) ([6306d5c](6306d5c)) * Improved behavioral consistency between the database services ([#837](#837)) ([b6f7187](b6f7187)) * null as default value ([#845](#845)) ([0041ec0](0041ec0)) </details> <details><summary>hana: 1.3.1</summary> ## [1.3.1](hana-v1.3.0...hana-v1.3.1) (2024-10-15) ### Fixed * combination of groupby and orderby ([#825](#825)) ([10e0534](10e0534)) * Improved behavioral consistency between the database services ([#837](#837)) ([b6f7187](b6f7187)) * list optimization for `Buffer` values ([#817](#817)) ([3e60de2](3e60de2)) * null as default value ([#845](#845)) ([0041ec0](0041ec0)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Johannes Vogel <johannes.vogel@sap.com>
as documented in #830, assoc-like calculated elements are re-written by the compiler to include the calculation directives in their on-conditions. Hence, we can allow those assoc-like calculated elements everywhere, where unmanaged associations can be used:
exists
predicatethis PR implements 1. and 2.