Documentation ¶
Index ¶
- Constants
- func Ping(entry *logrus.Entry, instance *mdriver.DSN) error
- type BaseConn
- func (c *BaseConn) Close()
- func (c *BaseConn) Exec(query string) (driver.Result, error)
- func (c *BaseConn) Logger() *logrus.Entry
- func (c *BaseConn) Ping() error
- func (c *BaseConn) Query(query string, args ...interface{}) ([]map[string]sql.NullString, error)
- func (c *BaseConn) QueryWithContext(ctx context.Context, query string, args ...interface{}) (column []string, row [][]sql.NullString, err error)
- func (c *BaseConn) Transact(qs ...string) ([]driver.Result, error)
- type Db
- type Executor
- func (c *Executor) Explain(query string) (columns []string, rows [][]sql.NullString, err error)
- func (c *Executor) FetchMasterBinlogPos() (string, int64, error)
- func (c *Executor) GetExplainRecord(query string) ([]*ExplainRecord, error)
- func (c *Executor) GetTableColumnsInfo(schema, tableName string) ([]*TableColumnsInfo, error)
- func (c *Executor) GetTableIndexesInfo(schema, tableName string) ([]*TableIndexesInfo, error)
- func (c *Executor) IsLowerCaseTableNames() bool
- func (c *Executor) SetLowerCaseTableNames(lowerCaseTableNames bool)
- func (c *Executor) ShowCreateTable(schema, tableName string) (string, error)
- func (c *Executor) ShowCreateView(tableName string) (string, error)
- func (c *Executor) ShowDatabases(ignoreSysDatabase bool) ([]string, error)
- func (c *Executor) ShowDefaultConfiguration(sql, column string) (string, error)
- func (c *Executor) ShowMasterStatus() ([]map[string]sql.NullString, error)
- func (c *Executor) ShowSchemaTables(schema string) ([]string, error)
- func (c *Executor) ShowSchemaViews(schema string) ([]string, error)
- func (c *Executor) ShowTableSizeMB(schema, table string) (float64, error)
- type ExplainRecord
- type TableColumnsInfo
- type TableIndexesInfo
Constants ¶
View Source
const ( ExplainRecordExtraUsingFilesort = "Using filesort" ExplainRecordExtraUsingTemporary = "Using temporary" ExplainRecordAccessTypeAll = "ALL" ExplainRecordAccessTypeIndex = "index" )
https://dev.mysql.com/doc/refman/5.7/en/explain-output.html#explain_rows
View Source
const DAIL_TIMEOUT = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseConn ¶
type BaseConn struct {
// contains filtered or unexported fields
}
func (*BaseConn) QueryWithContext ¶ added in v1.2205.0
type Db ¶
type Db interface { Close() Ping() error Exec(query string) (driver.Result, error) Transact(qs ...string) ([]driver.Result, error) Query(query string, args ...interface{}) ([]map[string]sql.NullString, error) QueryWithContext(ctx context.Context, query string, args ...interface{}) (column []string, row [][]sql.NullString, err error) Logger() *logrus.Entry }
type Executor ¶
type Executor struct { Db Db // contains filtered or unexported fields }
func NewExecutor ¶
func NewMockExecutor ¶
NewMockExecutor returns a new mock executor.
func (*Executor) FetchMasterBinlogPos ¶
func (*Executor) GetExplainRecord ¶ added in v1.2206.0
func (c *Executor) GetExplainRecord(query string) ([]*ExplainRecord, error)
func (*Executor) GetTableColumnsInfo ¶ added in v1.2206.0
func (c *Executor) GetTableColumnsInfo(schema, tableName string) ([]*TableColumnsInfo, error)
func (*Executor) GetTableIndexesInfo ¶ added in v1.2206.0
func (c *Executor) GetTableIndexesInfo(schema, tableName string) ([]*TableIndexesInfo, error)
func (*Executor) IsLowerCaseTableNames ¶ added in v1.2207.0
func (*Executor) SetLowerCaseTableNames ¶ added in v1.2207.0
func (*Executor) ShowCreateTable ¶
When using keywords as table names, you need to pay attention to wrapping them in quotation marks
func (*Executor) ShowCreateView ¶ added in v1.2202.0
When using keywords as view names, you need to pay attention to wrapping them in quotation marks
func (*Executor) ShowDatabases ¶
func (*Executor) ShowDefaultConfiguration ¶
func (*Executor) ShowMasterStatus ¶
func (c *Executor) ShowMasterStatus() ([]map[string]sql.NullString, error)
func (*Executor) ShowSchemaTables ¶
func (*Executor) ShowSchemaViews ¶ added in v1.2202.0
type ExplainRecord ¶
type ExplainRecord struct { Id string `json:"id"` SelectType string `json:"select_type"` Table string `json:"table"` Partitions string `json:"partitions"` Type string `json:"type"` PossibleKeys string `json:"possible_keys"` Key string `json:"key"` KeyLen string `json:"key_len"` Ref string `json:"ref"` Rows int64 `json:"rows"` Filtered string `json:"filtered"` Extra string `json:"extra"` }
type TableColumnsInfo ¶ added in v1.2206.0
Click to show internal directories.
Click to hide internal directories.