MCPcopy Create free account
hub / github.com/AfterShip/clickhouse-sql-parser / parseAlterTableDrop

Method parseAlterTableDrop

parser/parser_alter.go:312–325  ·  view source on GitHub ↗
(pos Pos)

Source from the content-addressed store, hash-verified

310}
311
312func (p *Parser) parseAlterTableDrop(pos Pos) (AlterTableClause, error) {
313 if err := p.expectKeyword(KeywordDrop); err != nil {
314 return nil, err
315 }
316
317 switch {
318 case p.matchKeyword(KeywordColumn), p.matchKeyword(KeywordIndex), p.matchKeyword(KeywordProjection):
319 return p.parseAlterTableDropClause(pos)
320 case p.matchKeyword(KeywordDetached), p.matchKeyword(KeywordPartition):
321 return p.parseAlterTableDropPartition(pos)
322 default:
323 return nil, errors.New("expected keyword: COLUMN|INDEX|PROJECTION|DETACHED|PARTITION")
324 }
325}
326
327// Syntax: ALTER TABLE DETACH partitionClause
328func (p *Parser) parseAlterTableDetachPartition(pos Pos) (AlterTableClause, error) {

Callers 1

parseAlterTableMethod · 0.95

Calls 4

expectKeywordMethod · 0.95
matchKeywordMethod · 0.95

Tested by

no test coverage detected