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

Function trimDMLStatementEnd

backend/plugin/parser/tsql/backup.go:365–378  ·  view source on GitHub ↗
(source string, end int)

Source from the content-addressed store, hash-verified

363}
364
365func trimDMLStatementEnd(source string, end int) int {
366 if end > len(source) {
367 end = len(source)
368 }
369 for end > 0 {
370 switch source[end-1] {
371 case ';', ' ', '\t', '\r', '\n':
372 end--
373 default:
374 return end
375 }
376 }
377 return end
378}
379
380func findKeywordBefore(source, keyword string, before int, after int) int {
381 if before > len(source) {

Callers 2

dmlFromSourceFunction · 0.85
dmlTrailingClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected