GetIndexesQuery: Exclude expression indexes at the database level. Fix #1188.#1262
Open
fdcastel wants to merge 1 commit intoFirebirdSQL:masterfrom
Open
GetIndexesQuery: Exclude expression indexes at the database level. Fix #1188.#1262fdcastel wants to merge 1 commit intoFirebirdSQL:masterfrom
fdcastel wants to merge 1 commit intoFirebirdSQL:masterfrom
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
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.
FbDatabaseModelFactory.GetIndexesusestable.Columns.Single(...)to look up index columns by name. Expression-based indexes (e.g.,COMPUTED BY (upper(col))) don't have real column entries inRDB$INDEX_SEGMENTS— their segment names don't match any table column — causingSingle()to throw "Sequence contains no matching element".Changes
FbDatabaseModelFactory.cs:
AND i.RDB$EXPRESSION_SOURCE IS NULLtoGetIndexesQueryto exclude expression indexes at the database level. Expression indexes can't be meaningfully represented in EF Core's scaffolded model anyway.reader.IsDBNull(3)andstring.IsNullOrEmpty()to skip indexes with no segments gracefully.ScaffoldingTests.cs:
ExpressionIndexDoesNotBreakScaffolding— Creates a table with an expression index and verifies scaffolding completes without throwing, and the expression index is excluded from the model.RegularIndexScaffoldedAlongsideExpressionIndex— Creates a table with both a regular and an expression index, verifying the regular index is scaffolded correctly while the expression index is excluded.