parseNullsClause parses the optional NULLS FIRST/LAST clause in ORDER BY expressions. Returns a pointer to bool indicating null ordering: true for NULLS FIRST, false for NULLS LAST, nil if not specified.
()
| 556 | // parseNullsClause parses the optional NULLS FIRST/LAST clause in ORDER BY expressions. |
| 557 | // Returns a pointer to bool indicating null ordering: true for NULLS FIRST, false for NULLS LAST, nil if not specified. |
| 558 | func (p *Parser) parseNullsClause() (*bool, error) { |
| 559 | if p.isType(models.TokenTypeNulls) { |
| 560 | p.advance() // Consume NULLS |
| 561 | if p.isType(models.TokenTypeFirst) { |
| 562 | t := true |
| 563 | p.advance() // Consume FIRST |
| 564 | return &t, nil |
| 565 | } else if p.isType(models.TokenTypeLast) { |
| 566 | f := false |
| 567 | p.advance() // Consume LAST |
| 568 | return &f, nil |
| 569 | } else { |
| 570 | return nil, p.expectedError("FIRST or LAST after NULLS") |
| 571 | } |
| 572 | } |
| 573 | return nil, nil |
| 574 | } |
| 575 | |
| 576 | // parseGroupingExpressionList parses a parenthesized, comma-separated list of expressions |
no test coverage detected