Versions in this module Expand all Collapse all v1 v1.5.0 Nov 15, 2025 Changes in this version + var CommonHints = map[string]string + func AnalyzeTokenError(tokenType, tokenValue, expectedType string) string + func ExtractLocation(err error) (models.Location, bool) + func FormatContextWindow(sql string, location models.Location, highlightLen int, ...) string + func FormatErrorList(errors []*Error) string + func FormatErrorSummary(err error) string + func FormatErrorWithContext(err error, sql string) string + func FormatErrorWithContextAt(code ErrorCode, message string, location models.Location, sql string, ...) string + func FormatErrorWithExample(code ErrorCode, message string, location models.Location, sql string, ...) string + func FormatErrorWithSuggestion(code ErrorCode, message string, location models.Location, sql string, ...) string + func FormatMistakeExample(mistake MistakePattern) string + func FormatMultiLineContext(sql string, location models.Location, highlightLen int) string + func GenerateDidYouMean(actual string, possibleValues []string) string + func GenerateHint(code ErrorCode, expected, found string) string + func GetAdvancedFeatureHint(feature string) string + func GetCommonHint(key string) string + func IsCode(err error, code ErrorCode) bool + func IsStructuredError(err error) bool + func SuggestForCTE(context string) string + func SuggestForIncompleteStatement(lastKeyword string) string + func SuggestForJoinError(joinType, context string) string + func SuggestForSetOperation(operation, context string) string + func SuggestForSyntaxError(context, expectedToken string) string + func SuggestForWindowFunction(context, functionName string) string + func SuggestFromPattern(errorMessage string) string + func SuggestKeyword(input string) string + type Error struct + Cause error + Code ErrorCode + Context *ErrorContext + HelpURL string + Hint string + Location models.Location + Message string + func ExpectedTokenError(expected, got string, location models.Location, sql string) *Error + func IncompleteStatementError(location models.Location, sql string) *Error + func InputTooLargeError(size, maxSize int64, location models.Location) *Error + func InvalidCTEError(description string, location models.Location, sql string) *Error + func InvalidNumberError(value string, location models.Location, sql string) *Error + func InvalidSetOperationError(operation, description string, location models.Location, sql string) *Error + func InvalidSyntaxError(description string, location models.Location, sql string) *Error + func MissingClauseError(clause string, location models.Location, sql string) *Error + func NewError(code ErrorCode, message string, location models.Location) *Error + func RecursionDepthLimitError(depth, maxDepth int, location models.Location, sql string) *Error + func TokenLimitReachedError(count, maxTokens int, location models.Location, sql string) *Error + func TokenizerPanicError(panicValue interface{}, location models.Location) *Error + func UnexpectedCharError(char rune, location models.Location, sql string) *Error + func UnexpectedTokenError(tokenType, tokenValue string, location models.Location, sql string) *Error + func UnsupportedConstraintError(constraint string, location models.Location, sql string) *Error + func UnsupportedDataTypeError(dataType string, location models.Location, sql string) *Error + func UnsupportedFeatureError(feature string, location models.Location, sql string) *Error + func UnsupportedJoinError(joinType string, location models.Location, sql string) *Error + func UnterminatedStringError(location models.Location, sql string) *Error + func WrapError(code ErrorCode, message string, location models.Location, sql string, ...) *Error + func (e *Error) Error() string + func (e *Error) Unwrap() error + func (e *Error) WithCause(cause error) *Error + func (e *Error) WithContext(sql string, highlightLen int) *Error + func (e *Error) WithHint(hint string) *Error + type ErrorCode string + const ErrCodeAmbiguousColumn + const ErrCodeExpectedToken + const ErrCodeIncompleteStatement + const ErrCodeInputTooLarge + const ErrCodeInvalidCTE + const ErrCodeInvalidExpression + const ErrCodeInvalidIdentifier + const ErrCodeInvalidNumber + const ErrCodeInvalidOperator + const ErrCodeInvalidSetOperation + const ErrCodeInvalidSyntax + const ErrCodeMissingClause + const ErrCodeRecursionDepthLimit + const ErrCodeTokenLimitReached + const ErrCodeTokenizerPanic + const ErrCodeTypeMismatch + const ErrCodeUndefinedColumn + const ErrCodeUndefinedTable + const ErrCodeUnexpectedChar + const ErrCodeUnexpectedToken + const ErrCodeUnsupportedConstraint + const ErrCodeUnsupportedDataType + const ErrCodeUnsupportedDialect + const ErrCodeUnsupportedFeature + const ErrCodeUnsupportedJoin + const ErrCodeUnterminatedString + func ExtractErrorCode(err error) (ErrorCode, bool) + func GetCode(err error) ErrorCode + type ErrorContext struct + EndLine int + HighlightCol int + HighlightLen int + SQL string + StartLine int + type ErrorPattern struct + Description string + Pattern *regexp.Regexp + Suggestion string + type MistakePattern struct + Correct string + Example string + Explanation string + Name string + func GetMistakeExplanation(mistakeName string) (MistakePattern, bool)