Documentation ¶
Overview ¶
Package engine implement an engine that can execute a command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ToNumericValue ¶
ToNumericValue checks whether the given string is of this form https://www.sqlite.org/lang_expr.html#literal_values_constants_ . If it is, an appropriate value is returned (either types.IntegerValue or types.RealValue). If it is not, false will be returned. This will never return the NULL value, even if the given string is empty. In that case, nil and false is returned.
Types ¶
type Col ¶
Col is a header for a single column in a table, containing the qualified name of the col, a possible alias and the col data type.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the component that is used to evaluate commands.
type Error ¶
type Error string
Error is a sentinel error.
const ( // ErrClosed indicates that the component can not be used anymore, because // it already has been closed. ErrClosed Error = "already closed" // ErrUnsupported indicates that a requested feature is explicitely not // supported. This is different from ErrUnimplemented, since // ErrUnimplemented indicates, that the feature has not been implemented // yet, while ErrUnsupported indicates, that the feature is intentionally // unimplemented. ErrUnsupported Error = "unsupported" )
func ErrNoSuchColumn ¶
ErrNoSuchColumn returns an error indicating that a requested column is not contained in the current result table.
func ErrNoSuchFunction ¶
ErrNoSuchFunction returns an error indicating that a function with the given name can not be found.
func ErrUncomparable ¶
ErrUncomparable returns an error indicating that the given type does not implement the types.Comparator interface, and thus, values of that type cannot be compared.
func ErrUnimplemented ¶
func ErrUnimplemented(what interface{}) Error
ErrUnimplemented returns an error indicating a missing implementation for the requested feature. It may be implemented in the next version.
type Evt ¶
type Evt string
Evt is an event this engine uses.
const ( // EvtEvaluate is the event 'evaluate'. This is used for every call to // 'Evaluate' (exported), and is used to measure the total amount of time it // takes the database to evaluate a command. EvtEvaluate Evt = "evaluate" // EvtCompare is the event 'compare'. This is used for every comparison // (with 'cmp') of two values that is performed. EvtCompare Evt = "compare" )
type ExecutionContext ¶
type ExecutionContext struct {
// contains filtered or unexported fields
}
ExecutionContext is a context that is passed down throughout a complete evaluation. It may be populated further.
func (ExecutionContext) String ¶
func (c ExecutionContext) String() string
type Option ¶
type Option func(*Engine)
Option is an option that can is applied to an Engine on creation.
func WithLogger ¶
WithLogger specifies a logger for the Engine.
func WithProfiler ¶
WithProfiler passes a profiler into the engine. The default for the engine is not using a profiler at all.
func WithRandomProvider ¶
func WithRandomProvider(rp randomProvider) Option
WithRandomProvider sets a random provider, which will be used by the engine to evaluate expressions, that require a random source, such as the function RANDOM().
func WithTimeProvider ¶
func WithTimeProvider(tp timeProvider) Option
WithTimeProvider sets a time provider, which will be used by the engine to evaluate expressions, that require a timestamp, such as the function NOW().
type ParameterizedEvt ¶
type ParameterizedEvt struct { // Name is the name of the event. Name string // Param is the parameterization of the event. Param string }
ParameterizedEvt is a parameterized event, which will be printed in the form Name[Param].
func EvtFullTableScan ¶
func EvtFullTableScan(tableName string) ParameterizedEvt
EvtFullTableScan creates an event 'full table scan[table=<tableName>]'.
func (ParameterizedEvt) String ¶
func (e ParameterizedEvt) String() string
type Table ¶
Table is a one-dimensional collection of Rows.
func (Table) FilterRows ¶
FilterRows filteres this table's rows according to the given keep function. Rows for which the given function returns true and no error, will be copied over to a new table, which will then be returned. The keep function is fed with one row at a time, but always all columns from the original table, to facilitate checking values by index.
func (Table) HasColumn ¶
HasColumn inspects the table's columns and determines whether the table has any column, that has the given name as qualified name OR as alias.
func (Table) RemoveColumn ¶
RemoveColumn works on a copy of the table, and removes the column with the given index from the copy. After removal, the copy is returned.
func (Table) RemoveColumnByQualifiedName ¶
RemoveColumnByQualifiedName will remove the first column with the given qualified name from the table, and return the new table. The original table will not be modified. If no such column exists, the original table is returned.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package profile implements profiling with generic events.
|
Package profile implements profiling with generic events. |
Package storage implements support for the file format of add.
|
Package storage implements support for the file format of add. |
page
Package page describes generic pages.
|
Package page describes generic pages. |
Package types provides a type system for the add engine.
|
Package types provides a type system for the add engine. |