MCPcopy Create free account
hub / github.com/dolthub/doltgresql / customDefinition

Function customDefinition

testing/generation/command_docs/custom_variables.go:130–145  ·  view source on GitHub ↗

customDefinition returns a StatementGenerator for a custom variable definition. The variable definition should follow the same layout format as synopses.

(str string)

Source from the content-addressed store, hash-verified

128// customDefinition returns a StatementGenerator for a custom variable definition. The variable definition should follow
129// the same layout format as synopses.
130func customDefinition(str string) utils.StatementGenerator {
131 str = strings.TrimSpace(str)
132 scanner := NewScanner(str)
133 tokens, err := scanner.Process()
134 if err != nil {
135 panic(err)
136 }
137 stmtGen, err := utils.ParseTokens(tokens, true)
138 if err != nil {
139 panic(err)
140 }
141 if stmtGen == nil {
142 panic("definition did not create a statement generator")
143 }
144 return stmtGen
145}

Callers 1

Calls 3

ProcessMethod · 0.95
ParseTokensFunction · 0.92
NewScannerFunction · 0.85

Tested by

no test coverage detected