keys

package
v0.0.0-...-1390f1c Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config) error

Types

type Columns

type Columns []vindexes.Column

type Config

type Config struct {
	FileName string
	Loader   data.Loader
}

type Output

type Output struct {
	FileType string                `json:"fileType"`
	Queries  []QueryAnalysisResult `json:"queries"`
	Failed   []QueryFailedResult   `json:"failed,omitempty"`
}

Output represents the output generated by 'vt keys'

func ReadKeysFile

func ReadKeysFile(fileName string) (ko Output, err error)

type QueryAnalysisResult

type QueryAnalysisResult struct {
	QueryStructure  string                    `json:"queryStructure"`
	UsageCount      int                       `json:"usageCount"`
	LineNumbers     []int                     `json:"lineNumbers"`
	TableNames      []string                  `json:"tableNames,omitempty"`
	GroupingColumns []operators.Column        `json:"groupingColumns,omitempty"`
	JoinPredicates  []operators.JoinPredicate `json:"joinPredicates,omitempty"`
	FilterColumns   []operators.ColumnUse     `json:"filterColumns,omitempty"`
	StatementType   string                    `json:"statementType"`
	QueryTime       float64                   `json:"queryTime,omitempty"`
	LockTime        float64                   `json:"lockTime,omitempty"`
	RowsSent        int                       `json:"rowsSent,omitempty"`
	RowsExamined    int                       `json:"rowsExamined,omitempty"`
	Timestamp       int64                     `json:"timestamp,omitempty"`
}

QueryAnalysisResult represents the result of analyzing a query in a query log. It contains the query structure, the number of times the query was used, the line numbers where the query was used, the table name, grouping columns, join columns, filter columns, and the statement type.

type QueryFailedResult

type QueryFailedResult struct {
	Query       string `json:"query"`
	LineNumbers []int  `json:"lineNumbers"`
	Error       string `json:"error"`
}

type SchemaInfo

type SchemaInfo struct {
	KsName string
	Tables map[string]Columns
}

SchemaInfo is a simple implementation of semantics.SchemaInformation It will claim that any table that is asked for is present in the schema, with no columns specified and authoratative columns set to false it has a createTableHandler that can be used to populate the schema if the query log contains the CREATE TABLE statements

func (*SchemaInfo) ConnCollation

func (s *SchemaInfo) ConnCollation() collations.ID

func (*SchemaInfo) Environment

func (s *SchemaInfo) Environment() *vtenv.Environment

func (*SchemaInfo) FindMirrorRule

func (s *SchemaInfo) FindMirrorRule(sqlparser.TableName) (*vindexes.MirrorRule, error)

func (*SchemaInfo) FindTableOrVindex

func (*SchemaInfo) ForeignKeyMode

func (*SchemaInfo) GetAggregateUDFs

func (s *SchemaInfo) GetAggregateUDFs() []string

func (*SchemaInfo) GetForeignKeyChecksState

func (s *SchemaInfo) GetForeignKeyChecksState() *bool

func (*SchemaInfo) KeyspaceError

func (s *SchemaInfo) KeyspaceError(string) error

Jump to

Keyboard shortcuts

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