MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / getColumnName

Method getColumnName

parser/parser.go:334–343  ·  view source on GitHub ↗
(err error, selectCommand *ast.SelectCommand, aggregateFunction token.Token)

Source from the content-addressed store, hash-verified

332}
333
334func (parser *Parser) getColumnName(err error, selectCommand *ast.SelectCommand, aggregateFunction token.Token) error {
335 // Get column name
336 err = validateToken(parser.currentToken.Type, []token.Type{token.IDENT, token.ASTERISK})
337 if err != nil {
338 return err
339 }
340 selectCommand.Space = append(selectCommand.Space, ast.Space{ColumnName: parser.currentToken, AggregateFunc: &aggregateFunction})
341 parser.nextToken()
342 return nil
343}
344
345func isAggregateFunction(t token.Type) bool {
346 return t == token.MIN || t == token.MAX || t == token.COUNT || t == token.SUM || t == token.AVG

Callers

nothing calls this directly

Calls 2

nextTokenMethod · 0.95
validateTokenFunction · 0.85

Tested by

no test coverage detected