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

Expressions - immutable parameter binding, pruning unbound conditions #602

Closed
andrus opened this issue Jan 15, 2023 · 0 comments
Closed
Assignees
Milestone

Comments

@andrus
Copy link
Contributor

andrus commented Jan 15, 2023

Would be great to be able to reuse parsed expressions with different parameter sets for performance. This should work not only with ExpRoot, but any expression (that would allow expression composition outside the parser).

Exp.positionalParams(Object...) // creates new instance
Exp.namedParams(Map) // creates new instance

Also would be nice to have a Cayenne-like feature, where unbound parameters result in pruning of the whole unbound condition within an expression:

Exp.namedParams(Map params, boolean pruneMissing) // creates new instance
@andrus andrus added this to the 5.0.M11 milestone Jan 15, 2023
@andrus andrus changed the title Expressions - immutable parameter binding Expressions - immutable parameter binding, pruning unbound conditions Jan 15, 2023
@andrus andrus removed this from the 5.0.M11 milestone Jan 27, 2023
m-dzianishchyts added a commit to m-dzianishchyts/agrest that referenced this issue Apr 11, 2023
* Remove ExpRoot node, so there is also no 'template' property (toString() can be used).
* Make parameter binding work with all expression nodes.
* Prune unused conditions during parameter binding.
andrus added a commit that referenced this issue Jul 29, 2023
…602

* fixing "in" handling - must be a binary expression, not an N+1 exp
* Merging ExpUtil to Exp, making it a public API operating on String paths and object values
* playing with API naming
* the PR overrides exception handling behavior. Restoring it (but in a cleaner way right in the parser)
* fixing semantics of the failing tests
@andrus andrus added this to the 5.0.M18 milestone Jul 29, 2023
@andrus andrus closed this as completed Jul 29, 2023
andrus added a commit that referenced this issue Jul 30, 2023
…602

* to keep manually-produced expressions similar to the parsed ones, we need
  to set the parent for each child node... And to preserve immutability,
  we need to deep-copy added children
andrus added a commit that referenced this issue Jul 30, 2023
…602

* fixing scalar list handling (toString, shallowCopy where broken)
* more tests
andrus added a commit that referenced this issue Jul 30, 2023
…602

* flattenning parameterized tests for readability and flexibility
andrus added a commit that referenced this issue Jul 30, 2023
…602

* ExpObjPath -> ExpPath (there's no other path in Agrest, this is not Cayenne)
andrus added a commit that referenced this issue Jul 30, 2023
…602

* AgExpressionParameter is redundant, ExpNamedParameter is all we need to model exp parameters
andrus added a commit that referenced this issue Jul 30, 2023
…602

* flattenning parameterized tests for readability and flexibility
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

No branches or pull requests

2 participants