Parse `AS OF`, if present. In contrast to `parse_optional_as_of`, this parser only supports `AS OF ` syntax and directly returns an `u64`. It is only meant to be used for internal SQL syntax.
(&mut self)
| 8719 | /// In contrast to `parse_optional_as_of`, this parser only supports `AS OF <time>` syntax and |
| 8720 | /// directly returns an `u64`. It is only meant to be used for internal SQL syntax. |
| 8721 | fn parse_optional_internal_as_of(&mut self) -> Result<Option<u64>, ParserError> { |
| 8722 | fn try_parse_u64(parser: &mut Parser) -> Option<u64> { |
| 8723 | let value = parser.parse_value().ok()?; |
| 8724 | let Value::Number(s) = value else { return None }; |
| 8725 | s.parse().ok() |
| 8726 | } |
| 8727 | |
| 8728 | if self.parse_keywords(&[AS, OF]) { |
| 8729 | match try_parse_u64(self) { |
| 8730 | Some(time) => Ok(Some(time)), |
| 8731 | None => { |
| 8732 | self.prev_token(); |
| 8733 | self.expected(self.peek_pos(), "`u64` literal", self.peek_token()) |
| 8734 | } |
| 8735 | } |
| 8736 | } else { |
| 8737 | Ok(None) |
| 8738 | } |
| 8739 | } |
| 8740 | |
| 8741 | /// Parse a comma-delimited list of projections after SELECT |
| 8742 | fn parse_select_item(&mut self) -> Result<SelectItem<Raw>, ParserError> { |
no test coverage detected