Documentation
¶
Index ¶
- type ExprEvaluator
- type Processor
- func (p *Processor) FilterRows(ctx context.Context, w *dsl.WhereClause, rows []dsl.Row) ([]dsl.Row, error)
- func (p *Processor) Process(ctx context.Context, plan *dsl.QueryPlan, q *dsl.QueryDSL, rows []dsl.Row) (*dsl.QueryResult, error)
- func (p *Processor) ProcessInMemory(ctx context.Context, q *dsl.QueryDSL, rows []dsl.Row, applyWhere bool) (*dsl.QueryResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExprEvaluator ¶
type ExprEvaluator interface {
Eval(ctx context.Context, expr string, row map[string]any) (any, error)
}
ExprEvaluator evaluates DTL expressions against a row of data. Defined as an interface to decouple from the function registry.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor handles post-SQL in-memory operations: computed columns, expression-based filtering, sorting, and projection.
func NewProcessor ¶
func NewProcessor(eval ExprEvaluator) *Processor
NewProcessor creates a processor with the given expression evaluator. eval may be nil — computed columns and expr-based operations will return errors.
func (*Processor) FilterRows ¶
func (p *Processor) FilterRows(ctx context.Context, w *dsl.WhereClause, rows []dsl.Row) ([]dsl.Row, error)
FilterRows applies a full WHERE tree (simple/AND/OR/NOT/expr) in memory. Unlike Process, which only handles the expression-bearing residue of a SQL-pushed query, this evaluates every predicate — app sources use it because pushed filters are hints the app may have ignored.
func (*Processor) Process ¶
func (p *Processor) Process(ctx context.Context, plan *dsl.QueryPlan, q *dsl.QueryDSL, rows []dsl.Row) (*dsl.QueryResult, error)
Process applies in-memory operations to raw database rows based on the query plan.
func (*Processor) ProcessInMemory ¶
func (p *Processor) ProcessInMemory(ctx context.Context, q *dsl.QueryDSL, rows []dsl.Row, applyWhere bool) (*dsl.QueryResult, error)
ProcessInMemory runs the classic post-source pipeline entirely in memory over rows that did not come from SQL (app sources). applyWhere is false when the app verifiably applied every pushed filter. Columns are left to the caller — only rows and the pre-pagination total are produced.