Documentation ¶
Index ¶
- Variables
- func AnyChar(buf string) (string, error)
- func AnyPunct(buf string) (string, error)
- func Char(buf string, c byte) (string, error)
- func Digit(buf string, times int) (match string, rest string, err error)
- func GetDefaultDB(sel ast.StmtNode, dbName string) string
- func Match(buf string, pat func(byte) bool, times int) (match string, rest string, err error)
- func MatchOne(buf string, pat func(byte) bool) (string, error)
- func Number(str string) (int, string, error)
- func RestoreWithDefaultDB(node ast.StmtNode, defaultDB, origin string) string
- func SimpleCases(node ast.StmtNode, defaultDB, origin string) (s string, ok bool)
- func Space(buf string, times int) (string, error)
- func Space0(buf string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPatternNotMatch represents an error that patterns doesn't match. ErrPatternNotMatch = errors.New("Pattern not match") )
Functions ¶
func GetDefaultDB ¶
GetDefaultDB checks if all tables in the AST have explicit DBName. If not, return specified DBName.
func Match ¶
Match matches the `pat` at least `times`, and returns the match, the rest and the error
func RestoreWithDefaultDB ¶
RestoreWithDefaultDB returns restore strings for StmtNode with defaultDB This function is customized for SQL bind usage.
func SimpleCases ¶
SimpleCases captures simple SQL statements and uses string replacement instead of `restore` to improve performance. See https://github.com/lemon-mint/tidb/v7/issues/22398.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.