vm

package
v0.0.0-...-0807726 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 License: MIT Imports: 7 Imported by: 0

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