BenchmarkScanner_CleanSQL benchmarks scanning clean SQL
(b *testing.B)
| 42 | |
| 43 | // BenchmarkScanner_CleanSQL benchmarks scanning clean SQL |
| 44 | func BenchmarkScanner_CleanSQL(b *testing.B) { |
| 45 | sql := "SELECT id, name, email FROM users WHERE active = true ORDER BY created_at DESC" |
| 46 | scanner := NewScanner() |
| 47 | |
| 48 | tree := parseSQL(b, sql) |
| 49 | defer ast.ReleaseAST(tree) |
| 50 | |
| 51 | b.ReportAllocs() |
| 52 | b.ResetTimer() |
| 53 | for i := 0; i < b.N; i++ { |
| 54 | scanner.Scan(tree) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | // BenchmarkScanner_CleanSQL_Raw benchmarks scanning raw SQL string |
| 59 | func BenchmarkScanner_CleanSQL_Raw(b *testing.B) { |
nothing calls this directly
no test coverage detected