environment

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TableKey = document.Path{document.PathFragment{FieldName: "$table"}}
	DocPKKey = document.Path{document.PathFragment{FieldName: "$pk"}}
)

Functions

This section is empty.

Types

type Environment

type Environment struct {
	Params  []Param
	Vars    *document.FieldBuffer
	Doc     types.Document
	DB      *database.Database
	Catalog *database.Catalog
	Tx      *database.Transaction

	Outer *Environment
}

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

func New

func New(d types.Document, params ...Param) *Environment

func (*Environment) Get

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

func (*Environment) GetCatalog

func (e *Environment) GetCatalog() *database.Catalog

func (*Environment) GetDB added in v0.14.0

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

func (*Environment) GetDocument

func (e *Environment) GetDocument() (types.Document, bool)

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) GetTx

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

func (*Environment) Set

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

func (*Environment) SetDocument

func (e *Environment) SetDocument(d types.Document)

func (*Environment) SetOuter

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

func (*Environment) SetParams

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

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