mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-15 23:44:26 +00:00
feat(restheadspec): ✨ Add support for join aliases in filters and sorts
- Extract join aliases from custom SQL JOIN clauses. - Validate join aliases for filtering and sorting operations. - Update documentation to reflect new functionality. - Enhance tests for alias extraction and usage.
This commit is contained in:
@@ -166,6 +166,14 @@ func SanitizeWhereClause(where string, tableName string, options ...*RequestOpti
|
||||
logger.Debug("Added preload relation '%s' as allowed table prefix", options[0].Preload[pi].Relation)
|
||||
}
|
||||
}
|
||||
|
||||
// Add join aliases as allowed prefixes
|
||||
for _, alias := range options[0].JoinAliases {
|
||||
if alias != "" {
|
||||
allowedPrefixes[alias] = true
|
||||
logger.Debug("Added join alias '%s' as allowed table prefix", alias)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Split by AND to handle multiple conditions
|
||||
|
||||
Reference in New Issue
Block a user