extractNodeText extracts trimmed text from SQL using a Loc range.
(loc ast.Loc, sql string)
| 266 | |
| 267 | // extractNodeText extracts trimmed text from SQL using a Loc range. |
| 268 | func extractNodeText(loc ast.Loc, sql string) string { |
| 269 | if loc.Start < 0 || loc.End < 0 || loc.Start >= loc.End || loc.End > len(sql) { |
| 270 | return "" |
| 271 | } |
| 272 | return strings.TrimSpace(sql[loc.Start:loc.End]) |
| 273 | } |
| 274 | |
| 275 | func prepareTransformation(ctx context.Context, tCtx base.TransformContext, statement string) ([]statementInfo, error) { |
| 276 | stmts, err := ParsePg(statement) |
no outgoing calls
no test coverage detected