tidb

package
v0.0.0-...-8b6b441 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalTypeToString

func EvalTypeToString(t types.EvalType) string

Types

type Context

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

func (*Context) Compile

func (db *Context) Compile(sql string) (*executor.ExecStmt, error)

Parse and compile `stmt` sql string into physical plan

func (*Context) CompileStmtNode

func (db *Context) CompileStmtNode(stmt ast.StmtNode) (*executor.ExecStmt, error)

Compile `stmt` AST into physical plan

func (*Context) CurrentDB

func (db *Context) CurrentDB() string

func (*Context) Execute

func (db *Context) Execute(sql string) error

Execute `sql` as statements, allows multiple

func (*Context) ExecuteOne

func (db *Context) ExecuteOne(sql string) (server.ResultSet, error)

func (*Context) ExecuteOneStmt

func (db *Context) ExecuteOneStmt(stmt ast.StmtNode) (server.ResultSet, error)

func (*Context) ExecuteWithTransform

func (db *Context) ExecuteWithTransform(sql string, transform StmtTransform) error

Parse all statements in `sql`, `transform` them, then execute them

func (*Context) MayCreateDB

func (db *Context) MayCreateDB(dbName string) error

func (*Context) Parse

func (db *Context) Parse(sql string) ([]ast.StmtNode, error)

func (*Context) ParseOne

func (db *Context) ParseOne(sql string) (ast.StmtNode, error)

func (*Context) RestoreSQL

func (db *Context) RestoreSQL(node ast.Node) (string, error)

Restore AST to sql string, with some customizations

func (*Context) UseDB

func (db *Context) UseDB(dbName string) error

type Instance

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

func NewInstance

func NewInstance() (*Instance, error)

Create a new `TiDBDriver` as `Instance` with mock store

func (*Instance) OpenContext

func (i *Instance) OpenContext() (*Context, error)

Open a new `Context` for executing or compiling statements

type StmtTransform

type StmtTransform = func(ast.StmtNode) ast.StmtNode

Jump to

Keyboard shortcuts

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