You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add FUNCTION tag parsing for index expressions with tests
This PR introduces support for a FUNCTION tag in index definitions to automatically build index expressions from function names and parameters when EXPRESSION is not provided. It adds unit tests to validate single- and multi-parameter functions, empty-parameter handling, and precedence of EXPRESSION over FUNCTION.
Key Changes
• Added FUNCTION tag parsing in parseFieldIndexes to synthesize EXPRESSION values from function names and parameters
• Filtered out empty parameters when building function expressions to avoid malformed SQL
• Added tests in schema/index_function_test.go for multiple function scenarios and EXPRESSION precedence
Affected Areas
• schema/index.go
• schema/index_function_test.go
• Schema.ParseIndexes() behavior via parseFieldIndexes
This summary was automatically generated by @propel-code-bot
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
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.
What did this pull request do?
Add FUNCTION tag support to simplify functional index creation
resolve #7700
User Case Description