MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / InvalidSyntaxError

Function InvalidSyntaxError

pkg/errors/builders.go:170–176  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

168// - location: Line/column where the violation was detected
169// - sql: Full SQL source used to generate visual context
170func 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

Callers 7

NewWithKeywordsFunction · 0.92
readQuotedStringMethod · 0.92
handleEscapeSequenceMethod · 0.92
readPunctuationMethod · 0.92
ReadStringLiteralMethod · 0.92
TestInvalidSyntaxErrorFunction · 0.85
TestAllErrorsHaveContextFunction · 0.85

Calls 4

GenerateHintFunction · 0.85
WithHintMethod · 0.80
NewErrorFunction · 0.70
WithContextMethod · 0.45

Tested by 2

TestInvalidSyntaxErrorFunction · 0.68
TestAllErrorsHaveContextFunction · 0.68