#pragma once #include #include #include #include namespace DB { using ConstraintsExpressions = std::vector; struct ConstraintsDescription { std::vector constraints; std::vector cnf_constraints; ConstraintsDescription() = default; bool empty() const { return constraints.empty(); } String toString() const; static ConstraintsDescription parse(const String & str); enum class ConstraintType { CHECK = 1, ASSUME = 2, ALWAYS_TRUE = CHECK | ASSUME, ALL = CHECK | ASSUME, }; ASTs filterConstraints(ConstraintType selection) const; // TODO: перенести преобразование в КНФ + get constraitns //ASTs filterAtomicConstraints(ConstraintType selection) const; std::vector> getConstraintData() const; std::vector getAtomicConstraintData() const; ComparisonGraph getGraph() const; ConstraintsExpressions getExpressionsToCheck(const Context & context, const NamesAndTypesList & source_columns_) const; ConstraintsDescription(const ConstraintsDescription & other); ConstraintsDescription & operator=(const ConstraintsDescription & other); }; }