vm

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SqlEvalError = fmt.Errorf("Could not evaluate sql statement")
)

Functions

This section is empty.

Types

type SqlVm

type SqlVm struct {
	Statement expr.SqlStatement
	Keyword   lex.TokenType
	// contains filtered or unexported fields
}

SqlVm vm is a vm for parsing, evaluating a

func NewSqlVm

func NewSqlVm(sqlText string) (*SqlVm, error)

SqlVm parsers a sql query into columns, where guards, etc

func (*SqlVm) Execute

func (m *SqlVm) Execute(writeContext datasource.ContextWriter, readContext datasource.ContextReader) (err error)

Execute applies a parse expression to the specified context's

writeContext in the case of sql query is similar to a recordset for selects,
  or for delete, insert, update it is like the storage layer

func (*SqlVm) ExecuteDelete

func (m *SqlVm) ExecuteDelete(writeContext datasource.ContextWriter, readContext datasource.ContextReader) (err error)

func (*SqlVm) ExecuteInsert

func (m *SqlVm) ExecuteInsert(writeContext datasource.RowWriter) (err error)

func (*SqlVm) ExecuteSelect

func (m *SqlVm) ExecuteSelect(writeContext datasource.ContextWriter, readContext datasource.ContextReader) (err error)

Execute applies a dml sql select expression to the specified context's

writeContext in the case of sql query is similar to a recordset for selects,
  or for delete, insert, update it is like the storage layer

Jump to

Keyboard shortcuts

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