ql

package
v0.0.0-...-a414206 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// syntax tree node types
	QL_UNINIT = 0
	QL_STR    = table.TYPE_BYTES
	QL_I64    = table.TYPE_INT64
	QL_CMP_GE = 10 // >=
	QL_CMP_GT = 11 // >
	QL_CMP_LT = 12 // <
	QL_CMP_LE = 13 // <=
	QL_CMP_EQ = 14 // ==
	QL_CMP_NE = 15 // !=
	QL_ADD    = 20
	QL_SUB    = 21
	QL_MUL    = 22
	QL_DIV    = 23
	QL_MOD    = 24
	QL_AND    = 30
	QL_OR     = 31
	QL_NOT    = 50
	QL_NEG    = 51
	QL_SYM    = 100
	QL_TUP    = 101 // tuple
	QL_STAR   = 102 // select *
	QL_ERR    = 200 // error; from parsing or evaluation
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

type QLCreateTable

type QLCreateTable struct {
	Def table.TableDef
}

type QLDelete

type QLDelete struct {
	QLScan
}

type QLEvalContext

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

evaluating expressions

type QLInsert

type QLInsert struct {
	Table  string
	Mode   int
	Names  []string
	Values [][]QLNODE
}

smt: insert

type QLNODE

type QLNODE struct {
	Value
	Kids []QLNODE //operands
}

tree node

type QLResult

type QLResult struct {
	Records RecordIter
	Added   uint64
	Updated uint64
	Deleted uint64
}

type QLScan

type QLScan struct {
	Table  string
	Key1   QLNODE //index by
	Key2   QLNODE
	Filter QLNODE //filter expression
	Offset int64
	Limit  int64
}

common structure for stmt.s: 'INDEX BY', ”FILTER', 'LIMIT'

type QLSelect

type QLSelect struct {
	QLScan
	Names  []string // expr. AS name
	Output []QLNODE
}

statements: SELECT UPDATE DELETE

type QLUPdate

type QLUPdate struct {
	QLScan
	Names  []string
	Values []QLNODE
}

type RecordIter

type RecordIter interface {
	Valid() bool
	Next()
	Deref(*Record) error
}

Jump to

Keyboard shortcuts

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