-
Notifications
You must be signed in to change notification settings - Fork 288
Refactor GQLFilterParser.Parse to take input BaseQueryStructure
#975
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 71f7c3d.
aaronburtle
reviewed
Nov 11, 2022
abhishekkumams
approved these changes
Nov 17, 2022
Contributor
abhishekkumams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ayush3797
reviewed
Nov 17, 2022
src/Service/Resolvers/Sql Query Structures/SqlQueryStructure.cs
Outdated
Show resolved
Hide resolved
ayush3797
reviewed
Nov 17, 2022
ayush3797
approved these changes
Nov 17, 2022
Contributor
ayush3797
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Sean Leonard <sean.leonard@microsoft.com>
…/Azure/data-api-builder into dev/anmunde/nestedFilterRefactor
aaronburtle
approved these changes
Nov 17, 2022
Contributor
aaronburtle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
seantleonard
approved these changes
Nov 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why make this change?
What is this change?
GQLFilterParser.GQLFilterParser.Parseto include aBaseQueryStructureso that it can be called recursively for nested filters both for SQL and Cosmos. Currently, used only forCosmosby setting theDatabaseObject.NametoparentSourceName.NestedFilterFieldnamebefore each recursive call. Eventually resetting to_containerAliasonce back to the first caller inCosmosQueryEngineBaseSqlQueryStructureto the base classBaseQueryStructurewhich are useful for Cosmos too :EntityName= the entity name from the config,SourceAlias= the alias of the main entity being filtered used in the query that's generated (renamed fromTableAlias). Is thecontainerAliason the first instance of the call for Cosmos.MetadataProvider= either the Sql or Cosmos metadata provider (renamed fromSqlMetadataProvider)DatabaseObject= has the schema name and source nameAuthorizationResolver= useful to add DbPolicyPredicates for any of the entities used in the nested filterGQLFilterParsera singleton service dependent onISqlMetadataProvidersince we will (in a future PR) use the information from theMetadataProviderto obtainDatabaseObjectof the nested entity.GQLFilterParserandAuthorizationResolverto theBaseQueryStructureHow was this tested?