InvalidSyntaxError creates an E2004 general syntax error for violations that do not match any more specific error code. Use more specific builder functions (e.g., ExpectedTokenError, MissingClauseError) when possible for better diagnostics. Parameters: - description: Free-form description of the sy
(description string, location models.Location, sql string)
| 168 | // - location: Line/column where the violation was detected |
| 169 | // - sql: Full SQL source used to generate visual context |
| 170 | func InvalidSyntaxError(description string, location models.Location, sql string) *Error { |
| 171 | return NewError( |
| 172 | ErrCodeInvalidSyntax, |
| 173 | fmt.Sprintf("invalid syntax: %s", description), |
| 174 | location, |
| 175 | ).WithContext(sql, 1).WithHint(GenerateHint(ErrCodeInvalidSyntax, "", "")) |
| 176 | } |
| 177 | |
| 178 | // UnsupportedFeatureError creates an E4001 error when the parser encounters a valid |
| 179 | // SQL construct that is recognised but not yet implemented. This distinguishes |