Documentation ¶
Overview ¶
Package engine implement an engine that can execute a command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the component that is used to evaluate commands.
func (Engine) Evaluate ¶
Evaluate evaluates the given command. This implicitly creates a transaction and attempts to submit it after the evaluation. To pass in an explicit transaction, call EvaluateInTransaction.
func (Engine) EvaluateInTransaction ¶
EvaluateInTransaction will evaluate the given command within the given transaction. The caller is responsible for submitting the transaction.
func (Engine) LoadTable ¶
LoadTable loads a table with the given name from secondary storage. Only table meta information, such as column information are loaded into memory. No rows are read from disk by calling this method. To check whether a table with a given name exists in the currently loaded database, call HasTable.
type Error ¶
type Error string
Error is a sentinel error.
const ( // 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" // ErrAlreadyExists indicates, that whatever was meant to be created, already // exists, and therefore, the new thing cannot be created. ErrAlreadyExists Error = "already exists" )
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 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) IntermediateRow ¶
func (c ExecutionContext) IntermediateRow(row table.RowWithColInfo) ExecutionContext
IntermediateRow sets the current intermediate row that might be needed for evaluating expressions in the context, and returns the context.
func (ExecutionContext) String ¶
func (c ExecutionContext) String() string
type Inserter ¶
Inserter describes a component in which a row can be inserted. Tables may implement this interface, if they allow insertion.
type Namer ¶
type Namer interface {
Name() string
}
Namer wraps the simple method Name, which returns the name of the implementing component. Tables may implement this interface, if they are named.
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().
func WithTransactionManager ¶
func WithTransactionManager(txmgr transaction.Manager) Option
WithTransactionManager sets a transaction manager that will be used by the engine to start and submit transactions.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table is a representation of an on-disk table used by the engine. It is an intermediate layer to access and manipulate data inside the table's pages.
func (*Table) Cols ¶
Cols returns the column information of this table as a slice of projectedColumns.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package page describes generic pages.
|
Package page describes generic pages. |
Package profile implements profiling with generic events.
|
Package profile implements profiling with generic events. |
Package types provides a type system for the add engine.
|
Package types provides a type system for the add engine. |