Documentation
¶
Overview ¶
Package queryexec executes immutable document-query plans.
Index ¶
- type Bindings
- type Cell
- type Column
- type Context
- type Error
- type ErrorKind
- type Options
- type Row
- type RowSet
- type Value
- func (v Value) Boolean() (bool, bool)
- func (v Value) Element() (*symbols.Symbol, bool)
- func (v Value) Integer() (int64, bool)
- func (v Value) Kind() ValueKind
- func (v Value) Magnitude() (Value, bool)
- func (v Value) Origin() provenance.Origin
- func (v Value) Quantity() (semantics.Quantity, bool)
- func (v Value) Real() (float64, bool)
- func (v Value) String() (string, bool)
- type ValueKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is one immutable projected value sequence.
func (Cell) Origin ¶
func (c Cell) Origin() provenance.Origin
Origin returns the selected model element behind the cell.
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column describes one ordered projected property.
func (Column) Origin ¶
func (c Column) Origin() provenance.Origin
Origin returns the query expression that projected the column.
type Error ¶
type Error struct {
Kind ErrorKind
Query string
Operation queryplan.Operation
Parameter string
Property string
Target string
Path []string
Expected string
Actual string
Origin provenance.Origin
// Cause is the evaluator's reason an unevaluable feature could not be read.
Cause error
}
Error is a typed query-execution failure with plan provenance.
type ErrorKind ¶
type ErrorKind string
ErrorKind classifies a document-query execution failure.
const ( ErrorInvalidContext ErrorKind = "invalid-context" ErrorUnknownBinding ErrorKind = "unknown-binding" ErrorMissingBinding ErrorKind = "missing-binding" ErrorBindingType ErrorKind = "binding-type" ErrorBindingMultiplicity ErrorKind = "binding-multiplicity" ErrorMissingElement ErrorKind = "missing-element" ErrorUnsupportedOperation ErrorKind = "unsupported-operation" ErrorInvalidArgument ErrorKind = "invalid-argument" ErrorInvalidOperator ErrorKind = "invalid-operator" ErrorInvalidOrder ErrorKind = "invalid-order" ErrorUnknownProperty ErrorKind = "unknown-property" ErrorUnknownClassification ErrorKind = "unknown-classification" ErrorUnknownRelationship ErrorKind = "unknown-relationship" ErrorUnevaluableFeature ErrorKind = "unevaluable-feature" ErrorUnknownInvocation ErrorKind = "unknown-invocation" ErrorInvocationCycle ErrorKind = "invocation-cycle" ErrorInvocationDepth ErrorKind = "invocation-depth" ErrorInvocationBudget ErrorKind = "invocation-budget" ErrorVisitBudget ErrorKind = "visit-budget" ErrorResultType ErrorKind = "result-type" ErrorResultMultiplicity ErrorKind = "result-multiplicity" ErrorColumnOperand ErrorKind = "column-operand" ErrorColumnOperandType ErrorKind = "column-operand-type" ErrorColumnDivisionByZero ErrorKind = "column-division-by-zero" ErrorColumnIncommensurable ErrorKind = "column-incommensurable" ErrorColumnArithmetic ErrorKind = "column-arithmetic" ErrorColumnAbsent ErrorKind = "column-absent" ErrorColumnCardinality ErrorKind = "column-cardinality" )
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row retains the selected element and its ordered projected cells.
func (Row) Origin ¶
func (r Row) Origin() provenance.Origin
Origin returns the selected element's declaration provenance.
type RowSet ¶
type RowSet struct {
// contains filtered or unexported fields
}
RowSet is an immutable ordered query result.
func Execute ¶
func Execute(program *queryplan.Program, context Context, bindings Bindings, options Options) (*RowSet, error)
Execute evaluates a compiled entry query into an immutable ordered row set.
func (*RowSet) Origin ¶
func (r *RowSet) Origin() provenance.Origin
Origin returns the entry query declaration.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is one immutable scalar carried through query execution.
func ElementValue ¶
ElementValue constructs an element value with declaration provenance.
func QuantityValue ¶ added in v0.6.0
QuantityValue constructs a quantity value from a magnitude in a unit; the quantity is deep-copied, so the value stays immutable.
func (Value) Magnitude ¶ added in v0.6.0
Magnitude returns a quantity value's magnitude as the bare integer or real value it is, and whether the value is a quantity.
func (Value) Origin ¶
func (v Value) Origin() provenance.Origin
Origin returns the source declaration behind the value.
func (Value) Quantity ¶ added in v0.6.0
Quantity returns an independent copy of the value's quantity and whether it is a quantity value.
type ValueKind ¶
type ValueKind string
ValueKind classifies one scalar query value.
const ( ValueElement ValueKind = "element" ValueString ValueKind = "string" ValueInteger ValueKind = "integer" ValueReal ValueKind = "real" ValueBoolean ValueKind = "boolean" ValueInfinity ValueKind = "infinity" // ValueQuantity is a magnitude in a measurement unit, `2290000 [kg]`. ValueQuantity ValueKind = "quantity" )