aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Parsers/ASTDictionaryAttributeDeclaration.h
blob: 52103650684afb8ecc562cea9825bced4eb3a04d (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
32
33
34
35
36
#pragma once

#include <Parsers/IAST.h>
#include <Parsers/ASTExpressionList.h>

namespace DB
{

/// AST for single dictionary attribute in dictionary DDL query
class ASTDictionaryAttributeDeclaration : public IAST
{
public:
    /// Attribute name
    String name;
    /// Attribute type
    ASTPtr type;
    /// Attribute default value
    ASTPtr default_value;
    /// Attribute expression
    ASTPtr expression;
    /// Is attribute mirrored to the parent identifier
    bool hierarchical = false;
    /// Is hierarchical attribute bidirectional
    bool bidirectional = false;
    /// Flag that shows whether the id->attribute image is injective
    bool injective = false;
    /// MongoDB object ID
    bool is_object_id = false;

    String getID(char delim) const override { return "DictionaryAttributeDeclaration" + (delim + name); }

    ASTPtr clone() const override;
    void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
};

}