| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/planner/constraints/bound_check_constraint.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/common/unordered_set.hpp" |
| 12 | #include "duckdb/planner/bound_constraint.hpp" |
| 13 | #include "duckdb/planner/expression.hpp" |
| 14 | #include "duckdb/common/index_map.hpp" |
| 15 | |
| 16 | namespace duckdb { |
| 17 | |
| 18 | //! The CheckConstraint contains an expression that must evaluate to TRUE for |
| 19 | //! every row in a table |
| 20 | class BoundCheckConstraint : public BoundConstraint { |
| 21 | public: |
| 22 | static constexpr const ConstraintType TYPE = ConstraintType::CHECK; |
| 23 | |
| 24 | public: |
| 25 | BoundCheckConstraint() : BoundConstraint(ConstraintType::CHECK) { |
| 26 | } |
| 27 | |
| 28 | //! The expression |
| 29 | unique_ptr<Expression> expression; |
| 30 | //! The columns used by the CHECK constraint |
| 31 | physical_index_set_t bound_columns; |
| 32 | }; |
| 33 | |
| 34 | } // namespace duckdb |
| 35 |