environment

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	Params []Param
	Vars   *object.FieldBuffer
	Row    database.Row
	DB     *database.Database
	Tx     *database.Transaction

	Outer *Environment
	// contains filtered or unexported fields
}

Environment contains information about the context in which the expression is evaluated.

func New

func New(r database.Row, params ...Param) *Environment

func (*Environment) Get

func (e *Environment) Get(path object.Path) (v types.Value, ok bool)

func (*Environment) GetDB

func (e *Environment) GetDB() *database.Database

func (*Environment) GetOuter

func (e *Environment) GetOuter() *Environment

func (*Environment) GetParamByIndex

func (e *Environment) GetParamByIndex(pos int) (types.Value, error)

func (*Environment) GetParamByName

func (e *Environment) GetParamByName(name string) (v types.Value, err error)

func (*Environment) GetRow

func (e *Environment) GetRow() (database.Row, bool)

func (*Environment) GetTx

func (e *Environment) GetTx() *database.Transaction

func (*Environment) Set

func (e *Environment) Set(path object.Path, v types.Value)

func (*Environment) SetOuter

func (e *Environment) SetOuter(env *Environment)

func (*Environment) SetParams

func (e *Environment) SetParams(params []Param)

func (*Environment) SetRow

func (e *Environment) SetRow(r database.Row)

func (*Environment) SetRowFromObject

func (e *Environment) SetRowFromObject(o types.Object)

type Param

type Param struct {
	// Name of the param
	Name string

	// Value is the parameter value.
	Value interface{}
}

A Param represents a parameter passed by the user to the statement.

Jump to

Keyboard shortcuts

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