performance

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDb

func GetDb(name string, configPath string) *sql.DB

Types

type Config

type Config struct {
	Username string `json:"username":`
	Password string `json:"password":`
	Hostname string `json:"hostname":`
	Port     string `json:"port":`
	Charset  string `json:"charset":`
}

用json配置测试

type Explain

type Explain struct {
	Db *sql.DB
}

func (*Explain) Analyze

func (obj *Explain) Analyze(sql string) (*ExplainEntity, error)

func (*Explain) GetDb

func (obj *Explain) GetDb(name string, configPath string) *sql.DB

func (*Explain) Init

func (obj *Explain) Init(name string, configPath string) bool

func (*Explain) SelectAll

func (obj *Explain) SelectAll(sql string) (*sql.Rows, error)

type ExplainEntity

type ExplainEntity struct {
	Id           sql.NullString `json:"id":`
	SelectType   sql.NullString `json:"select_type":`
	Table        sql.NullString `json:"table":`
	Partitions   sql.NullString `json:"partitions":`
	Type         sql.NullString `json:"type":`
	PossibleKeys sql.NullString `json:"possible_keys":`
	Key          sql.NullString `json:"key":`
	KeyLen       sql.NullString `json:"key_len":`
	Ref          sql.NullString `json:"ref":`
	Rows         sql.NullString `json:"rows":`
	Filtered     sql.NullString `json:"filtered":`
	Extra        sql.NullString `json:"Extra":`
}

func (*ExplainEntity) ToJson

func (entity *ExplainEntity) ToJson() (string, error)

Jump to

Keyboard shortcuts

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