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

Keypath substitution in queries #7033

Closed
astigsen opened this issue Oct 5, 2023 · 1 comment
Closed

Keypath substitution in queries #7033

astigsen opened this issue Oct 5, 2023 · 1 comment
Assignees

Comments

@astigsen
Copy link
Contributor

astigsen commented Oct 5, 2023

Currently all keypaths used in queries has to be specified in full and has to match the schema to not give an error. This is a problem for enabling search on dynamic properties, and in general makes it hard to adapt queries to less predictable scenarios.

NSPredicates solves this by allowing you to substitute keypaths using the %K identifier:

"%K == %@"
pass a string variable to %K, it will be represented as a keypath, then check if it’s value is equal to value passed in

We should allow the same in RQL. Since our substitution syntax is slightly different (using $<pos> instead of %@) we might want to use a simple annotation to signify that this substitution should be interpreted as a keypath (like $<pos>k).

Part of #2978

@jedelbo
Copy link
Contributor

jedelbo commented Feb 21, 2024

Fixed by #7210

@jedelbo jedelbo closed this as completed Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants