Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NewNumValFn = func(constant.Value, string, bool) interface{} {
return struct{}{}
}
NewNumValFn allows us to use tree.NewNumVal without a dependency on tree.
var NewPlaceholderFn = func(string) (interface{}, error) { return struct{}{}, nil }
NewPlaceholderFn allows us to use tree.NewPlaceholder without a dependency on tree.
Functions ¶
func HasMultipleStatements ¶
HasMultipleStatements returns true if the sql string contains more than one statements. An error is returned if an invalid token was encountered.
func LastLexicalToken ¶
LastLexicalToken returns the last lexical token. If the string has no lexical tokens, returns 0 and ok=false.
Types ¶
type ScanSymType ¶
type ScanSymType interface { ID() int32 SetID(int32) Pos() int32 SetPos(int32) Str() string SetStr(string) UnionVal() interface{} SetUnionVal(interface{}) }
ScanSymType is the interface for accessing the fields of a yacc symType.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner lexes SQL statements.
func (*Scanner) Cleanup ¶
func (s *Scanner) Cleanup()
Cleanup is used to avoid holding on to memory unnecessarily (for the cases where we reuse a Scanner).
func (*Scanner) Scan ¶
func (s *Scanner) Scan(lval ScanSymType)
Scan scans the next token and populates its information into lval.
func (*Scanner) ScanComment ¶
func (s *Scanner) ScanComment(lval ScanSymType) (present, ok bool)
ScanComment scans the input as a comment.