sql

package
v1.4.1-RC1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Overview

Code generated by goyacc -l -o sql_parser.go sql_grammar.y. DO NOT EDIT.

Index

Constants

View Source
const (
	KeyValPrefixNull       byte = 0x20
	KeyValPrefixNotNull    byte = 0x80
	KeyValPrefixUpperBound byte = 0xFF
)
View Source
const (
	NamedNonPositionalParamType positionalParamType = iota + 1
	NamedPositionalParamType
	UnnamedParamType
)
View Source
const (
	PIndexPrefix = "R." // (key=R.{dbID}{tableID}{0}({null}({pkVal}{padding}{pkValLen})?)+, value={count (colID valLen val)+})
	SIndexPrefix = "E." // (key=E.{dbID}{tableID}{indexID}({null}({val}{padding}{valLen})?)+({pkVal}{padding}{pkValLen})+, value={})
	UIndexPrefix = "N." // (key=N.{dbID}{tableID}{indexID}({null}({val}{padding}{valLen})?)+, value={({pkVal}{padding}{pkValLen})+})

)
View Source
const (
	NowFnCall       string = "NOW"
	DatabasesFnCall string = "DATABASES"
	TablesFnCall    string = "TABLES"
	ColumnsFnCall   string = "COLUMNS"
	IndexesFnCall   string = "INDEXES"
)
View Source
const ADD = 57362
View Source
const AFTER = 57351
View Source
const AGGREGATE_FUNC = 57418
View Source
const ALL = 57397
View Source
const ALTER = 57361
View Source
const AS = 57395
View Source
const ASC = 57393
View Source
const AUTO_INCREMENT = 57404
View Source
const BEFORE = 57352
View Source
const BEGIN = 57368
View Source
const BLOB = 57417
View Source
const BOOLEAN = 57416
View Source
const BY = 57389
View Source
const CAST = 57406
View Source
const CMPOP = 57411
View Source
const COLUMN = 57365
View Source
const COMMIT = 57370
View Source
const CONFLICT = 57379
View Source
const CREATE = 57346
View Source
const DATABASE = 57348
View Source
const DELETE = 57376
View Source
const DESC = 57394
View Source
const DISTINCT = 57383
View Source
const DO = 57380
View Source
const ERROR = 57419
View Source
const EXISTS = 57401
View Source
const EncIDLen = 4
View Source
const EncLenLen = 4
View Source
const FROM = 57384
View Source
const GROUP = 57388
View Source
const HAVING = 57386
View Source
const IDENTIFIER = 57412
View Source
const IF = 57400
View Source
const IN = 57402
View Source
const INDEX = 57359
View Source
const INSERT = 57372
View Source
const INTO = 57374
View Source
const IS = 57403
View Source
const JOIN = 57385
View Source
const JOINTYPE = 57409
View Source
const KEY = 57367
View Source
const LIKE = 57399
View Source
const LIMIT = 57390
View Source
const LOP = 57410
View Source
const MaxNumberOfColumnsInIndex = 8
View Source
const NOT = 57398
View Source
const NOTHING = 57381
View Source
const NPARAM = 57407
View Source
const NULL = 57405
View Source
const NUMBER = 57414
View Source
const OF = 57355
View Source
const OFFSET = 57391
View Source
const ON = 57360
View Source
const ORDER = 57392
View Source
const PKIndexID = uint32(0)
View Source
const PPARAM = 57408
View Source
const PRIMARY = 57366
View Source
const RENAME = 57363
View Source
const ROLLBACK = 57371
View Source
const SELECT = 57382
View Source
const SET = 57378
View Source
const SINCE = 57350
View Source
const SNAPSHOT = 57349
View Source
const STMT_SEPARATOR = 57420
View Source
const TABLE = 57357
View Source
const TIMESTAMP = 57356
View Source
const TO = 57364
View Source
const TRANSACTION = 57369
View Source
const TX = 57354
View Source
const TYPE = 57413
View Source
const UNION = 57396
View Source
const UNIQUE = 57358
View Source
const UNTIL = 57353
View Source
const UPDATE = 57377
View Source
const UPSERT = 57373
View Source
const USE = 57347
View Source
const VALUES = 57375
View Source
const VARCHAR = 57415
View Source
const WHERE = 57387

Variables

View Source
var ErrAlreadyClosed = store.ErrAlreadyClosed
View Source
var ErrAmbiguousSelector = errors.New("ambiguous selector")
View Source
var ErrColumnAlreadyExists = errors.New("column already exists")
View Source
var ErrColumnDoesNotExist = errors.New("column does not exist")
View Source
var ErrColumnIsNotAnAggregation = errors.New("column is not an aggregation")
View Source
var ErrColumnMismatchInUnionStmt = errors.New("column mismatch in union statement")
View Source
var ErrColumnNotIndexed = errors.New("column is not indexed")
View Source
var ErrCorruptedData = store.ErrCorruptedData
View Source
var ErrDDLorDMLTxOnly = errors.New("transactions can NOT combine DDL and DML statements")
View Source
var ErrDatabaseAlreadyExists = errors.New("database already exists")
View Source
var ErrDatabaseDoesNotExist = errors.New("database does not exist")
View Source
var ErrDivisionByZero = errors.New("division by zero")
View Source
var ErrDuplicatedColumn = errors.New("duplicated column")
View Source
var ErrDuplicatedParameters = errors.New("duplicated parameters")
View Source
var ErrEitherNamedOrUnnamedParams = errors.New("either named or unnamed params")
View Source
var ErrEitherPosOrNonPosParams = errors.New("either positional or non-positional named params")
View Source
var ErrExpectingDQLStmt = errors.New("illegal statement. DQL statement expected")
View Source
var ErrFunctionDoesNotExist = errors.New("function does not exist")
View Source
var ErrHavingClauseRequiresGroupClause = errors.New("having clause requires group clause")
View Source
var ErrIllegalArguments = store.ErrIllegalArguments
View Source
var ErrIllegalMappedKey = errors.New("error illegal mapped key")
View Source
var ErrIndexAlreadyExists = errors.New("index already exists")
View Source
var ErrInferredMultipleTypes = errors.New("inferred multiple types")
View Source
var ErrInvalidColumn = errors.New("invalid column")
View Source
var ErrInvalidCondition = errors.New("invalid condition")
View Source
var ErrInvalidNumberOfValues = errors.New("invalid number of values provided")
View Source
var ErrInvalidPositionalParameter = errors.New("invalid positional parameter")
View Source
var ErrInvalidTypes = errors.New("invalid types")
View Source
var ErrInvalidValue = errors.New("invalid value provided")
View Source
var ErrLimitedAutoIncrement = errors.New("only INTEGER single-column primary keys can be set as auto incremental")
View Source
var ErrLimitedCount = errors.New("only unbounded counting is supported i.e. COUNT(*)")
View Source
var ErrLimitedGroupBy = errors.New("group by requires ordering by the grouping column")
View Source
var ErrLimitedIndexCreation = errors.New("index creation is only supported on empty tables")
View Source
var ErrLimitedKeyType = errors.New("indexed key of invalid type. Supported types are: INTEGER, VARCHAR[256] OR BLOB[256]")
View Source
var ErrLimitedMaxLen = errors.New("only VARCHAR and BLOB types support max length")
View Source
var ErrLimitedOrderBy = errors.New("order is limit to one indexed column")
View Source
var ErrMaxKeyLengthExceeded = errors.New("max key length exceeded")
View Source
var ErrMaxLengthExceeded = errors.New("max length exceeded")
View Source
var ErrMaxNumberOfColumnsInIndexExceeded = errors.New("number of columns in multi-column index exceeded")
View Source
var ErrMissingParameter = errors.New("missing parameter")
View Source
var ErrNestedTxNotSupported = errors.New("nested tx are not supported")
View Source
var ErrNewColumnMustBeNullable = errors.New("new column must be nullable")
View Source
var ErrNoAvailableIndex = errors.New("no available index")
View Source
var ErrNoDatabaseSelected = errors.New("no database selected")
View Source
var ErrNoMoreRows = store.ErrNoMoreEntries
View Source
var ErrNoOngoingTx = errors.New("no ongoing transaction")
View Source
var ErrNoSupported = errors.New("not supported")
View Source
var ErrNonTransactionalStmt = errors.New("non transactional statement")
View Source
var ErrNotComparableValues = errors.New("values are not comparable")
View Source
var ErrNotNullableColumnCannotBeNull = errors.New("not nullable column can not be null")
View Source
var ErrPKCanNotBeNull = errors.New("primary key can not be null")
View Source
var ErrPKCanNotBeUpdated = errors.New("primary key can not be updated")
View Source
var ErrParsingError = errors.New("parsing error")
View Source
var ErrSameOldAndNewColumnName = errors.New("same old and new column names")
View Source
var ErrTableAlreadyExists = errors.New("table already exists")
View Source
var ErrTableDoesNotExist = errors.New("table does not exist")
View Source
var ErrTooManyRows = errors.New("too many rows")
View Source
var ErrTxDoesNotExist = errors.New("tx does not exist")
View Source
var ErrUnexpected = errors.New("unexpected error")
View Source
var ErrUnsupportedCast = errors.New("unsupported cast")
View Source
var ErrUnsupportedJoinType = errors.New("unsupported join type")
View Source
var ErrUnsupportedParameter = errors.New("unsupported parameter")

Functions

func EncodeAsKey added in v1.1.0

func EncodeAsKey(val interface{}, colType SQLValueType, maxLen int) ([]byte, error)

func EncodeID

func EncodeID(id uint32) []byte

func EncodeSelector

func EncodeSelector(aggFn, db, table, col string) string

func EncodeValue

func EncodeValue(val interface{}, colType SQLValueType, maxLen int) ([]byte, error)

func MapKey

func MapKey(prefix []byte, mappingPrefix string, encValues ...[]byte) []byte

func TimeFromInt64 added in v1.2.2

func TimeFromInt64(t int64) time.Time

func TimeToInt64 added in v1.2.2

func TimeToInt64(t time.Time) int64

func ValidOpts added in v1.2.0

func ValidOpts(opts *Options) bool

Types

type AVGValue

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

func (*AVGValue) ColBounded

func (v *AVGValue) ColBounded() bool

func (*AVGValue) Compare

func (v *AVGValue) Compare(val TypedValue) (int, error)

func (*AVGValue) IsNull added in v1.2.0

func (v *AVGValue) IsNull() bool

func (*AVGValue) Selector

func (v *AVGValue) Selector() string

func (*AVGValue) Type

func (v *AVGValue) Type() SQLValueType

func (*AVGValue) Value

func (v *AVGValue) Value() interface{}

type AddColumnStmt

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

type AggColSelector

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

type AggregateFn

type AggregateFn = string
const (
	COUNT AggregateFn = "COUNT"
	SUM   AggregateFn = "SUM"
	MAX   AggregateFn = "MAX"
	MIN   AggregateFn = "MIN"
	AVG   AggregateFn = "AVG"
)

type AggregatedValue

type AggregatedValue interface {
	TypedValue

	Selector() string
	ColBounded() bool
	// contains filtered or unexported methods
}

type BeginTransactionStmt added in v1.2.0

type BeginTransactionStmt struct {
}

type BinBoolExp

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

type Blob

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

func (*Blob) Compare

func (v *Blob) Compare(val TypedValue) (int, error)

func (*Blob) IsNull added in v1.2.0

func (v *Blob) IsNull() bool

func (*Blob) Type

func (v *Blob) Type() SQLValueType

func (*Blob) Value

func (v *Blob) Value() interface{}

type Bool

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

func (*Bool) Compare

func (v *Bool) Compare(val TypedValue) (int, error)

func (*Bool) IsNull added in v1.2.0

func (v *Bool) IsNull() bool

func (*Bool) Type

func (v *Bool) Type() SQLValueType

func (*Bool) Value

func (v *Bool) Value() interface{}

type Cast added in v1.2.0

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

type Catalog

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

func (*Catalog) Databases

func (c *Catalog) Databases() []*Database

func (*Catalog) ExistDatabase

func (c *Catalog) ExistDatabase(db string) bool

func (*Catalog) GetDatabaseByID

func (c *Catalog) GetDatabaseByID(id uint32) (*Database, error)

func (*Catalog) GetDatabaseByName

func (c *Catalog) GetDatabaseByName(name string) (*Database, error)

func (*Catalog) GetTableByName

func (c *Catalog) GetTableByName(dbName, tableName string) (*Table, error)

type CmpBoolExp

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

type CmpOperator

type CmpOperator = int
const (
	EQ CmpOperator = iota
	NE
	LT
	LE
	GT
	GE
)

type ColDescriptor

type ColDescriptor struct {
	AggFn    string
	Database string
	Table    string
	Column   string
	Type     SQLValueType
}

func (*ColDescriptor) Selector

func (d *ColDescriptor) Selector() string

type ColSelector

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

type ColSpec

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

type Column

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

func (*Column) ID

func (c *Column) ID() uint32

func (*Column) IsAutoIncremental added in v1.1.0

func (c *Column) IsAutoIncremental() bool

func (*Column) IsNullable

func (c *Column) IsNullable() bool

func (*Column) MaxLen added in v1.1.0

func (c *Column) MaxLen() int

func (*Column) Name

func (c *Column) Name() string

func (*Column) Type

func (c *Column) Type() SQLValueType

type CommitStmt added in v1.2.0

type CommitStmt struct {
}

type Comparison

type Comparison int
const (
	EqualTo Comparison = iota
	LowerThan
	LowerOrEqualTo
	GreaterThan
	GreaterOrEqualTo
)

type CountValue

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

func (*CountValue) ColBounded

func (v *CountValue) ColBounded() bool

func (*CountValue) Compare

func (v *CountValue) Compare(val TypedValue) (int, error)

func (*CountValue) IsNull added in v1.2.0

func (v *CountValue) IsNull() bool

func (*CountValue) Selector

func (v *CountValue) Selector() string

func (*CountValue) Type

func (v *CountValue) Type() SQLValueType

func (*CountValue) Value

func (v *CountValue) Value() interface{}

type CreateDatabaseStmt

type CreateDatabaseStmt struct {
	DB string
	// contains filtered or unexported fields
}

type CreateIndexStmt

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

type CreateTableStmt

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

type DataSource

type DataSource interface {
	SQLStmt
	Resolve(tx *SQLTx, params map[string]interface{}, ScanSpecs *ScanSpecs) (RowReader, error)
	Alias() string
}

type Database

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

func (*Database) ExistTable

func (db *Database) ExistTable(table string) bool

func (*Database) GetTableByID

func (db *Database) GetTableByID(id uint32) (*Table, error)

func (*Database) GetTableByName

func (db *Database) GetTableByName(name string) (*Table, error)

func (*Database) GetTables

func (db *Database) GetTables() []*Table

func (*Database) ID

func (db *Database) ID() uint32

func (*Database) Name

func (db *Database) Name() string

type DeleteFromStmt added in v1.2.0

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

type Engine

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

func NewEngine

func NewEngine(store *store.ImmuStore, opts *Options) (*Engine, error)

func (*Engine) Catalog

func (e *Engine) Catalog(tx *SQLTx) (catalog *Catalog, err error)

func (*Engine) CurrentDatabase added in v1.3.0

func (e *Engine) CurrentDatabase() string

func (*Engine) Exec

func (e *Engine) Exec(sql string, params map[string]interface{}, tx *SQLTx) (ntx *SQLTx, committedTxs []*SQLTx, err error)

func (*Engine) ExecPreparedStmts

func (e *Engine) ExecPreparedStmts(stmts []SQLStmt, params map[string]interface{}, tx *SQLTx) (ntx *SQLTx, committedTxs []*SQLTx, err error)

func (*Engine) InferParameters added in v1.0.5

func (e *Engine) InferParameters(sql string, tx *SQLTx) (params map[string]SQLValueType, err error)

func (*Engine) InferParametersPreparedStmts added in v1.2.0

func (e *Engine) InferParametersPreparedStmts(stmts []SQLStmt, tx *SQLTx) (params map[string]SQLValueType, err error)

func (*Engine) NewTx added in v1.3.0

func (e *Engine) NewTx(ctx context.Context) (*SQLTx, error)

func (*Engine) Query

func (e *Engine) Query(sql string, params map[string]interface{}, tx *SQLTx) (RowReader, error)

func (*Engine) QueryPreparedStmt

func (e *Engine) QueryPreparedStmt(stmt DataSource, params map[string]interface{}, tx *SQLTx) (rowReader RowReader, err error)

func (*Engine) SetCurrentDatabase added in v1.3.0

func (e *Engine) SetCurrentDatabase(dbName string) error

func (*Engine) SetMultiDBHandler added in v1.3.0

func (e *Engine) SetMultiDBHandler(handler MultiDBHandler)

type ExistsBoolExp

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

type FnCall added in v1.3.0

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

type FnDataSourceStmt added in v1.3.0

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

func (*FnDataSourceStmt) Alias added in v1.3.0

func (stmt *FnDataSourceStmt) Alias() string

func (*FnDataSourceStmt) Resolve added in v1.3.0

func (stmt *FnDataSourceStmt) Resolve(tx *SQLTx, params map[string]interface{}, scanSpecs *ScanSpecs) (rowReader RowReader, err error)

type InListExp added in v1.2.0

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

TODO: once InSubQueryExp is supported, this struct may become obsolete by creating a ListDataSource struct

type InSubQueryExp added in v1.2.0

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

type Index added in v1.1.0

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

func (*Index) Cols added in v1.1.0

func (i *Index) Cols() []*Column

func (*Index) IncludesCol added in v1.1.0

func (i *Index) IncludesCol(colID uint32) bool

func (*Index) IsPrimary added in v1.1.0

func (i *Index) IsPrimary() bool

func (*Index) IsUnique added in v1.1.0

func (i *Index) IsUnique() bool

func (*Index) Name added in v1.3.0

func (i *Index) Name() string

type JoinSpec

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

type JoinType

type JoinType = int
const (
	InnerJoin JoinType = iota
	LeftJoin
	RightJoin
)

type LikeBoolExp

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

type LogicOperator

type LogicOperator = int
const (
	AND LogicOperator = iota
	OR
)

type MaxValue

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

func (*MaxValue) ColBounded

func (v *MaxValue) ColBounded() bool

func (*MaxValue) Compare

func (v *MaxValue) Compare(val TypedValue) (int, error)

func (*MaxValue) IsNull added in v1.2.0

func (v *MaxValue) IsNull() bool

func (*MaxValue) Selector

func (v *MaxValue) Selector() string

func (*MaxValue) Type

func (v *MaxValue) Type() SQLValueType

func (*MaxValue) Value

func (v *MaxValue) Value() interface{}

type MinValue

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

func (*MinValue) ColBounded

func (v *MinValue) ColBounded() bool

func (*MinValue) Compare

func (v *MinValue) Compare(val TypedValue) (int, error)

func (*MinValue) IsNull added in v1.2.0

func (v *MinValue) IsNull() bool

func (*MinValue) Selector

func (v *MinValue) Selector() string

func (*MinValue) Type

func (v *MinValue) Type() SQLValueType

func (*MinValue) Value

func (v *MinValue) Value() interface{}

type MultiDBHandler added in v1.3.0

type MultiDBHandler interface {
	ListDatabases(ctx context.Context) ([]string, error)
	CreateDatabase(ctx context.Context, db string, ifNotExists bool) error
	UseDatabase(ctx context.Context, db string) error
	ExecPreparedStmts(ctx context.Context, stmts []SQLStmt, params map[string]interface{}) (ntx *SQLTx, committedTxs []*SQLTx, err error)
}

type NotBoolExp

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

type NullValue

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

func (*NullValue) Compare

func (n *NullValue) Compare(val TypedValue) (int, error)

func (*NullValue) IsNull added in v1.2.0

func (n *NullValue) IsNull() bool

func (*NullValue) Type

func (n *NullValue) Type() SQLValueType

func (*NullValue) Value

func (n *NullValue) Value() interface{}

type NumExp

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

type NumOperator

type NumOperator = int
const (
	ADDOP NumOperator = iota
	SUBSOP
	DIVOP
	MULTOP
)

type Number

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

func (*Number) Compare

func (v *Number) Compare(val TypedValue) (int, error)

func (*Number) IsNull added in v1.2.0

func (v *Number) IsNull() bool

func (*Number) Type

func (v *Number) Type() SQLValueType

func (*Number) Value

func (v *Number) Value() interface{}

type OnConflictDo added in v1.2.2

type OnConflictDo struct {
}

type Options added in v1.2.0

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

func DefaultOptions added in v1.2.0

func DefaultOptions() *Options

func (*Options) WithAutocommit added in v1.2.0

func (opts *Options) WithAutocommit(autocommit bool) *Options

func (*Options) WithDistinctLimit added in v1.2.0

func (opts *Options) WithDistinctLimit(distinctLimit int) *Options

func (*Options) WithPrefix added in v1.2.0

func (opts *Options) WithPrefix(prefix []byte) *Options

type OrdCol

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

type Param

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

type RenameColumnStmt added in v1.3.0

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

type RollbackStmt added in v1.2.0

type RollbackStmt struct {
}

type Row

type Row struct {
	ValuesByPosition []TypedValue
	ValuesBySelector map[string]TypedValue
}

type RowReader

type RowReader interface {
	Tx() *SQLTx
	Database() string
	TableAlias() string
	Parameters() map[string]interface{}
	SetParameters(params map[string]interface{}) error
	Read() (*Row, error)
	Close() error
	Columns() ([]ColDescriptor, error)
	OrderBy() []ColDescriptor
	ScanSpecs() *ScanSpecs
	InferParameters(params map[string]SQLValueType) error
	// contains filtered or unexported methods
}

type RowSpec

type RowSpec struct {
	Values []ValueExp
}

type SQLStmt

type SQLStmt interface {
	// contains filtered or unexported methods
}

func Parse

func Parse(r io.ByteReader) ([]SQLStmt, error)

func ParseString

func ParseString(sql string) ([]SQLStmt, error)

type SQLTx added in v1.2.0

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

SQLTx (no-thread safe) represents an interactive or incremental transaction with support of RYOW

func (*SQLTx) Cancel added in v1.2.0

func (sqlTx *SQLTx) Cancel() error

func (*SQLTx) Closed added in v1.2.0

func (sqlTx *SQLTx) Closed() bool

func (*SQLTx) Database added in v1.2.0

func (sqlTx *SQLTx) Database() *Database

func (*SQLTx) FirstInsertedPKs added in v1.2.2

func (sqlTx *SQLTx) FirstInsertedPKs() map[string]int64

func (*SQLTx) LastInsertedPKs added in v1.2.0

func (sqlTx *SQLTx) LastInsertedPKs() map[string]int64

func (*SQLTx) Timestamp added in v1.3.1

func (sqlTx *SQLTx) Timestamp() time.Time

func (*SQLTx) TxHeader added in v1.2.0

func (sqlTx *SQLTx) TxHeader() *store.TxHeader

func (*SQLTx) UpdatedRows added in v1.2.0

func (sqlTx *SQLTx) UpdatedRows() int

type SQLValueType

type SQLValueType = string
const (
	IntegerType   SQLValueType = "INTEGER"
	BooleanType   SQLValueType = "BOOLEAN"
	VarcharType   SQLValueType = "VARCHAR"
	BLOBType      SQLValueType = "BLOB"
	TimestampType SQLValueType = "TIMESTAMP"
	AnyType       SQLValueType = "ANY"
)

type ScanSpecs added in v1.1.0

type ScanSpecs struct {
	Index *Index

	DescOrder bool
	// contains filtered or unexported fields
}

type SelectStmt

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

func (*SelectStmt) Alias

func (stmt *SelectStmt) Alias() string

func (*SelectStmt) Limit

func (stmt *SelectStmt) Limit() int

func (*SelectStmt) Offset added in v1.3.1

func (stmt *SelectStmt) Offset() int

func (*SelectStmt) Resolve

func (stmt *SelectStmt) Resolve(tx *SQLTx, params map[string]interface{}, _ *ScanSpecs) (ret RowReader, err error)

type Selector

type Selector interface {
	ValueExp
	// contains filtered or unexported methods
}

type SumValue

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

func (*SumValue) ColBounded

func (v *SumValue) ColBounded() bool

func (*SumValue) Compare

func (v *SumValue) Compare(val TypedValue) (int, error)

func (*SumValue) IsNull added in v1.2.0

func (v *SumValue) IsNull() bool

func (*SumValue) Selector

func (v *SumValue) Selector() string

func (*SumValue) Type

func (v *SumValue) Type() SQLValueType

func (*SumValue) Value

func (v *SumValue) Value() interface{}

type Table

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

func (*Table) Cols added in v1.1.0

func (t *Table) Cols() []*Column

func (*Table) ColsByName

func (t *Table) ColsByName() map[string]*Column

func (*Table) Database

func (t *Table) Database() *Database

func (*Table) GetColumnByID

func (t *Table) GetColumnByID(id uint32) (*Column, error)

func (*Table) GetColumnByName

func (t *Table) GetColumnByName(name string) (*Column, error)

func (*Table) ID

func (t *Table) ID() uint32

func (*Table) IndexesByColID added in v1.1.0

func (t *Table) IndexesByColID(colID uint32) []*Index

func (*Table) IsIndexed

func (t *Table) IsIndexed(colName string) (indexed bool, err error)

func (*Table) Name

func (t *Table) Name() string

func (*Table) PrimaryIndex added in v1.1.0

func (t *Table) PrimaryIndex() *Index

type Timestamp added in v1.2.0

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

func (*Timestamp) Compare added in v1.2.0

func (v *Timestamp) Compare(val TypedValue) (int, error)

func (*Timestamp) IsNull added in v1.2.0

func (v *Timestamp) IsNull() bool

func (*Timestamp) Type added in v1.2.0

func (v *Timestamp) Type() SQLValueType

func (*Timestamp) Value added in v1.2.0

func (v *Timestamp) Value() interface{}

type TypedValue

type TypedValue interface {
	ValueExp
	Type() SQLValueType
	Value() interface{}
	Compare(val TypedValue) (int, error)
	IsNull() bool
}

func DecodeValue

func DecodeValue(b []byte, colType SQLValueType) (TypedValue, int, error)

type UnionStmt added in v1.3.0

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

func (*UnionStmt) Alias added in v1.3.0

func (stmt *UnionStmt) Alias() string

func (*UnionStmt) Resolve added in v1.3.0

func (stmt *UnionStmt) Resolve(tx *SQLTx, params map[string]interface{}, _ *ScanSpecs) (ret RowReader, err error)

type UpdateStmt added in v1.2.0

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

type UpsertIntoStmt

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

type UseDatabaseStmt

type UseDatabaseStmt struct {
	DB string
}

type UseSnapshotStmt

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

type ValueExp

type ValueExp interface {
	// contains filtered or unexported methods
}

type Varchar

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

func (*Varchar) Compare

func (v *Varchar) Compare(val TypedValue) (int, error)

func (*Varchar) IsNull added in v1.2.0

func (v *Varchar) IsNull() bool

func (*Varchar) Type

func (v *Varchar) Type() SQLValueType

func (*Varchar) Value

func (v *Varchar) Value() interface{}

Jump to

Keyboard shortcuts

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