-
Notifications
You must be signed in to change notification settings - Fork 8
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
[FEATURE] fully-typed orderBy #227
Comments
@daogrady Do you many know? thanks! |
Hi Petr, can you please show the code of what you have tried so far to illustrate the issue? Thanks! Best, P.S.: no need to ping us individually, all relevant maintainers receive a notification when a new issue is opened. |
@daogrady indeed So from what I see in the types - it is only possible to provide string array to orderby: However what I would like to do is something like:
or may be something like :
So if we'll be able to operate with types instead of the strings - that would help us to prevent possible errors during the runtime when non existing fields are used for ordering for example. So here is the proposal for the sorter function:
So we reach following goals:
What do you think of this proposal? |
Hi Petr, that sounds like a reasonable addition. I will see if this fits in with a current rework of the QL types. Also, I have transferred this issue over to cds-types too, as this is only related to how the cds runtime handles input and what kind of overloads are being offered and is unrelated to the generation of type information for the CDS model (cds-typer). Best, |
thanks for transferring. Can we also change labels, since is now more like a feature proposal? |
Question
Hi!
I want to implement the order when selecting from the generated entity. It works well for building the projection and filtering, however I'm struggling to udnerstand what should be the sorting pattern. So far I'm only able to provide fields as a string, which is OK but would be better to use types somehow. Thanks!
The text was updated successfully, but these errors were encountered: