MCPcopy Create free account
hub / github.com/bytebase/bytebase / keywordMatchAt

Function keywordMatchAt

backend/plugin/parser/tsql/backup.go:456–467  ·  view source on GitHub ↗
(source, keyword string, offset, start, end int)

Source from the content-addressed store, hash-verified

454}
455
456func keywordMatchAt(source, keyword string, offset, start, end int) bool {
457 if offset+len(keyword) > end || !strings.EqualFold(source[offset:offset+len(keyword)], keyword) {
458 return false
459 }
460 if offset > start && isSQLIdentifierChar(source[offset-1]) {
461 return false
462 }
463 if offset+len(keyword) < end && isSQLIdentifierChar(source[offset+len(keyword)]) {
464 return false
465 }
466 return true
467}
468
469func isSQLIdentifierChar(ch byte) bool {
470 return ch == '_' || ch == '@' || ch == '#' || ch == '$' ||

Callers 1

findKeywordOutsideSQLFunction · 0.85

Calls 1

isSQLIdentifierCharFunction · 0.85

Tested by

no test coverage detected