mysql

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2016 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DMLToSelect

func DMLToSelect(query string) string

MySQL version prior 5.6.3 cannot run explain on DML commands. From the doc: http://dev.mysql.com/doc/refman/5.6/en/explain.html "As of MySQL 5.6.3, permitted explainable statements for EXPLAIN are SELECT, DELETE, INSERT, REPLACE, and UPDATE. Before MySQL 5.6.3, SELECT is the only explainable statement."

This function converts DML queries to the equivalent SELECT to make it able to explain DML queries on older MySQL versions

func Ident

func Ident(db, table string) string

func IsDMLQuery

func IsDMLQuery(query string) bool

Types

type QueryExecutor

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

func NewQueryExecutor

func NewQueryExecutor(conn mysql.Connector) *QueryExecutor

func (*QueryExecutor) Explain

func (e *QueryExecutor) Explain(db, query string, convert bool) (*proto.ExplainResult, error)

func (*QueryExecutor) TableInfo

func (e *QueryExecutor) TableInfo(tables *proto.TableInfoQuery) (proto.TableInfoResult, error)

Jump to

Keyboard shortcuts

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