Documentation
¶
Overview ¶
Code generated by goyacc -l -o sql_parser.go sql_grammar.y. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func EncodeID(id uint32) []byte
- func EncodeRawValue(val interface{}, colType SQLValueType, maxLen int) ([]byte, error)
- func EncodeRawValueAsKey(val interface{}, colType SQLValueType, maxLen int) ([]byte, int, error)
- func EncodeSelector(aggFn, table, col string) string
- func EncodeValue(val TypedValue, colType SQLValueType, maxLen int) ([]byte, error)
- func EncodeValueAsKey(val TypedValue, colType SQLValueType, maxLen int) ([]byte, int, error)
- func EncodedPK(table *Table, valuesByColID map[uint32]TypedValue) ([]byte, error)
- func IsNumericType(t SQLValueType) bool
- func MapKey(prefix []byte, mappingPrefix string, encValues ...[]byte) []byte
- func NewColUpdate(col string, val ValueExp) *colUpdate
- func TimeFromInt64(t int64) time.Time
- func TimeToInt64(t time.Time) int64
- type AVGValue
- type AddColumnStmt
- type AggColSelector
- type AggregateFn
- type AggregatedValue
- type BeginTransactionStmt
- type BinBoolExp
- type Blob
- type Bool
- type Cast
- type Catalog
- type CmpBoolExp
- type CmpOperator
- type ColDescriptor
- type ColSelector
- type ColSpec
- type Column
- type CommitStmt
- type Comparison
- type CountValue
- type CreateDatabaseStmt
- type CreateIndexStmt
- type CreateTableStmt
- type DataSource
- type DeleteFromStmt
- type DropIndexStmt
- type DropTableStmt
- type Engine
- func (e *Engine) Catalog(ctx context.Context, tx *SQLTx) (catalog *Catalog, err error)
- func (e *Engine) CopyCatalogToTx(ctx context.Context, tx *store.OngoingTx) error
- func (e *Engine) Exec(ctx context.Context, tx *SQLTx, sql string, params map[string]interface{}) (ntx *SQLTx, committedTxs []*SQLTx, err error)
- func (e *Engine) ExecPreparedStmts(ctx context.Context, tx *SQLTx, stmts []SQLStmt, params map[string]interface{}) (ntx *SQLTx, committedTxs []*SQLTx, err error)
- func (e *Engine) GetPrefix() []byte
- func (e *Engine) GetStore() *store.ImmuStore
- func (e *Engine) InferParameters(ctx context.Context, tx *SQLTx, sql string) (params map[string]SQLValueType, err error)
- func (e *Engine) InferParametersPreparedStmts(ctx context.Context, tx *SQLTx, stmts []SQLStmt) (params map[string]SQLValueType, err error)
- func (e *Engine) NewTx(ctx context.Context, opts *TxOptions) (*SQLTx, error)
- func (e *Engine) Query(ctx context.Context, tx *SQLTx, sql string, params map[string]interface{}) (RowReader, error)
- func (e *Engine) QueryPreparedStmt(ctx context.Context, tx *SQLTx, stmt DataSource, params map[string]interface{}) (rowReader RowReader, err error)
- type ExistsBoolExp
- type Float64
- type FnCall
- type FnDataSourceStmt
- type InListExp
- type InSubQueryExp
- type Index
- type Integer
- type JoinSpec
- type JoinType
- type LikeBoolExp
- type LogicOperator
- type MaxValue
- type MinValue
- type MultiDBHandler
- type NotBoolExp
- type NullValue
- type NumExp
- type NumOperator
- type OnConflictDo
- type Options
- func (opts *Options) Validate() error
- func (opts *Options) WithAutocommit(autocommit bool) *Options
- func (opts *Options) WithDistinctLimit(distinctLimit int) *Options
- func (opts *Options) WithLazyIndexConstraintValidation(lazyIndexConstraintValidation bool) *Options
- func (opts *Options) WithMultiDBHandler(multidbHandler MultiDBHandler) *Options
- func (opts *Options) WithPrefix(prefix []byte) *Options
- type OrdCol
- type Param
- type RenameColumnStmt
- type RollbackStmt
- type Row
- type RowReader
- type RowSpec
- type SQLStmt
- type SQLTx
- func (sqlTx *SQLTx) Cancel() error
- func (sqlTx *SQLTx) Catalog() *Catalog
- func (sqlTx *SQLTx) Closed() bool
- func (sqlTx *SQLTx) Commit(ctx context.Context) error
- func (sqlTx *SQLTx) Committed() bool
- func (sqlTx *SQLTx) FirstInsertedPKs() map[string]int64
- func (sqlTx *SQLTx) IsExplicitCloseRequired() bool
- func (sqlTx *SQLTx) LastInsertedPKs() map[string]int64
- func (sqlTx *SQLTx) RequireExplicitClose() error
- func (sqlTx *SQLTx) Timestamp() time.Time
- func (sqlTx *SQLTx) TxHeader() *store.TxHeader
- func (sqlTx *SQLTx) UpdatedRows() int
- type SQLValueType
- type ScanSpecs
- type SelectStmt
- type Selector
- type SumValue
- type Table
- func (t *Table) Cols() []*Column
- func (t *Table) ColsByName() map[string]*Column
- func (t *Table) ColumnsByID() map[uint32]*Column
- func (t *Table) Database() *Catalog
- func (t *Table) GetColumnByID(id uint32) (*Column, error)
- func (t *Table) GetColumnByName(name string) (*Column, error)
- func (t *Table) GetIndexByName(name string) (*Index, error)
- func (t *Table) GetIndexes() []*Index
- func (t *Table) ID() uint32
- func (t *Table) IndexesByColID(colID uint32) []*Index
- func (t *Table) IsIndexed(colName string) (indexed bool, err error)
- func (t *Table) Name() string
- func (t *Table) PrimaryIndex() *Index
- type Timestamp
- type TxOptions
- func (opts *TxOptions) Validate() error
- func (opts *TxOptions) WithExplicitClose(explicitClose bool) *TxOptions
- func (opts *TxOptions) WithReadOnly(readOnly bool) *TxOptions
- func (opts *TxOptions) WithSnapshotMustIncludeTxID(snapshotMustIncludeTxID func(lastPrecommittedTxID uint64) uint64) *TxOptions
- func (opts *TxOptions) WithSnapshotRenewalPeriod(snapshotRenewalPeriod time.Duration) *TxOptions
- func (opts *TxOptions) WithUnsafeMVCC(unsafeMVCC bool) *TxOptions
- type TypedValue
- type UnionStmt
- type UpdateStmt
- type UpsertIntoStmt
- type UseDatabaseStmt
- type UseSnapshotStmt
- type ValueExp
- type Varchar
Constants ¶
const ( KeyValPrefixNull byte = 0x20 KeyValPrefixNotNull byte = 0x80 KeyValPrefixUpperBound byte = 0xFF )
const ( NamedNonPositionalParamType positionalParamType = iota + 1 NamedPositionalParamType UnnamedParamType )
const ( PIndexPrefix = "R." // (key=R.{1}{tableID}{0}({null}({pkVal}{padding}{pkValLen})?)+, value={count (colID valLen val)+}) SIndexPrefix = "E." // (key=E.{1}{tableID}{indexID}({null}({val}{padding}{valLen})?)+({pkVal}{padding}{pkValLen})+, value={}) UIndexPrefix = "N." // (key=N.{1}{tableID}{indexID}({null}({val}{padding}{valLen})?)+, value={({pkVal}{padding}{pkValLen})+}) )
const ( NowFnCall string = "NOW" DatabasesFnCall string = "DATABASES" TablesFnCall string = "TABLES" ColumnsFnCall string = "COLUMNS" IndexesFnCall string = "INDEXES" )
const ADD = 57362
const AFTER = 57351
const AGGREGATE_FUNC = 57420
const ALL = 57397
const ALTER = 57361
const AS = 57395
const ASC = 57393
const AUTO_INCREMENT = 57404
const BEFORE = 57352
const BEGIN = 57368
const BLOB = 57419
const BOOLEAN = 57418
const BY = 57389
const CAST = 57406
const CMPOP = 57412
const COLUMN = 57365
const COMMIT = 57370
const CONFLICT = 57379
const CREATE = 57346
const DATABASE = 57348
const DELETE = 57376
const DESC = 57394
const DISTINCT = 57383
const DO = 57380
const DOT = 57422
const ERROR = 57421
const EXISTS = 57401
const EncIDLen = 4
const EncLenLen = 4
const FLOAT = 57416
const FROM = 57384
const GROUP = 57388
const HAVING = 57386
const IDENTIFIER = 57413
const IF = 57400
const IN = 57402
const INDEX = 57359
const INSERT = 57372
const INTEGER = 57415
const INTO = 57374
const IS = 57403
const JOIN = 57385
const JOINTYPE = 57410
const KEY = 57367
const LIKE = 57399
const LIMIT = 57390
const LOP = 57411
const MaxNumberOfColumnsInIndex = 8
const NOT = 57398
const NOTHING = 57381
const NPARAM = 57408
const NULL = 57405
const OF = 57355
const OFFSET = 57391
const ON = 57360
const ORDER = 57392
const PKIndexID = uint32(0)
const PPARAM = 57409
const PRIMARY = 57366
const RENAME = 57363
const ROLLBACK = 57371
const SCAST = 57407
const SELECT = 57382
const SET = 57378
const SINCE = 57350
const SNAPSHOT = 57349
const STMT_SEPARATOR = 57423
const TABLE = 57357
const TIMESTAMP = 57356
const TO = 57364
const TRANSACTION = 57369
const TX = 57354
const TYPE = 57414
const UNION = 57396
const UNIQUE = 57358
const UNTIL = 57353
const UPDATE = 57377
const UPSERT = 57373
const USE = 57347
const VALUES = 57375
const VARCHAR = 57417
const WHERE = 57387
Variables ¶
var ErrAlreadyClosed = store.ErrAlreadyClosed
var ErrAmbiguousSelector = errors.New("ambiguous selector")
var ErrColumnAlreadyExists = errors.New("column already exists")
var ErrColumnDoesNotExist = errors.New("column does not exist")
var ErrColumnIsNotAnAggregation = errors.New("column is not an aggregation")
var ErrColumnMismatchInUnionStmt = errors.New("column mismatch in union statement")
var ErrColumnNotIndexed = errors.New("column is not indexed")
var ErrCorruptedData = store.ErrCorruptedData
var ErrDDLorDMLTxOnly = errors.New("transactions can NOT combine DDL and DML statements")
var ErrDatabaseAlreadyExists = errors.New("database already exists")
var ErrDatabaseDoesNotExist = errors.New("database does not exist")
var ErrDivisionByZero = errors.New("division by zero")
var ErrDuplicatedColumn = errors.New("duplicated column")
var ErrDuplicatedParameters = errors.New("duplicated parameters")
var ErrEitherNamedOrUnnamedParams = errors.New("either named or unnamed params")
var ErrEitherPosOrNonPosParams = errors.New("either positional or non-positional named params")
var ErrExpectingDQLStmt = errors.New("illegal statement. DQL statement expected")
var ErrFunctionDoesNotExist = errors.New("function does not exist")
var ErrHavingClauseRequiresGroupClause = errors.New("having clause requires group clause")
var ErrIllegalArguments = store.ErrIllegalArguments
var ErrIllegalMappedKey = errors.New("error illegal mapped key")
var ErrIndexAlreadyExists = errors.New("index already exists")
var ErrInferredMultipleTypes = errors.New("inferred multiple types")
var ErrInvalidColumn = errors.New("invalid column")
var ErrInvalidCondition = errors.New("invalid condition")
var ErrInvalidNumberOfValues = errors.New("invalid number of values provided")
var ErrInvalidPositionalParameter = errors.New("invalid positional parameter")
var ErrInvalidTypes = errors.New("invalid types")
var ErrInvalidValue = errors.New("invalid value provided")
var ErrLimitedAutoIncrement = errors.New("only INTEGER single-column primary keys can be set as auto incremental")
var ErrLimitedCount = errors.New("only unbounded counting is supported i.e. COUNT(*)")
var ErrLimitedGroupBy = errors.New("group by requires ordering by the grouping column")
var ErrLimitedIndexCreation = errors.New("index creation is only supported on empty tables")
var ErrLimitedKeyType = errors.New("indexed key of unsupported type or exceeded length")
var ErrLimitedMaxLen = errors.New("only VARCHAR and BLOB types support max length")
var ErrLimitedOrderBy = errors.New("order is limit to one indexed column")
var ErrMaxKeyLengthExceeded = errors.New("max key length exceeded")
var ErrMaxLengthExceeded = errors.New("max length exceeded")
var ErrMaxNumberOfColumnsInIndexExceeded = errors.New("number of columns in multi-column index exceeded")
var ErrMissingParameter = errors.New("missing parameter")
var ErrNestedTxNotSupported = errors.New("nested tx are not supported")
var ErrNewColumnMustBeNullable = errors.New("new column must be nullable")
var ErrNoAvailableIndex = errors.New("no available index")
var ErrNoMoreRows = store.ErrNoMoreEntries
var ErrNoOngoingTx = errors.New("no ongoing transaction")
var ErrNoSupported = errors.New("not supported")
var ErrNonTransactionalStmt = errors.New("non transactional statement")
var ErrNotComparableValues = errors.New("values are not comparable")
var ErrNotNullableColumnCannotBeNull = errors.New("not nullable column can not be null")
var ErrNumericTypeExpected = errors.New("numeric type expected")
var ErrPKCanNotBeNull = errors.New("primary key can not be null")
var ErrPKCanNotBeUpdated = errors.New("primary key can not be updated")
var ErrParsingError = errors.New("parsing error")
var ErrSameOldAndNewColumnName = errors.New("same old and new column names")
var ErrTableAlreadyExists = errors.New("table already exists")
var ErrTableDoesNotExist = errors.New("table does not exist")
var ErrTooManyRows = errors.New("too many rows")
var ErrTxDoesNotExist = errors.New("tx does not exist")
var ErrUnexpected = errors.New("unexpected error")
var ErrUnspecifiedMultiDBHandler = fmt.Errorf("%w: unspecified multidbHanlder", store.ErrIllegalState)
var ErrUnsupportedCast = fmt.Errorf("%w: unsupported cast", ErrInvalidValue)
var ErrUnsupportedJoinType = errors.New("unsupported join type")
var ErrUnsupportedParameter = errors.New("unsupported parameter")
var MaxKeyLen = 512
Functions ¶
func EncodeRawValue ¶
func EncodeRawValue(val interface{}, colType SQLValueType, maxLen int) ([]byte, error)
EncodeRawValue encode a value in a byte format. This is the internal binary representation of a value. Can be decoded with DecodeValue.
func EncodeRawValueAsKey ¶ added in v1.5.0
func EncodeRawValueAsKey(val interface{}, colType SQLValueType, maxLen int) ([]byte, int, error)
EncodeRawValueAsKey encodes a value in a b-tree meaningful way.
func EncodeSelector ¶
func EncodeValue ¶
func EncodeValue(val TypedValue, colType SQLValueType, maxLen int) ([]byte, error)
func EncodeValueAsKey ¶ added in v1.5.0
func EncodeValueAsKey(val TypedValue, colType SQLValueType, maxLen int) ([]byte, int, error)
func EncodedPK ¶ added in v1.5.0
func EncodedPK(table *Table, valuesByColID map[uint32]TypedValue) ([]byte, error)
func IsNumericType ¶ added in v1.5.0
func IsNumericType(t SQLValueType) bool
func NewColUpdate ¶ added in v1.5.0
func TimeFromInt64 ¶ added in v1.2.2
func TimeToInt64 ¶ added in v1.2.2
Types ¶
type AVGValue ¶
type AVGValue struct {
// contains filtered or unexported fields
}
func (*AVGValue) ColBounded ¶
func (*AVGValue) Type ¶
func (v *AVGValue) Type() SQLValueType
type AddColumnStmt ¶
type AddColumnStmt struct {
// contains filtered or unexported fields
}
func NewAddColumnStmt ¶ added in v1.5.0
func NewAddColumnStmt(table string, colSpec *ColSpec) *AddColumnStmt
type AggColSelector ¶
type AggColSelector struct {
// contains filtered or unexported fields
}
func NewAggColSelector ¶ added in v1.5.0
func NewAggColSelector(aggFn AggregateFn, table, col string) *AggColSelector
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
}
func NewBinBoolExp ¶ added in v1.5.0
func NewBinBoolExp(op LogicOperator, lrexp, rrexp ValueExp) *BinBoolExp
type Blob ¶
type Blob struct {
// contains filtered or unexported fields
}
func (*Blob) Type ¶
func (v *Blob) Type() SQLValueType
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
func (*Bool) Type ¶
func (v *Bool) Type() SQLValueType
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog represents a database catalog containing metadata for all tables in the database.
func (*Catalog) ExistTable ¶ added in v1.5.0
func (*Catalog) GetTableByID ¶ added in v1.5.0
type CmpBoolExp ¶
type CmpBoolExp struct {
// contains filtered or unexported fields
}
func NewCmpBoolExp ¶ added in v1.5.0
func NewCmpBoolExp(op CmpOperator, left, right ValueExp) *CmpBoolExp
func (*CmpBoolExp) Left ¶ added in v1.5.0
func (bexp *CmpBoolExp) Left() ValueExp
func (*CmpBoolExp) OP ¶ added in v1.5.0
func (bexp *CmpBoolExp) OP() CmpOperator
func (*CmpBoolExp) Right ¶ added in v1.5.0
func (bexp *CmpBoolExp) Right() ValueExp
type ColDescriptor ¶
type ColDescriptor struct { AggFn 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
}
func NewColSelector ¶ added in v1.5.0
func NewColSelector(table, col string) *ColSelector
type ColSpec ¶
type ColSpec struct {
// contains filtered or unexported fields
}
func NewColSpec ¶ added in v1.5.0
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
func (*Column) IsAutoIncremental ¶ added in v1.1.0
func (*Column) IsNullable ¶
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) RawValue ¶ added in v1.5.0
func (v *CountValue) RawValue() interface{}
func (*CountValue) Selector ¶
func (v *CountValue) Selector() string
func (*CountValue) Type ¶
func (v *CountValue) Type() SQLValueType
type CreateDatabaseStmt ¶
type CreateDatabaseStmt struct { DB string // contains filtered or unexported fields }
type CreateIndexStmt ¶
type CreateIndexStmt struct {
// contains filtered or unexported fields
}
func NewCreateIndexStmt ¶ added in v1.5.0
func NewCreateIndexStmt(table string, cols []string, isUnique bool) *CreateIndexStmt
type CreateTableStmt ¶
type CreateTableStmt struct {
// contains filtered or unexported fields
}
func NewCreateTableStmt ¶ added in v1.5.0
func NewCreateTableStmt(table string, ifNotExists bool, colsSpec []*ColSpec, pkColNames []string) *CreateTableStmt
type DataSource ¶
type DeleteFromStmt ¶ added in v1.2.0
type DeleteFromStmt struct {
// contains filtered or unexported fields
}
func NewDeleteFromStmt ¶ added in v1.5.0
func NewDeleteFromStmt(table string, where ValueExp, orderBy []*OrdCol, limit ValueExp) *DeleteFromStmt
type DropIndexStmt ¶ added in v1.5.0
type DropIndexStmt struct {
// contains filtered or unexported fields
}
DropIndexStmt represents a statement to delete a table.
func NewDropIndexStmt ¶ added in v1.5.0
func NewDropIndexStmt(table string, columns []string) *DropIndexStmt
type DropTableStmt ¶ added in v1.5.0
type DropTableStmt struct {
// contains filtered or unexported fields
}
DropTableStmt represents a statement to delete a table.
func NewDropTableStmt ¶ added in v1.5.0
func NewDropTableStmt(table string) *DropTableStmt
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CopyCatalogToTx ¶ added in v1.5.0
CopyCatalogToTx copies the current sql catalog to the ongoing transaction.
func (*Engine) ExecPreparedStmts ¶
func (*Engine) InferParameters ¶ added in v1.0.5
func (*Engine) InferParametersPreparedStmts ¶ added in v1.2.0
func (*Engine) QueryPreparedStmt ¶
type ExistsBoolExp ¶
type ExistsBoolExp struct {
// contains filtered or unexported fields
}
type Float64 ¶ added in v1.5.0
type Float64 struct {
// contains filtered or unexported fields
}
func NewFloat64 ¶ added in v1.5.0
func (*Float64) Type ¶ added in v1.5.0
func (v *Float64) Type() SQLValueType
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
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) IncludesCol ¶ added in v1.1.0
type Integer ¶ added in v1.5.0
type Integer struct {
// contains filtered or unexported fields
}
func NewInteger ¶ added in v1.5.0
func (*Integer) Type ¶ added in v1.5.0
func (v *Integer) Type() SQLValueType
type LikeBoolExp ¶
type LikeBoolExp struct {
// contains filtered or unexported fields
}
func NewLikeBoolExp ¶ added in v1.5.0
func NewLikeBoolExp(val ValueExp, notLike bool, pattern ValueExp) *LikeBoolExp
type MaxValue ¶
type MaxValue struct {
// contains filtered or unexported fields
}
func (*MaxValue) ColBounded ¶
func (*MaxValue) Type ¶
func (v *MaxValue) Type() SQLValueType
type MinValue ¶
type MinValue struct {
// contains filtered or unexported fields
}
func (*MinValue) ColBounded ¶
func (*MinValue) Type ¶
func (v *MinValue) Type() SQLValueType
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, opts *TxOptions, 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) Type ¶
func (n *NullValue) Type() SQLValueType
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 (*Options) WithDistinctLimit ¶ added in v1.2.0
func (*Options) WithLazyIndexConstraintValidation ¶ added in v1.5.0
func (*Options) WithMultiDBHandler ¶ added in v1.5.0
func (opts *Options) WithMultiDBHandler(multidbHandler MultiDBHandler) *Options
func (*Options) WithPrefix ¶ added in v1.2.0
type RenameColumnStmt ¶ added in v1.3.0
type RenameColumnStmt struct {
// contains filtered or unexported fields
}
func NewRenameColumnStmt ¶ added in v1.5.0
func NewRenameColumnStmt(table, oldName, newName string) *RenameColumnStmt
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 TableAlias() string Parameters() map[string]interface{} Read(ctx context.Context) (*Row, error) Close() error Columns(ctx context.Context) ([]ColDescriptor, error) OrderBy() []ColDescriptor ScanSpecs() *ScanSpecs InferParameters(ctx context.Context, params map[string]SQLValueType) error // contains filtered or unexported methods }
type SQLStmt ¶
type SQLStmt interface {
// contains filtered or unexported methods
}
func ParseString ¶
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) FirstInsertedPKs ¶ added in v1.2.2
func (*SQLTx) IsExplicitCloseRequired ¶ added in v1.5.0
func (*SQLTx) LastInsertedPKs ¶ added in v1.2.0
func (*SQLTx) RequireExplicitClose ¶ added in v1.5.0
func (*SQLTx) UpdatedRows ¶ added in v1.2.0
type SQLValueType ¶
type SQLValueType = string
const ( IntegerType SQLValueType = "INTEGER" BooleanType SQLValueType = "BOOLEAN" VarcharType SQLValueType = "VARCHAR" BLOBType SQLValueType = "BLOB" Float64Type SQLValueType = "FLOAT" TimestampType SQLValueType = "TIMESTAMP" AnyType SQLValueType = "ANY" )
type SelectStmt ¶
type SelectStmt struct {
// contains filtered or unexported fields
}
func NewSelectStmt ¶ added in v1.5.0
func (*SelectStmt) Alias ¶
func (stmt *SelectStmt) Alias() string
type SumValue ¶
type SumValue struct {
// contains filtered or unexported fields
}
func (*SumValue) ColBounded ¶
func (*SumValue) Type ¶
func (v *SumValue) Type() SQLValueType
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) ColsByName ¶
func (*Table) ColumnsByID ¶ added in v1.5.0
func (*Table) GetIndexByName ¶ added in v1.5.0
func (*Table) GetIndexes ¶ added in v1.5.0
func (*Table) IndexesByColID ¶ added in v1.1.0
func (*Table) PrimaryIndex ¶ added in v1.1.0
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) Type ¶ added in v1.2.0
func (v *Timestamp) Type() SQLValueType
type TxOptions ¶ added in v1.5.0
type TxOptions struct { ReadOnly bool SnapshotMustIncludeTxID func(lastPrecommittedTxID uint64) uint64 SnapshotRenewalPeriod time.Duration ExplicitClose bool UnsafeMVCC bool }
func DefaultTxOptions ¶ added in v1.5.0
func DefaultTxOptions() *TxOptions
func (*TxOptions) WithExplicitClose ¶ added in v1.5.0
func (*TxOptions) WithReadOnly ¶ added in v1.5.0
func (*TxOptions) WithSnapshotMustIncludeTxID ¶ added in v1.5.0
func (*TxOptions) WithSnapshotRenewalPeriod ¶ added in v1.5.0
func (*TxOptions) WithUnsafeMVCC ¶ added in v1.5.0
type TypedValue ¶
type TypedValue interface { ValueExp Type() SQLValueType RawValue() 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
}
type UpdateStmt ¶ added in v1.2.0
type UpdateStmt struct {
// contains filtered or unexported fields
}
func NewUpdateStmt ¶ added in v1.5.0
func NewUpdateStmt(table string, where ValueExp, update *colUpdate) *UpdateStmt
type UpsertIntoStmt ¶
type UpsertIntoStmt struct {
// contains filtered or unexported fields
}
func NewUpserIntoStmt ¶ added in v1.5.0
func NewUpserIntoStmt(table string, cols []string, rows []*RowSpec, isInsert bool, onConflict *OnConflictDo) *UpsertIntoStmt
type UseDatabaseStmt ¶
type UseDatabaseStmt struct {
DB string
}
type UseSnapshotStmt ¶
type UseSnapshotStmt struct {
// contains filtered or unexported fields
}
type Varchar ¶
type Varchar struct {
// contains filtered or unexported fields
}
func NewVarchar ¶ added in v1.5.0
func (*Varchar) Type ¶
func (v *Varchar) Type() SQLValueType
Source Files
¶
- aggregated_values.go
- catalog.go
- cond_row_reader.go
- distinct_row_reader.go
- engine.go
- grouped_row_reader.go
- implicit_conversion.go
- joint_row_reader.go
- limit_row_reader.go
- num_operator.go
- offset_row_reader.go
- options.go
- parser.go
- proj_row_reader.go
- row_reader.go
- sql_parser.go
- sql_tx.go
- sql_tx_options.go
- stmt.go
- timestamp.go
- type_conversion.go
- union_row_reader.go
- values_row_reader.go