aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Parsers/ParserCreateIndexQuery.h
blob: 701586d6e113bfeec6425dc24b99919207fe13ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <Parsers/IParserBase.h>

namespace DB
{

/** Query like this:
  * CREATE [UNIQUE] INDEX [IF NOT EXISTS] name ON [db].name (expression) TYPE type GRANULARITY value
  */

class ParserCreateIndexQuery : public IParserBase
{
protected:
    const char * getName() const override { return "CREATE INDEX query"; }
    bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
};


/** Parser for index declaration in create index, where name is ignored. */
class ParserCreateIndexDeclaration : public IParserBase
{
public:
    ParserCreateIndexDeclaration() = default;

protected:
    const char * getName() const override { return "index declaration in create index"; }
    bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
};

}