1#pragma once
2
3#include <Parsers/ASTConstraintDeclaration.h>
4#include <Interpreters/ExpressionAnalyzer.h>
5
6namespace DB
7{
8
9using ConstraintsASTs = std::vector<std::shared_ptr<ASTConstraintDeclaration>>;
10using ConstraintsExpressions = std::vector<ExpressionActionsPtr>;
11
12struct ConstraintsDescription
13{
14 ConstraintsASTs constraints;
15
16 ConstraintsDescription() = default;
17
18 bool empty() const { return constraints.empty(); }
19 String toString() const;
20
21 static ConstraintsDescription parse(const String & str);
22
23 ConstraintsExpressions getExpressions(const Context & context, const NamesAndTypesList & source_columns_) const;
24};
25
26}
27