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

Add req.query.elements #207

Merged
merged 8 commits into from
Oct 14, 2024
Merged

Add req.query.elements #207

merged 8 commits into from
Oct 14, 2024

Conversation

daogrady
Copy link
Contributor

@daogrady daogrady commented Aug 22, 2024

@daogrady daogrady changed the base branch from main to feat/cds-context-model2 August 22, 2024 13:01
@daogrady daogrady changed the title Add .model to cds.context Add req.query.elements Aug 22, 2024
@daogrady
Copy link
Contributor Author

@mariayord actually, looking at the changelog again, this doesn't seem to be a full CSN entry, but some CSN-esque representation of the selected properties. I was thinking cds.any, but that doesn't match up with the declarations in the changelog either. Do you know of a more fitting type?

@daogrady daogrady marked this pull request as draft August 22, 2024 13:04
export type Query = Partial<SELECT & INSERT & UPDATE & DELETE & CREATE & DROP & UPSERT>
export type Query = {
/** @since 7.4.0 */
elements: { [key: string]: Definition },
Copy link
Contributor Author

@daogrady daogrady Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value of cds.d.ts::EntityElements, but in linked

@@ -82,9 +82,9 @@ await srv.run([query, query])
await srv.run('SELECT * from Authors where name like ?', ['%Poe%'])
await srv.run('SELECT * from Authors where name like :name', { name: '%Poe%' })

srv.foreach({ SELECT: { from: { ref: ['Foo'] } } }, () => {})
srv.foreach({ SELECT: { from: { ref: ['Foo'] } }, elements: {} }, () => {})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this test case is relevant, why the elements are defined here ? It is also not documented https://cap.cloud.sap/docs/node.js/events#query

Copy link
Contributor Author

@daogrady daogrady Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this is missing from CAPire. It is mentioned in the relevant changelog. Could you please forward this gap internally to have the maintainer responsible for this change update the docs where you found it to be missing? Thanks!

Base automatically changed from feat/cds-context-model2 to main October 14, 2024 03:24
@daogrady daogrady marked this pull request as ready for review October 14, 2024 03:29
@daogrady daogrady enabled auto-merge (squash) October 14, 2024 03:29
@daogrady daogrady merged commit aa0f1ec into main Oct 14, 2024
7 checks passed
@daogrady daogrady deleted the feat/req-query-elements branch October 14, 2024 03:30
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