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

Method AddChildren

testing/generation/utils/statement_generator.go:290–303  ·  view source on GitHub ↗

AddChildren implements the interface StatementGenerator.

(children ...StatementGenerator)

Source from the content-addressed store, hash-verified

288
289// AddChildren implements the interface StatementGenerator.
290func (v *VariableGen) AddChildren(children ...StatementGenerator) error {
291 children = removeNilGenerators(children)
292 if len(children) == 0 {
293 return nil
294 }
295 if len(children) > 1 {
296 return fmt.Errorf("attempting to give variable `%s` too many children", v.name)
297 }
298 if v.options != nil {
299 return fmt.Errorf("variable `%s` has already been assigned", v.name)
300 }
301 v.options = children[0].Copy()
302 return nil
303}
304
305// Consume implements the interface StatementGenerator.
306func (v *VariableGen) Consume() bool {

Callers

nothing calls this directly

Calls 3

removeNilGeneratorsFunction · 0.85
ErrorfMethod · 0.65
CopyMethod · 0.65

Tested by

no test coverage detected