(fullSQL string, loc ast.Loc)
| 321 | } |
| 322 | |
| 323 | func extractStatementText(fullSQL string, loc ast.Loc) string { |
| 324 | end := loc.End |
| 325 | if end <= 0 || end > len(fullSQL) { |
| 326 | end = len(fullSQL) |
| 327 | } |
| 328 | start := 0 |
| 329 | if loc.Start > 0 { |
| 330 | start = loc.Start |
| 331 | } |
| 332 | return strings.TrimSpace(fullSQL[start:end]) |
| 333 | } |
| 334 | |
| 335 | // writeSuffixSelectClause writes the FROM ... WHERE ... suffix of a DML statement. |
| 336 | func writeSuffixSelectClause(buf *strings.Builder, node ast.Node, fullSQL string) error { |
no outgoing calls
no test coverage detected