MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / isSnowflakeTimeTravelStart

Method isSnowflakeTimeTravelStart

pkg/sql/parser/pivot.go:361–376  ·  view source on GitHub ↗

isSnowflakeTimeTravelStart returns true when the current token begins an AT / BEFORE / CHANGES time-travel clause in the Snowflake dialect.

()

Source from the content-addressed store, hash-verified

359// isSnowflakeTimeTravelStart returns true when the current token begins an
360// AT / BEFORE / CHANGES time-travel clause in the Snowflake dialect.
361func (p *Parser) isSnowflakeTimeTravelStart() bool {
362 if p.dialect != string(keywords.DialectSnowflake) {
363 return false
364 }
365 // BEFORE / CHANGES: plain identifier or keyword
366 val := strings.ToUpper(p.currentToken.Token.Value)
367 if val == "BEFORE" || val == "CHANGES" {
368 // Must be followed by '(' to disambiguate from other uses.
369 return p.peekToken().Token.Type == models.TokenTypeLParen
370 }
371 // AT: either TokenTypeAt (@) or an identifier-token "AT" followed by '('.
372 if val == "AT" && p.peekToken().Token.Type == models.TokenTypeLParen {
373 return true
374 }
375 return false
376}
377
378// isSampleKeyword returns true if the current token is SAMPLE or TABLESAMPLE
379// followed by '(' or a sampling-method keyword, indicating a sampling clause

Callers 3

parseJoinedTableRefMethod · 0.95

Calls 1

peekTokenMethod · 0.95

Tested by

no test coverage detected