stmtctx

package
v0.0.0-...-959c02d Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WarnLevelError represents level "Error" for 'SHOW WARNINGS' syntax.
	WarnLevelError = "Error"
	// WarnLevelWarning represents level "Warning" for 'SHOW WARNINGS' syntax.
	WarnLevelWarning = "Warning"
	// WarnLevelNote represents level "Note" for 'SHOW WARNINGS' syntax.
	WarnLevelNote = "Note"
)

Variables

View Source
var (
	ErrIDExhaust = errors.New("id exhaust")
)

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context represent the intermediate state of a query execution and will be reset after a query finished.

func New

func New(store kv.Storage, catalog *catalog.Catalog) *Context

New returns a session statement context instance.

func (*Context) AllocID

func (sc *Context) AllocID(graph *catalog.Graph, n int) (*IDRange, error)

AllocID allocates n IDs.

func (*Context) AllocPlanColumnID

func (sc *Context) AllocPlanColumnID() int64

func (*Context) AllocPlanID

func (sc *Context) AllocPlanID() int

func (*Context) AppendError

func (sc *Context) AppendError(warn error)

AppendError appends a warning with level 'Error'.

func (*Context) AppendNote

func (sc *Context) AppendNote(warn error)

AppendNote appends a warning with level 'Note'.

func (*Context) AppendWarning

func (sc *Context) AppendWarning(warn error)

AppendWarning appends a warning with level 'Warning'.

func (*Context) AppendWarnings

func (sc *Context) AppendWarnings(warns []SQLWarn)

AppendWarnings appends some warnings.

func (*Context) Catalog

func (sc *Context) Catalog() *catalog.Catalog

Catalog returns the catalog object.

func (*Context) CurrentGraph

func (sc *Context) CurrentGraph() *catalog.Graph

CurrentGraph returns the current chosen catalog graph

func (*Context) CurrentGraphName

func (sc *Context) CurrentGraphName() string

CurrentGraphName returns the current chosen graph name.

func (*Context) Reset

func (sc *Context) Reset()

Reset resets all variables associated to execute a query.

func (*Context) SetCurrentGraphName

func (sc *Context) SetCurrentGraphName(graphName string)

SetCurrentGraphName changes the current graph name.

func (*Context) Store

func (sc *Context) Store() kv.Storage

Store returns the storage instance.

func (*Context) Txn

func (sc *Context) Txn() *LazyTxn

Txn returns the transaction object.

type IDRange

type IDRange struct {
	// contains filtered or unexported fields
}

IDRange represents an ID range. The ID range will be (base, max]

func NewIDRange

func NewIDRange(base, max int64) *IDRange

NewIDRange returns a new ID range.

func (*IDRange) Next

func (r *IDRange) Next() (int64, error)

Next retrieves the next available ID.

type LazyTxn

type LazyTxn struct {
	// contains filtered or unexported fields
}

type SQLWarn

type SQLWarn struct {
	Level string
	Err   error
}

SQLWarn relates a sql warning and it's level.

Jump to

Keyboard shortcuts

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