Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateExpr ¶ added in v0.3.0
type ComparisonNode ¶
type JoinNode ¶ added in v0.5.0
type JoinNode struct {
Table string // joined table
Type JoinType // INNER / LEFT
On string // raw, already-qualified ON expression, e.g. `"orders"."user_id" = "users"."id"`
}
JoinNode is a single JOIN clause in a projection SELECT.
type JoinType ¶ added in v0.5.0
type JoinType int
JoinType is the kind of SQL join used in a projection.
type NullsOrder ¶ added in v0.5.0
type NullsOrder int
NullsOrder controls placement of NULL values within an ORDER BY clause. NullsDefault omits the clause and lets the database apply its default (Postgres: NULLS LAST for ASC, NULLS FIRST for DESC; SQLite: NULLS FIRST for ASC, NULLS LAST for DESC).
const ( NullsDefault NullsOrder = iota NullsFirst NullsLast )
type OrderByExpr ¶
type OrderByExpr struct {
Column string
Direction Direction
Nulls NullsOrder
}
type PartitionLimit ¶ added in v0.5.0
type PartitionLimit struct {
PartitionBy string // foreign-key column to partition by
OrderBy []OrderByExpr // ordering within each partition (defaults to PK at the call site)
Limit int // rows kept per partition
}
PartitionLimit requests a per-partition row cap rendered with a window function (ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...)). It is used by the relationship loader to apply Include Limit(n) per parent rather than across the whole batch. When set, the emitter wraps the base SELECT and keeps only rows whose row number is <= Limit.
type SelectNode ¶
type SelectNode struct {
Table string
Columns []string
Where *WhereClause
OrderBy []OrderByExpr
Limit *int
Offset *int
Type QueryType
GroupBy []string
Having *WhereClause
Aggregates []AggregateExpr
PartitionLimit *PartitionLimit
Distinct bool
Joins []JoinNode
}
type WhereClause ¶
type WhereClause struct {
Comparison *ComparisonNode
LogicalOp LogicalOp
Children []WhereClause
Raw *string
RawArgs []any
}