lex

package
v1.4.0-nextgen.202510.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReadOnly

func IsReadOnly(sql string) bool

ignore prepared statements in text-protocol ignore EXPLAIN, EXPLAIN ANALYZE, and TRACE include SELECT FOR UPDATE because it doesn't require write privilege include SET because SET SESSION_STATES and SET session variables should be executed include BEGIN / COMMIT in case the user sets autocommit to false, either in SET SESSION_STATES or SET @@autocommit

func IsSensitiveSQL

func IsSensitiveSQL(sql string) bool

func IsStartTxn

func IsStartTxn(sql string) bool

Types

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(sql string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() string

It only returns uppercased identifiers and keywords. It's used to search for some specified keywords. It doesn't need to strict but it needs to be fast enough.

Jump to

Keyboard shortcuts

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