Versions in this module Expand all Collapse all v0 v0.11.1 Mar 26, 2024 Changes in this version + const CS + const ExtendedExplainType + const IndexColumnName + const IndexIndexType + const IndexKeyName + const IndexNonUnique + const JSONFormatExplain + const PART + const PartitionsExplainType + const TimeFormat + const TraditionalExplainType + const TraditionalFormatExplain + var ExplainAccessType = map[string]string + var ExplainExtra = map[string]string + var ExplainFormatType = map[string]int + var ExplainKeyWords = []string + var ExplainScalability = map[string]string + var ExplainSelectType = map[string]string + var ExplainType = map[string]int + func Escape(source string, NoBackslashEscapes bool) string + func ExplainInfoTranslator(exp *ExplainInfo) string + func FormatProfiling(rows []ProfilingRow) string + func FormatTrace(rows []TraceRow) string + func MySQLExplainQueryCost(exp *ExplainInfo) string + func MySQLExplainWarnings(exp *ExplainInfo) string + func NullFloat(buf []byte) float64 + func NullInt(buf []byte) int64 + func NullString(buf []byte) string + func PrintMarkdownExplainTable(exp *ExplainInfo) string + func RemoveSQLComments(sql string) string + func TimeString(t time.Time) string + type Connector struct + Addr string + Charset string + Conn *sql.DB + Database string + Pass string + User string + func NewConnector(dsn *common.Dsn) (*Connector, error) + func (db *Connector) ColumnCardinality(tb, col string) float64 + func (db *Connector) CurrentUser() (string, string, error) + func (db *Connector) Explain(sql string, explainType int, formatType int) (exp *ExplainInfo, err error) + func (db *Connector) FindColumn(name, dbName string, tables ...string) ([]*common.Column, error) + func (db *Connector) HasAllPrivilege() bool + func (db *Connector) HasSelectPrivilege() bool + func (db *Connector) IsForeignKey(dbName, tbName, column string) bool + func (db *Connector) IsView(tbName string) bool + func (db *Connector) Profiling(sql string, params ...interface{}) ([]ProfilingRow, error) + func (db *Connector) Query(sql string, params ...interface{}) (QueryResult, error) + func (db *Connector) SamplingData(onlineConn *Connector, tables ...string) error + func (db *Connector) ShowColumns(tableName string) (*TableDesc, error) + func (db *Connector) ShowCreateDatabase(dbName string) (string, error) + func (db *Connector) ShowCreateTable(tableName string) (string, error) + func (db *Connector) ShowIndex(tableName string) (*TableIndexInfo, error) + func (db *Connector) ShowReference(dbName string, tbName ...string) ([]ReferenceValue, error) + func (db *Connector) ShowTableStatus(tableName string) (*TableStatInfo, error) + func (db *Connector) ShowTables() ([]string, error) + func (db *Connector) SingleIntValue(option string) (int, error) + func (db *Connector) Trace(sql string, params ...interface{}) ([]TraceRow, error) + func (db *Connector) Version() (int, error) + type ExplainInfo struct + ExplainFormat int + ExplainJSON *ExplainJSON + ExplainRows []ExplainRow + QueryCost float64 + SQL string + Warnings []ExplainWarning + func ParseExplainResult(res QueryResult, formatType int) (exp *ExplainInfo, err error) + func ParseExplainText(content string) (exp *ExplainInfo, err error) + type ExplainJSON struct + QueryBlock ExplainJSONQueryBlock + type ExplainJSONBufferResult struct + NestedLoop []ExplainJSONNestedLoop + Table ExplainJSONTable + UsingTemporaryTable bool + type ExplainJSONCostInfo struct + DataReadPerJoin string + EvalCost string + PrefixCost string + QueryCost string + ReadCost string + SortCost string + type ExplainJSONDuplicatesRemoval struct + BufferResult ExplainJSONBufferResult + GroupingOperation ExplainJSONGroupingOperation + Table ExplainJSONTable + UsingFilesort bool + UsingTemporaryTable bool + type ExplainJSONGroupingOperation struct + CostInfo ExplainJSONCostInfo + GroupBySubqueries []ExplainJSONSubqueries + NestedLoop []ExplainJSONNestedLoop + Table ExplainJSONTable + UsingFilesort bool + UsingTemporaryTable bool + type ExplainJSONMaterializedFromSubquery struct + Cacheable bool + Dependent bool + QueryBlock *ExplainJSONQueryBlock + UsingTemporaryTable bool + type ExplainJSONNestedLoop struct + Table ExplainJSONTable + type ExplainJSONOrderingOperation struct + DuplicatesRemoval ExplainJSONDuplicatesRemoval + GroupingOperation ExplainJSONGroupingOperation + OptimizedAwaySubqueries []ExplainJSONSubqueries + OrderbySubqueries []ExplainJSONSubqueries + Table ExplainJSONTable + UsingFilesort bool + type ExplainJSONQueryBlock struct + CostInfo ExplainJSONCostInfo + GroupingOperation ExplainJSONGroupingOperation + HavingSubqueries []ExplainJSONSubqueries + Message string + NestedLoop []ExplainJSONNestedLoop + OptimizedAwaySubqueries []ExplainJSONSubqueries + OrderingOperation ExplainJSONOrderingOperation + QuerySpecifications []ExplainJSONSubqueries + SelectID int + SelectListSubqueries []ExplainJSONSubqueries + Table ExplainJSONTable + UnionResult ExplainJSONUnionResult + UpdateValueSubqueries []ExplainJSONSubqueries + type ExplainJSONSubqueries struct + Cacheable bool + Dependent bool + QueryBlock ExplainJSONQueryBlock + type ExplainJSONTable struct + AccessType string + AttachedCondition string + AttachedSubqueries []ExplainJSONSubqueries + CostInfo ExplainJSONCostInfo + Filtered string + Key string + KeyLength string + MaterializedFromSubquery ExplainJSONMaterializedFromSubquery + PossibleKeys []string + Ref []string + RowsExaminedPerScan int64 + RowsProducedPerJoin int + TableName string + UsedColumns []string + UsedKeyParts []string + UsingIndex bool + UsingIndexForGroupBy bool + type ExplainJSONUnionResult struct + AccessType string + QuerySpecifications []ExplainJSONSubqueries + TableName string + UsingTemporaryTable bool + type ExplainRow struct + AccessType string + Extra string + Filtered float64 + ID int + Key string + KeyLen string + Partitions string + PossibleKeys []string + Ref []string + Rows int64 + Scalability string + SelectType string + TableName string + func ConvertExplainJSON2Row(explainJSON *ExplainJSON) []ExplainRow + func FormatJSONIntoTraditional(explainJSON string) []ExplainRow + type ExplainWarning struct + Code int + Level string + Message string + type IndexSelectKey string + type Profiling struct + Rows []ProfilingRow + type ProfilingRow struct + Duration float64 + Status string + type QueryResult struct + Error error + QueryCost float64 + Rows *sql.Rows + Warning *sql.Rows + type Reference map[string][]ReferenceValue + type ReferenceValue struct + ConstraintName string + ReferencedTableName string + ReferencedTableSchema string + TableName string + TableSchema string + type TableDesc struct + DescValues []TableDescValue + Name string + func NewTableDesc(tableName string) *TableDesc + func (td TableDesc) Columns() []string + type TableDescValue struct + Collation []byte + Comment string + Default []byte + Extra string + Field string + Key string + Null string + Privileges string + Type string + type TableIndexInfo struct + Rows []TableIndexRow + TableName string + func NewTableIndexInfo(tableName string) *TableIndexInfo + func (tbIndex *TableIndexInfo) FindIndex(arg IndexSelectKey, value string) []TableIndexRow + type TableIndexRow struct + Cardinality int + Collation string + ColumnName string + Comment string + Expression []byte + IndexComment string + IndexType string + KeyName string + NonUnique int + Null string + Packed int + SeqInIndex int + SubPart int + Table string + Visible string + type TableStatInfo struct + Name string + Rows []tableStatusRow + type Trace struct + Rows []TraceRow + type TraceRow struct + InsufficientPrivileges int + MissingBytesBeyondMaxMemSize int + Query string + Trace string