MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_timestamp_precision

Method parse_timestamp_precision

src/sql-parser/src/parser.rs:7167–7175  ·  view source on GitHub ↗

parses the precision in timestamp( ) and timestamptz( )

(&mut self)

Source from the content-addressed store, hash-verified

7165
7166 // parses the precision in timestamp(<precision>) and timestamptz(<precision>)
7167 fn parse_timestamp_precision(&mut self) -> Result<Vec<i64>, ParserError> {
7168 if self.consume_token(&Token::LParen) {
7169 let typ_mod = self.parse_literal_int()?;
7170 self.expect_token(&Token::RParen)?;
7171 Ok(vec![typ_mod])
7172 } else {
7173 Ok(vec![])
7174 }
7175 }
7176
7177 /// Parse `AS identifier` (or simply `identifier` if it's not a reserved keyword)
7178 /// Some examples with aliases: `SELECT 1 foo`, `SELECT COUNT(*) AS cnt`,

Callers 1

parse_data_typeMethod · 0.80

Calls 3

consume_tokenMethod · 0.80
parse_literal_intMethod · 0.80
expect_tokenMethod · 0.80

Tested by

no test coverage detected