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

Method parseSnowflakeTimeTravel

pkg/sql/parser/pivot.go:286–300  ·  view source on GitHub ↗

parseSnowflakeTimeTravel parses the Snowflake time-travel / change-tracking modifier attached to a table reference. The current token must be one of AT / BEFORE / CHANGES. Returns the head clause with any additional clauses appended to Chained (e.g. CHANGES (...) AT (...)).

()

Source from the content-addressed store, hash-verified

284// AT / BEFORE / CHANGES. Returns the head clause with any additional clauses
285// appended to Chained (e.g. CHANGES (...) AT (...)).
286func (p *Parser) parseSnowflakeTimeTravel() (*ast.TimeTravelClause, error) {
287 head, err := p.parseOneTimeTravelClause()
288 if err != nil {
289 return nil, err
290 }
291 // Allow additional clauses: CHANGES (...) AT (...) is legal.
292 for p.isSnowflakeTimeTravelStart() {
293 next, err := p.parseOneTimeTravelClause()
294 if err != nil {
295 return nil, err
296 }
297 head.Chained = append(head.Chained, next)
298 }
299 return head, nil
300}
301
302func (p *Parser) parseOneTimeTravelClause() (*ast.TimeTravelClause, error) {
303 pos := p.currentLocation()

Callers 1

Calls 2

Tested by

no test coverage detected