aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Storages/ColumnDefault.h
blob: af1be6f3bec87d5d578da04154db4f0e8417d966 (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
37
38
#pragma once

#include <Parsers/IAST.h>

#include <string>
#include <unordered_map>


namespace DB
{

enum class ColumnDefaultKind
{
    Default,
    Materialized,
    Alias,
    Ephemeral
};


ColumnDefaultKind columnDefaultKindFromString(const std::string & str);
std::string toString(ColumnDefaultKind kind);


struct ColumnDefault
{
    ColumnDefaultKind kind = ColumnDefaultKind::Default;
    ASTPtr expression;
    bool ephemeral_default = false;
};


bool operator==(const ColumnDefault & lhs, const ColumnDefault & rhs);


using ColumnDefaults = std::unordered_map<std::string, ColumnDefault>;

}