mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-10-16 04:10:49 +08:00
refactor: update go mod library (#210)
refactor: update go mod library and refactor dev logic Co-authored-by: wencaiwulue <895703375@qq.com>
This commit is contained in:
5
vendor/github.com/DataDog/go-sqllexer/sqllexer.go
generated
vendored
5
vendor/github.com/DataDog/go-sqllexer/sqllexer.go
generated
vendored
@@ -153,6 +153,9 @@ func (s *Lexer) Scan() Token {
|
||||
fallthrough
|
||||
case ch == '@':
|
||||
if isAlphaNumeric(s.lookAhead(1)) {
|
||||
if s.config.DBMS == DBMSSnowflake {
|
||||
return s.scanIdentifier(ch)
|
||||
}
|
||||
return s.scanBindParameter()
|
||||
} else if s.lookAhead(1) == '@' {
|
||||
return s.scanSystemVariable()
|
||||
@@ -314,7 +317,7 @@ func (s *Lexer) scanIdentifier(ch rune) Token {
|
||||
// NOTE: this func does not distinguish between SQL keywords and identifiers
|
||||
s.start = s.cursor
|
||||
ch = s.nextBy(utf8.RuneLen(ch))
|
||||
for isLetter(ch) || isDigit(ch) || ch == '.' || ch == '?' || ch == '$' || ch == '#' {
|
||||
for isLetter(ch) || isDigit(ch) || ch == '.' || ch == '?' || ch == '$' || ch == '#' || ch == '/' {
|
||||
ch = s.nextBy(utf8.RuneLen(ch))
|
||||
}
|
||||
if ch == '(' {
|
||||
|
7
vendor/github.com/DataDog/go-sqllexer/sqllexer_utils.go
generated
vendored
7
vendor/github.com/DataDog/go-sqllexer/sqllexer_utils.go
generated
vendored
@@ -8,7 +8,7 @@ import (
|
||||
type DBMSType string
|
||||
|
||||
const (
|
||||
// DBMSSQLServer is a MS SQL Server
|
||||
// DBMSSQLServer is a MS SQL
|
||||
DBMSSQLServer DBMSType = "mssql"
|
||||
// DBMSPostgres is a PostgreSQL Server
|
||||
DBMSPostgres DBMSType = "postgresql"
|
||||
@@ -16,6 +16,8 @@ const (
|
||||
DBMSMySQL DBMSType = "mysql"
|
||||
// DBMSOracle is a Oracle Server
|
||||
DBMSOracle DBMSType = "oracle"
|
||||
// DBMSSnowflake is a Snowflake Server
|
||||
DBMSSnowflake DBMSType = "snowflake"
|
||||
)
|
||||
|
||||
var commands = map[string]bool{
|
||||
@@ -37,6 +39,8 @@ var commands = map[string]bool{
|
||||
"EXEC": true,
|
||||
"EXPLAIN": true,
|
||||
"STRAIGHT_JOIN": true,
|
||||
"USE": true,
|
||||
"CLONE": true,
|
||||
}
|
||||
|
||||
var tableIndicators = map[string]bool{
|
||||
@@ -46,6 +50,7 @@ var tableIndicators = map[string]bool{
|
||||
"UPDATE": true,
|
||||
"TABLE": true,
|
||||
"STRAIGHT_JOIN": true, // MySQL
|
||||
"CLONE": true, // Snowflake
|
||||
}
|
||||
|
||||
var keywords = map[string]bool{
|
||||
|
Reference in New Issue
Block a user