-
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
Added ability to auto-generate bind variable keys and specify filter logic #50
base: main
Are you sure you want to change the base?
Added ability to auto-generate bind variable keys and specify filter logic #50
Conversation
… output on-demand instead of during construction.
…erate strings when query string is built
…se newer System.Assert methods
…gregateQueryFilter class
…lters the same as WHERE filters
Hi @superkensington - I've been reviewing your changes & testing things out, and I'm planning to make a few additional commits to the PR, including:
One area I'm still struggling with conceptually - I can't think of a use case where I would want to actually specify a bind variable's key (or remove/clear keys). It creates more work for anyone building a query, so it feels like it would be better for the bind keys to always be auto-generated (when using bind variables). Can you think of a use case where someone needs to specify the bind key's variable, instead of having it be auto-generated? My thought is...
This would indicate at the time of instantiating a query if binds should be (automatically) used, which then simplifies other things a good bit. Let me know what you think - I'm happy to make these changes if you think that makes sense. |
Makes sense 👍
With the addition of automatically generating the keys those methods definitely are no longer necessary and I agree that they can be removed.
This all sounds good to me; have at it! |
Adds ability to auto-generate bind variable keys by invoking new
generateBindVariableKeys
method on anAggregateQuery
orQuery
instance. Extends updates made in PR #49.As a nice consequence of changes made, also adds ability to specify custom filter logic.
Query filters are now stored as a list of QueryFilter instances instead of Strings, allowing for the ability to invoke 'generateBindVariableKeys' at any point. Consequently, filter logic is now explicitly defined and used at the time of overall filter string generation rather than being included at the time a filter is added to the Query.
NOTE -- due to the change in the way the overall filter string in constructed I had to remove the overall sorting of the filters, but did leave the sorting of "OR" filters since that doesn't interfere. If the sorting is important to keep, a different approach to filter structure and logic would need to be taken to allow for it.