ClickHouse/dbms/src/Storages/ConstraintsDescription.h

27 lines
646 B
C++
Raw Normal View History

#pragma once
#include <Parsers/ASTConstraintDeclaration.h>
2019-05-19 05:27:00 +00:00
#include <Interpreters/ExpressionAnalyzer.h>
namespace DB
{
using ConstraintsASTs = std::vector<std::shared_ptr<ASTConstraintDeclaration>>;
2019-05-19 05:27:00 +00:00
using ConstraintsExpressions = std::vector<ExpressionActionsPtr>;
struct ConstraintsDescription
{
ConstraintsASTs constraints;
ConstraintsDescription() = default;
bool empty() const { return constraints.empty(); }
String toString() const;
static ConstraintsDescription parse(const String & str);
2019-05-19 05:27:00 +00:00
2019-05-25 14:07:45 +00:00
ConstraintsExpressions getExpressions(const Context & context, const NamesAndTypesList & source_columns_) const;
};
}