Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embed ¶
type Embed struct {
Relation string
Items []SelectItem
}
Embed describes a nested relation projection. Populated in Phase 4.
type FilterGroup ¶
type FilterGroup struct {
Op LogicalOp
Nodes []FilterNode
}
FilterGroup combines child nodes under a logical connective.
type FilterNode ¶
type FilterNode interface {
// contains filtered or unexported methods
}
FilterNode is a node in the filter tree: either a Predicate (leaf) or a FilterGroup (branch). The sealing method keeps the union closed to this package.
type Operator ¶
type Operator int
Operator is a PostgREST-style filter operator.
const ( OpEq Operator = iota + 1 OpNeq OpGt OpGte OpLt OpLte OpLike OpILike OpIn OpIs // OpCs / OpCd are JSON / array containment, matching PostgREST. // Backed by Postgres `@>` / `<@` for jsonb and array columns, and // MySQL JSON_CONTAINS for json columns. Other column types are // rejected at SQL build time. OpCs OpCd )
type Predicate ¶
Predicate is a leaf filter expression of the form "column op value". For OpIn the Value is the comma-separated list with the surrounding parentheses already stripped. For OpIs the Value is one of "null", "true", "false".
type Query ¶
type Query struct {
Select []SelectItem
Filter FilterNode
Order []OrderItem
Limit *int
Offset *int
}
Query is the parsed form of a single request's query parameters. It carries only syntactic shape; identifier validation against the schema and limit clamping are the caller's responsibility.
func Parse ¶
Parse converts url.Values into a Query. It only enforces syntactic shape: identifier validation against the schema and limit clamping are the caller's responsibility.
Reserved keys: select, order, limit, offset, and, or. Every other key is treated as a column filter; multiple values for the same column are combined with logical AND, the same way multiple distinct filter keys are combined.
type SelectItem ¶
SelectItem is one element of a select clause. Phase 3 fills only Column (a flat column name or "*"); Alias and Embed are reserved for Phase 4 relation embedding.