Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDSLQuery ¶
BuildDSLQuery validates a DSL query against the app registry and returns a core query builder. Includes are validated; callers can resolve eager loading separately until relationship joins are fully generated.
Types ¶
type DSLQuery ¶
type DSLQuery struct {
Entity string
Filters []DSLFilter
Includes []string
Orders []DSLOrder
Limit int
After string
}
DSLQuery is the parsed representation of a GoFastr query DSL string.
func ParseDSL ¶
ParseDSL parses strings like:
Post.where(status="published").include(author).order(created_at DESC).limit(10)
Results are cached by input string. The cache is bounded to 256 entries; when full, a single randomly-chosen entry is evicted (Go map iteration is randomised, so the first key returned by `range` is effectively random, this is not LRU).
The returned DSLQuery is caller-isolated: the cache stores the canonical copy and every call (hit or miss) returns a shallow copy with fresh Filters/Includes/Orders slices, the HooksFor posture. A value-typed result invites callers to adjust it in place; sharing the cached backing arrays would turn one caller's edit into every later caller's answer.