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

Function dmlFromSource

backend/plugin/parser/tsql/backup.go:320–331  ·  view source on GitHub ↗
(source string, relation ast.TableExpr, fromClause *ast.List, stmtLoc ast.Loc, where ast.ExprNode, option *ast.List)

Source from the content-addressed store, hash-verified

318}
319
320func dmlFromSource(source string, relation ast.TableExpr, fromClause *ast.List, stmtLoc ast.Loc, where ast.ExprNode, option *ast.List) (string, int) {
321 if fromClause != nil && len(fromClause.Items) > 0 {
322 loc := listLoc(fromClause)
323 end := dmlTailStart(source, loc.End, stmtLoc, where, option)
324 if end < 0 {
325 end = trimDMLStatementEnd(source, stmtLoc.End)
326 }
327 return strings.TrimSpace(source[loc.Start:end]), end
328 }
329 loc := dmlNodeLoc(relation)
330 return sourceFromLoc(source, loc), loc.End
331}
332
333func buildDMLFromClause(source, fromSource string, searchStart int, stmtLoc ast.Loc, where ast.ExprNode, option *ast.List) string {
334 if fromSource == "" {

Callers 1

Calls 5

listLocFunction · 0.85
dmlTailStartFunction · 0.85
trimDMLStatementEndFunction · 0.85
dmlNodeLocFunction · 0.85
sourceFromLocFunction · 0.85

Tested by

no test coverage detected