stmts

package
v0.0.0-...-b001c0d Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2015 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoPriority = iota
	LowPriority
	HighPriority
	DelayedPriority
)

Priority const values. See: https://dev.mysql.com/doc/refman/5.7/en/insert.html

Variables

This section is empty.

Functions

This section is empty.

Types

type AlterTableStmt

type AlterTableStmt struct {
	Ident table.Ident
	Specs []*ddl.AlterSpecification

	Text string
}

AlterTableStmt is a statement to change the structure of a table. See: https://dev.mysql.com/doc/refman/5.7/en/alter-table.html

func (*AlterTableStmt) Exec

func (s *AlterTableStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*AlterTableStmt) Explain

func (s *AlterTableStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*AlterTableStmt) IsDDL

func (s *AlterTableStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*AlterTableStmt) OriginText

func (s *AlterTableStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*AlterTableStmt) SetText

func (s *AlterTableStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type BeginStmt

type BeginStmt struct {
	Text string
}

BeginStmt is a statement to start a new transaction. See: https://dev.mysql.com/doc/refman/5.7/en/commit.html

func (*BeginStmt) Exec

func (s *BeginStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*BeginStmt) Explain

func (s *BeginStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*BeginStmt) IsDDL

func (s *BeginStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*BeginStmt) OriginText

func (s *BeginStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*BeginStmt) SetText

func (s *BeginStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type CommitStmt

type CommitStmt struct {
	Text string
}

CommitStmt is a statement to commit the current transaction. See: https://dev.mysql.com/doc/refman/5.7/en/commit.html

func (*CommitStmt) Exec

func (s *CommitStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*CommitStmt) Explain

func (s *CommitStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*CommitStmt) IsDDL

func (s *CommitStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*CommitStmt) OriginText

func (s *CommitStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*CommitStmt) SetText

func (s *CommitStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type CreateDatabaseStmt

type CreateDatabaseStmt struct {
	IfNotExists bool
	Name        string
	Opt         *coldef.CharsetOpt

	Text string
}

CreateDatabaseStmt is a statement to create a database. See: https://dev.mysql.com/doc/refman/5.7/en/create-database.html

func (*CreateDatabaseStmt) Exec

func (s *CreateDatabaseStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*CreateDatabaseStmt) Explain

func (s *CreateDatabaseStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*CreateDatabaseStmt) IsDDL

func (s *CreateDatabaseStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*CreateDatabaseStmt) OriginText

func (s *CreateDatabaseStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*CreateDatabaseStmt) SetText

func (s *CreateDatabaseStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type CreateIndexStmt

type CreateIndexStmt struct {
	IndexName     string
	TableIdent    table.Ident
	Unique        bool
	IndexColNames []*coldef.IndexColName

	Text string
}

CreateIndexStmt is a statement to create an index. See: https://dev.mysql.com/doc/refman/5.7/en/create-index.html

func (*CreateIndexStmt) Exec

Exec implements the stmt.Statement Exec interface.

func (*CreateIndexStmt) Explain

func (s *CreateIndexStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*CreateIndexStmt) IsDDL

func (s *CreateIndexStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*CreateIndexStmt) OriginText

func (s *CreateIndexStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*CreateIndexStmt) SetText

func (s *CreateIndexStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type CreateTableStmt

type CreateTableStmt struct {
	IfNotExists bool
	Ident       table.Ident
	Cols        []*coldef.ColumnDef
	Constraints []*coldef.TableConstraint
	Opt         *coldef.TableOption

	Text string
}

CreateTableStmt is a statement to create a table. See: https://dev.mysql.com/doc/refman/5.7/en/create-table.html

func (*CreateTableStmt) Exec

func (s *CreateTableStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*CreateTableStmt) Explain

func (s *CreateTableStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*CreateTableStmt) IsDDL

func (s *CreateTableStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*CreateTableStmt) OriginText

func (s *CreateTableStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*CreateTableStmt) SetText

func (s *CreateTableStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type DeallocateStmt

type DeallocateStmt struct {
	Name string
	ID   uint32 // For binary protocol, there is no Name but only ID.

	Text string
}

DeallocateStmt is a statement to release PreparedStmt. See: https://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html

func (*DeallocateStmt) Exec

func (s *DeallocateStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*DeallocateStmt) Explain

func (s *DeallocateStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*DeallocateStmt) IsDDL

func (s *DeallocateStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*DeallocateStmt) OriginText

func (s *DeallocateStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*DeallocateStmt) SetText

func (s *DeallocateStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type DeleteStmt

type DeleteStmt struct {
	TableIdent  table.Ident
	Where       expression.Expression
	Order       *rsets.OrderByRset
	Limit       *rsets.LimitRset
	LowPriority bool
	Ignore      bool
	Quick       bool
	MultiTable  bool
	BeforeFrom  bool
	TableIdents []table.Ident
	Refs        *rsets.JoinRset

	Text string
}

DeleteStmt is a statement to delete rows from table. See: https://dev.mysql.com/doc/refman/5.7/en/delete.html

func (*DeleteStmt) Exec

func (s *DeleteStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*DeleteStmt) Explain

func (s *DeleteStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*DeleteStmt) IsDDL

func (s *DeleteStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*DeleteStmt) OriginText

func (s *DeleteStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*DeleteStmt) SetText

func (s *DeleteStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type DoStmt

type DoStmt struct {
	Exprs []expression.Expression

	Text string
}

DoStmt is a statement to execute the expressions but not get any results. See: https://dev.mysql.com/doc/refman/5.7/en/do.html

func (*DoStmt) Exec

func (s *DoStmt) Exec(ctx context.Context) (rset.Recordset, error)

Exec implements the stmt.Statement Exec interface.

func (*DoStmt) Explain

func (s *DoStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*DoStmt) IsDDL

func (s *DoStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*DoStmt) OriginText

func (s *DoStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*DoStmt) SetText

func (s *DoStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type DropDatabaseStmt

type DropDatabaseStmt struct {
	IfExists bool
	Name     string

	Text string
}

DropDatabaseStmt is a statement to drop a database and all tables in the database. See: https://dev.mysql.com/doc/refman/5.7/en/drop-database.html

func (*DropDatabaseStmt) Exec

Exec implements the stmt.Statement Exec interface.

func (*DropDatabaseStmt) Explain

func (s *DropDatabaseStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*DropDatabaseStmt) IsDDL

func (s *DropDatabaseStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*DropDatabaseStmt) OriginText

func (s *DropDatabaseStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*DropDatabaseStmt) SetText

func (s *DropDatabaseStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type DropIndexStmt

type DropIndexStmt struct {
	IfExists  bool
	IndexName string

	Text string
}

DropIndexStmt is a statement to drop the index. See: https://dev.mysql.com/doc/refman/5.7/en/drop-index.html

func (*DropIndexStmt) Exec

func (s *DropIndexStmt) Exec(ctx context.Context) (rset.Recordset, error)

Exec implements the stmt.Statement Exec interface.

func (*DropIndexStmt) Explain

func (s *DropIndexStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*DropIndexStmt) IsDDL

func (s *DropIndexStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*DropIndexStmt) OriginText

func (s *DropIndexStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*DropIndexStmt) SetText

func (s *DropIndexStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type DropTableStmt

type DropTableStmt struct {
	IfExists    bool
	TableIdents []table.Ident

	Text string
}

DropTableStmt is a statement to drop one or more tables. See: https://dev.mysql.com/doc/refman/5.7/en/drop-table.html

func (*DropTableStmt) Exec

func (s *DropTableStmt) Exec(ctx context.Context) (rset.Recordset, error)

Exec implements the stmt.Statement Exec interface.

func (*DropTableStmt) Explain

func (s *DropTableStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*DropTableStmt) IsDDL

func (s *DropTableStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*DropTableStmt) OriginText

func (s *DropTableStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*DropTableStmt) SetText

func (s *DropTableStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type ExecuteStmt

type ExecuteStmt struct {
	Name      string
	ID        uint32 // For binary protocol, there is no Name but only ID
	UsingVars []expression.Expression

	Text string
}

ExecuteStmt is a statement to execute PreparedStmt. See: https://dev.mysql.com/doc/refman/5.7/en/execute.html

func (*ExecuteStmt) Exec

func (s *ExecuteStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*ExecuteStmt) Explain

func (s *ExecuteStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*ExecuteStmt) IsDDL

func (s *ExecuteStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*ExecuteStmt) OriginText

func (s *ExecuteStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*ExecuteStmt) SetText

func (s *ExecuteStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type ExplainStmt

type ExplainStmt struct {
	S stmt.Statement

	Text string
}

ExplainStmt is a statement to provide information about how is SQL statement executed or get columns information in a table. See: https://dev.mysql.com/doc/refman/5.7/en/explain.html

func (*ExplainStmt) Exec

func (s *ExplainStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*ExplainStmt) Explain

func (s *ExplainStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*ExplainStmt) IsDDL

func (s *ExplainStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*ExplainStmt) OriginText

func (s *ExplainStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*ExplainStmt) SetText

func (s *ExplainStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type InsertIntoStmt

type InsertIntoStmt struct {
	ColNames    []string
	Lists       [][]expression.Expression
	Sel         *SelectStmt
	TableIdent  table.Ident
	Setlist     []*expressions.Assignment
	Priority    int
	OnDuplicate []expressions.Assignment

	Text string
}

InsertIntoStmt is a statement to insert new rows into an existing table. See: https://dev.mysql.com/doc/refman/5.7/en/insert.html

func (*InsertIntoStmt) Exec

func (s *InsertIntoStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*InsertIntoStmt) Explain

func (s *InsertIntoStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*InsertIntoStmt) IsDDL

func (s *InsertIntoStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*InsertIntoStmt) OriginText

func (s *InsertIntoStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*InsertIntoStmt) SetText

func (s *InsertIntoStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type PreparedStmt

type PreparedStmt struct {
	InPrepare bool // true for prepare mode, false for use mode
	Name      string
	ID        uint32 // For binary protocol, there is no Name but only ID
	SQLText   string
	SQLVar    *expressions.Variable
	SQLStmt   stmt.Statement // The parsed statement from sql text with placeholder
	Params    []*expressions.ParamMarker
	Fields    []*field.ResultField

	Text string
}

PreparedStmt is a statement to prepares a SQL statement which contains placeholders, and it is executed with ExecuteStmt and released with DeallocateStmt. See: https://dev.mysql.com/doc/refman/5.7/en/prepare.html

func (*PreparedStmt) Exec

func (s *PreparedStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*PreparedStmt) Explain

func (s *PreparedStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*PreparedStmt) GetSQL

func (s *PreparedStmt) GetSQL(ctx context.Context) (string, error)

GetSQL get prepared SQL text.

func (*PreparedStmt) IsDDL

func (s *PreparedStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*PreparedStmt) OriginText

func (s *PreparedStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*PreparedStmt) SetText

func (s *PreparedStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type RollbackStmt

type RollbackStmt struct {
	Text string
}

RollbackStmt is a statement to roll back the current transaction. See: https://dev.mysql.com/doc/refman/5.7/en/commit.html

func (*RollbackStmt) Exec

func (s *RollbackStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*RollbackStmt) Explain

func (s *RollbackStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*RollbackStmt) IsDDL

func (s *RollbackStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*RollbackStmt) OriginText

func (s *RollbackStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*RollbackStmt) SetText

func (s *RollbackStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type SelectStmt

type SelectStmt struct {
	Distinct bool
	Fields   []*field.Field
	From     *rsets.JoinRset
	GroupBy  *rsets.GroupByRset
	Having   *rsets.HavingRset
	Limit    *rsets.LimitRset
	Offset   *rsets.OffsetRset
	OrderBy  *rsets.OrderByRset
	Where    *rsets.WhereRset
	// TODO: rename Lock
	Lock coldef.LockType

	Text string
}

SelectStmt is a statement to retrieve rows selected from one or more tables. See: https://dev.mysql.com/doc/refman/5.7/en/select.html

func (*SelectStmt) Exec

func (s *SelectStmt) Exec(ctx context.Context) (rs rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*SelectStmt) Explain

func (s *SelectStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*SelectStmt) IsDDL

func (s *SelectStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*SelectStmt) OriginText

func (s *SelectStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*SelectStmt) Plan

func (s *SelectStmt) Plan(ctx context.Context) (plan.Plan, error)

Plan implements the plan.Planner interface. The whole phase for select is `from -> where -> lock -> group by -> having -> select fields -> distinct -> order by -> limit -> final`

func (*SelectStmt) SetText

func (s *SelectStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type SetCharsetStmt

type SetCharsetStmt struct {
	Charset string
	Collate string

	Text string
}

SetCharsetStmt is a statement to assign values to character and collation variables. See: https://dev.mysql.com/doc/refman/5.7/en/set-statement.html

func (*SetCharsetStmt) Exec

func (s *SetCharsetStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*SetCharsetStmt) Explain

func (s *SetCharsetStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*SetCharsetStmt) IsDDL

func (s *SetCharsetStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*SetCharsetStmt) OriginText

func (s *SetCharsetStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*SetCharsetStmt) SetText

func (s *SetCharsetStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type SetPwdStmt

type SetPwdStmt struct {
	User     string
	Password string

	Text string
}

SetPwdStmt is a statement to assign a password to user account. See: https://dev.mysql.com/doc/refman/5.7/en/set-password.html

func (*SetPwdStmt) Exec

func (s *SetPwdStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*SetPwdStmt) Explain

func (s *SetPwdStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*SetPwdStmt) IsDDL

func (s *SetPwdStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*SetPwdStmt) OriginText

func (s *SetPwdStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*SetPwdStmt) SetText

func (s *SetPwdStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type SetStmt

type SetStmt struct {
	Variables []*VariableAssignment

	Text string
}

SetStmt is a statement to assigns values to different types of variables. See: https://dev.mysql.com/doc/refman/5.7/en/set-statement.html

func (*SetStmt) Exec

func (s *SetStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*SetStmt) Explain

func (s *SetStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*SetStmt) IsDDL

func (s *SetStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*SetStmt) OriginText

func (s *SetStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*SetStmt) SetText

func (s *SetStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type ShowStmt

type ShowStmt struct {
	Target     int // Databases/Tables/Columns/....
	DBName     string
	TableIdent table.Ident // Used for showing columns.
	ColumnName string      // Used for `desc table column`.
	Flag       int         // Some flag parsed from sql, such as FULL.
	Full       bool

	Text string
}

ShowStmt is a statement to provide information about databases, tables, columns and so on. See: https://dev.mysql.com/doc/refman/5.7/en/show.html

func (*ShowStmt) Exec

func (s *ShowStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*ShowStmt) Explain

func (s *ShowStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*ShowStmt) IsDDL

func (s *ShowStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*ShowStmt) OriginText

func (s *ShowStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*ShowStmt) SetText

func (s *ShowStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type TruncateTableStmt

type TruncateTableStmt struct {
	TableIdent table.Ident

	Text string
}

TruncateTableStmt is a statement to empty a table completely. See: https://dev.mysql.com/doc/refman/5.7/en/truncate-table.html

func (*TruncateTableStmt) Exec

Exec implements the stmt.Statement Exec interface.

func (*TruncateTableStmt) Explain

func (s *TruncateTableStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*TruncateTableStmt) IsDDL

func (s *TruncateTableStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*TruncateTableStmt) OriginText

func (s *TruncateTableStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*TruncateTableStmt) SetText

func (s *TruncateTableStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type UnionStmt

type UnionStmt struct {
	Distincts []bool
	Selects   []*SelectStmt

	Text string
}

UnionStmt is a statement to combine results from multiple SelectStmts. See: https://dev.mysql.com/doc/refman/5.7/en/union.html

func (*UnionStmt) Exec

func (s *UnionStmt) Exec(ctx context.Context) (rs rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*UnionStmt) Explain

func (s *UnionStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*UnionStmt) IsDDL

func (s *UnionStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*UnionStmt) OriginText

func (s *UnionStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*UnionStmt) Plan

func (s *UnionStmt) Plan(ctx context.Context) (plan.Plan, error)

Plan implements the plan.Planner interface.

func (*UnionStmt) SetText

func (s *UnionStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type UpdateStmt

type UpdateStmt struct {
	TableIdent  table.Ident
	List        []expressions.Assignment
	Where       expression.Expression
	Order       *rsets.OrderByRset
	Limit       *rsets.LimitRset
	LowPriority bool
	Ignore      bool

	Text string
}

UpdateStmt is a statement to update columns of existing rows in tables with new values. See: https://dev.mysql.com/doc/refman/5.7/en/update.html

func (*UpdateStmt) Exec

func (s *UpdateStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*UpdateStmt) Explain

func (s *UpdateStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*UpdateStmt) IsDDL

func (s *UpdateStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*UpdateStmt) OriginText

func (s *UpdateStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*UpdateStmt) SetText

func (s *UpdateStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type UseStmt

type UseStmt struct {
	DBName string

	Text string
}

UseStmt is a statement to use the DBName database as the current database. See: https://dev.mysql.com/doc/refman/5.7/en/use.html

func (*UseStmt) Exec

func (s *UseStmt) Exec(ctx context.Context) (_ rset.Recordset, err error)

Exec implements the stmt.Statement Exec interface.

func (*UseStmt) Explain

func (s *UseStmt) Explain(ctx context.Context, w format.Formatter)

Explain implements the stmt.Statement Explain interface.

func (*UseStmt) IsDDL

func (s *UseStmt) IsDDL() bool

IsDDL implements the stmt.Statement IsDDL interface.

func (*UseStmt) OriginText

func (s *UseStmt) OriginText() string

OriginText implements the stmt.Statement OriginText interface.

func (*UseStmt) SetText

func (s *UseStmt) SetText(text string)

SetText implements the stmt.Statement SetText interface.

type VariableAssignment

type VariableAssignment struct {
	Name     string
	Value    expression.Expression
	IsGlobal bool
	IsSystem bool

	Text string
}

VariableAssignment is a varible assignment struct.

func (*VariableAssignment) String

func (v *VariableAssignment) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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