extractSQLStatement extracts the main SQL statement from a file (ignoring comments)
(content string)
| 99 | |
| 100 | // extractSQLStatement extracts the main SQL statement from a file (ignoring comments) |
| 101 | func extractSQLStatement(content string) string { |
| 102 | lines := strings.Split(content, "\n") |
| 103 | var sqlLines []string |
| 104 | |
| 105 | for _, line := range lines { |
| 106 | trimmed := strings.TrimSpace(line) |
| 107 | // Skip empty lines and comment-only lines |
| 108 | if trimmed == "" || strings.HasPrefix(trimmed, "--") { |
| 109 | continue |
| 110 | } |
| 111 | sqlLines = append(sqlLines, line) |
| 112 | } |
| 113 | |
| 114 | return strings.Join(sqlLines, "\n") |
| 115 | } |
| 116 | |
| 117 | // TestIntegration_AllDialects tests all SQL files across all dialects |
| 118 | func TestIntegration_AllDialects(t *testing.T) { |
no outgoing calls
no test coverage detected