plan

package
v0.0.0-...-b63205b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plan

type Plan interface {
	// Do iterates records and applies plan logic to the result set.
	// TODO: only get id or some fields.
	Do(ctx context.Context, f RowIterFunc) error
	// Explain the plan.
	Explain(w format.Formatter)
	// GetFields returns the result field list for a plan.
	GetFields() []*field.ResultField
	// Filter try to use index plan to reduce the result set.
	// If index can be used, a new index plan is returned, 'filtered' is true.
	// If no index can be used, the original plan is returned and 'filtered' return false.
	Filter(ctx context.Context, expr expression.Expression) (p Plan, filtered bool, err error)
}

Plan is the interface of query execution plan.

type Planner

type Planner interface {
	// Plan function returns Plan.
	Plan(ctx context.Context) (Plan, error)
}

Planner is implemented by any structure that has a Plan method.

type RowIterFunc

type RowIterFunc func(id interface{}, data []interface{}) (more bool, err error)

RowIterFunc is the callback for iterating records.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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