-
Notifications
You must be signed in to change notification settings - Fork 277
GraphQL Queries - Entities with self-joining relationships get expected responses #2138
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
Merged
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
551f436
Disallowing one reference column to reference multiple columns in ano…
ayush3797 879a740
Removing redundant relationship
ayush3797 0918e46
resolving conflicts
ayush3797 8cacda9
updating exception
ayush3797 2180adf
updating logic to take care of order of fk definitions
ayush3797 fa7b3c4
adding comment
ayush3797 bd49238
refactor
ayush3797 2b3df6a
saving progress
ayush3797 02d64b3
nits
ayush3797 d990c0b
adding summary
ayush3797 2307080
removing redundant fk definition
ayush3797 ae2217e
removing unused fn
ayush3797 325e258
Condensing conditions
ayush3797 92b1686
clarifying comments
ayush3797 c154ae5
Merge branch 'main' into dev/agarwalayush/removingWrongFK
ayush3797 9b938a4
Merge branch 'main' into dev/agarwalayush/removingWrongFK
ayush3797 dacc356
Update src/Core/Services/MetadataProviders/SqlMetadataProvider.cs
ayush3797 c2b7da0
Update src/Core/Services/MetadataProviders/SqlMetadataProvider.cs
ayush3797 bfa4146
Update src/Core/Services/MetadataProviders/SqlMetadataProvider.cs
ayush3797 67a8170
Adding tests
ayush3797 a3611bc
Adding tests
ayush3797 eec0ba8
saving progress
ayush3797 530c2db
Merge branch 'dev/agarwalayush/removingWrongFK' of https://github.com…
ayush3797 590373e
addressing review
ayush3797 9ab2bff
reverting conn string change
ayush3797 60b2568
removing unnecessary tests
ayush3797 fa9b335
reverting unnecessary change
ayush3797 9f11389
reverting config change
ayush3797 728d4b5
Adding method summary
ayush3797 f92b8fc
Merge branch 'main' into dev/agarwalayush/removingWrongFK
seantleonard 9d69d1c
nits
ayush3797 f296106
Merge branch 'dev/agarwalayush/removingWrongFK' of https://github.com…
ayush3797 1348cb6
add debugger displaynames to objects in DatabaseObject.cs classes to …
seantleonard f59b724
fix issues raised in #1940. Self joining table results in proper resu…
seantleonard 2b25bfa
Fixed self-joining relationship causing null values in response. Upda…
seantleonard 301bbcb
updated test asserts, updated logic to preserve old function for link…
seantleonard 5a09b5a
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard ccbbe6b
address review feedback for function and var naming. also removed err…
seantleonard bdb1692
revised comments.
seantleonard 0a4a975
Merge branch 'dev/sean/selfReferencingRelationship' of https://github…
seantleonard 3fe9564
fixing confusing conditional when validting whether any fk referencin…
seantleonard 194916a
accept merge conflict resolution suggestion.
seantleonard 6f42f52
updating linking table logic.
seantleonard 4da2040
merged main with conflict resolution
seantleonard 14b89bc
Resolved errors and only process self-join relationships (excluding t…
seantleonard 9a2c861
merge conflict resolution
seantleonard 2432c54
Update comments and summaries.
seantleonard 83e4afb
More comment clarification
seantleonard ac0f96a
fix unit tests to have newest field count and fix the expected/actual…
seantleonard d5ffdc5
merge main and resolved conflicts in sqlmetadataprovider
seantleonard 1c94d0f
formatting.
seantleonard f54afe0
updated config generators and config for dwsql/mssql plus db deploy f…
seantleonard 37cfec3
updated comment spelling.
seantleonard 6f339c0
update *sql-commands.txt to include "dbo_DimAccount" entity used for …
seantleonard 5dbed4a
updating *sql-commands.txt to have proper 'add' verb and also updated…
seantleonard a3c0fdd
update comments
seantleonard 21f1697
updated param / variable name used to represent subqueryTableAlias. I…
seantleonard fbd4c49
clarifying comments in AddJoinPredicatesForSelfJoinedEntity. and adde…
seantleonard eb9ae60
update to make comments accurate when processing relationships.
seantleonard a84c78e
update spacing
seantleonard 849cc46
clarifiying comments and spacing. added helper IsSelfJoiningRelations…
seantleonard 55f969a
fix verified file using output of CLI tool.
seantleonard 4cb2fbf
update tests to use mysql
seantleonard ba02f72
match config to dab cli output config for DimAccounts entity.
seantleonard a49a60b
pg add
seantleonard 6e5f4f4
adds fix from #2175 in order to get pg integration tests passing.
seantleonard 8e3d8c5
merge conflict resolution (just comments) for sqlmetadataprovider
seantleonard c442dc1
update verified tests for mysql and pg to support dbo_DimAccount
seantleonard 678f0dd
fix source name from DimAccount to dimaccount for both pg and mysql c…
seantleonard b333753
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard b71dd55
fix pg mysql scripts/verified.
seantleonard 44feab4
update to correct pg commands. Couldn't repro the error locally even …
seantleonard 5f016bc
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard 713704e
remove unused code and add comments to entityrelationshipkey specifiy…
seantleonard 82da84e
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard 71a4551
updated serialization tests to accommodate removed property.
seantleonard bbeb4a2
update comment for RelationshipRole and add newline to mssql config. …
seantleonard d3d705c
Merge branch 'dev/sean/selfReferencingRelationship' of https://github…
seantleonard d36936f
Fix comment grammar.
seantleonard 0cba4c4
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard 143dca7
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard 37fc3f6
added this change to consolidate the referencing/referenced columns …
seantleonard 8ea5283
Merge branch 'main' into dev/sean/selfReferencingRelationship
Aniruddh25 126738d
update npgsql per dotnet format verbose emitted package version issue.
seantleonard e1c4c49
update npgsql to 8.0.3 per https://github.com/advisories/GHSA-x9vc-6h…
seantleonard c16b32c
update npgsql to 7.0.7 to avoid jsonserialization error with 8+. also…
seantleonard 4de9a9b
Merge branch 'main' into dev/sean/selfReferencingRelationship
seantleonard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Diagnostics; | ||
|
||
namespace Azure.DataApiBuilder.Config.ObjectModel | ||
{ | ||
/// <summary> | ||
/// Identifies a specific value pair: | ||
/// 1. entity name | ||
/// 2. relationship name | ||
/// Which can be used to uniquely identify a relationship (ForeignKeyDefinition object(s)). | ||
/// </summary> | ||
[DebuggerDisplay("{EntityName} - {RelationshipName}")] | ||
public class EntityRelationshipKey | ||
seantleonard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
/// <summary> | ||
/// Source entity name which contains the relationship configuration. | ||
/// </summary> | ||
public string EntityName { get; set; } | ||
seantleonard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
public string RelationshipName { get; set; } | ||
seantleonard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
public EntityRelationshipKey(string entityName, string relationshipName) | ||
{ | ||
EntityName = entityName; | ||
RelationshipName = relationshipName; | ||
} | ||
|
||
public override bool Equals(object? other) | ||
{ | ||
return Equals(other as EntityRelationshipKey); | ||
} | ||
|
||
public bool Equals(EntityRelationshipKey? other) | ||
{ | ||
if (other == null) | ||
{ | ||
return false; | ||
} | ||
|
||
return EntityName.Equals(other.EntityName) && RelationshipName.Equals(other.RelationshipName); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return HashCode.Combine(EntityName, RelationshipName); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Azure.DataApiBuilder.Config.ObjectModel; | ||
|
||
/// <summary> | ||
/// Denotes the role of a referencing or referenced table in a relationship. | ||
/// Default value is None because the role is only resolved to help DAB | ||
/// create join predicates for self-referencing relationships. | ||
/// In non self-join relationships, DAB uses the ForeignKeyDefinition.RelationShipPair | ||
/// to determine the referencing/referenced entity. RelationShipPair isn't sufficient | ||
/// for self-join relationships because the DatabaseObjects used to represent the pair | ||
/// reference the same object: e.g. both Referenced/Referencing entity would point to 'dbo.MyTable' | ||
/// </summary> | ||
public enum RelationshipRole | ||
{ | ||
None, | ||
Source, | ||
seantleonard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Target, | ||
Linking | ||
} |
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 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 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 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.