Help us shape the future of Go! Take the 2026 Go Developer Survey

processor

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL