2014-09-29 14:58:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
2016-12-12 07:24:56 +00:00
|
|
|
#include <string>
|
2014-09-29 14:58:48 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2015-04-11 03:10:23 +00:00
|
|
|
|
2014-09-29 14:58:48 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2015-04-11 03:10:23 +00:00
|
|
|
|
2018-03-12 13:47:01 +00:00
|
|
|
enum class ColumnDefaultKind
|
2015-04-11 03:10:23 +00:00
|
|
|
{
|
|
|
|
Default,
|
|
|
|
Materialized,
|
2022-02-07 23:21:10 +00:00
|
|
|
Alias,
|
|
|
|
Ephemeral
|
2015-04-11 03:10:23 +00:00
|
|
|
};
|
|
|
|
|
2014-09-29 14:58:48 +00:00
|
|
|
|
2018-03-12 13:47:01 +00:00
|
|
|
ColumnDefaultKind columnDefaultKindFromString(const std::string & str);
|
2021-04-10 23:33:54 +00:00
|
|
|
std::string toString(ColumnDefaultKind kind);
|
2014-10-21 12:11:20 +00:00
|
|
|
|
2014-11-10 16:16:43 +00:00
|
|
|
|
2015-04-11 03:10:23 +00:00
|
|
|
struct ColumnDefault
|
|
|
|
{
|
2019-03-14 15:20:51 +00:00
|
|
|
ColumnDefaultKind kind = ColumnDefaultKind::Default;
|
2015-04-11 03:10:23 +00:00
|
|
|
ASTPtr expression;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-12-12 07:24:56 +00:00
|
|
|
bool operator==(const ColumnDefault & lhs, const ColumnDefault & rhs);
|
2015-04-11 03:10:23 +00:00
|
|
|
|
|
|
|
|
2016-12-12 07:24:56 +00:00
|
|
|
using ColumnDefaults = std::unordered_map<std::string, ColumnDefault>;
|
2014-10-21 12:11:20 +00:00
|
|
|
|
2014-09-29 14:58:48 +00:00
|
|
|
}
|