MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / helpWith

Function helpWith

pkg/sql/parser/help.go:75–87  ·  view source on GitHub ↗

helpWith is to be used in parser actions to mark the parser "in error", with the error set to a contextual help message about the current statement.

(sqllex sqlLexer, helpText string)

Source from the content-addressed store, hash-verified

73// error", with the error set to a contextual help message about the
74// current statement.
75func helpWith(sqllex sqlLexer, helpText string) int {
76 scan := sqllex.(*lexer)
77 if helpText == "" {
78 scan.lastError = pgerror.WithCandidateCode(errors.New("help upon syntax error"), pgcode.Syntax)
79 scan.populateHelpMsg("help:\n" + AllHelp)
80 return 1
81 }
82 msg := HelpMessage{Command: helpText, HelpMessageBody: HelpMessages[helpText]}
83 scan.SetHelp(msg)
84 // We return non-zero to indicate to the caller of Parse() that the
85 // parse was unsuccessful.
86 return 1
87}
88
89// helpWithFunction is to be used in parser actions to mark the parser
90// "in error", with the error set to a contextual help message about

Callers 1

ParseMethod · 0.85

Calls 3

WithCandidateCodeFunction · 0.92
populateHelpMsgMethod · 0.80
SetHelpMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…