feat(preload): Add support for custom SQL joins

* Introduce SqlJoins and JoinAliases in PreloadOption.
* Preserve SqlJoins and JoinAliases during filter processing.
* Implement logic to apply custom SQL joins in handler.
* Add tests for SqlJoins handling and join alias extraction.
This commit is contained in:
Hein
2026-01-29 09:37:09 +02:00
parent defe27549b
commit 17239d1611
5 changed files with 173 additions and 1 deletions

View File

@@ -52,6 +52,10 @@ type PreloadOption struct {
PrimaryKey string `json:"primary_key"` // Primary key of the related table
RelatedKey string `json:"related_key"` // For child tables: column in child that references parent
ForeignKey string `json:"foreign_key"` // For parent tables: column in current table that references parent
// Custom SQL JOINs from XFiles - used when preload needs additional joins
SqlJoins []string `json:"sql_joins"` // Custom SQL JOIN clauses
JoinAliases []string `json:"join_aliases"` // Extracted table aliases from SqlJoins for validation
}
type FilterOption struct {