| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <Parsers/ASTConstraintDeclaration.h> |
| 4 | #include <Interpreters/ExpressionAnalyzer.h> |
| 5 | |
| 6 | namespace DB |
| 7 | { |
| 8 | |
| 9 | using ConstraintsASTs = std::vector<std::shared_ptr<ASTConstraintDeclaration>>; |
| 10 | using ConstraintsExpressions = std::vector<ExpressionActionsPtr>; |
| 11 | |
| 12 | struct 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 |