1 | #include "duckdb/parser/constraints/check_constraint.hpp" |
---|---|
2 | |
3 | #include "duckdb/common/serializer.hpp" |
4 | |
5 | using namespace std; |
6 | using namespace duckdb; |
7 | |
8 | string CheckConstraint::ToString() const { |
9 | return "CHECK("+ expression->ToString() + ")"; |
10 | } |
11 | |
12 | unique_ptr<Constraint> CheckConstraint::Copy() { |
13 | return make_unique<CheckConstraint>(expression->Copy()); |
14 | } |
15 | |
16 | void CheckConstraint::Serialize(Serializer &serializer) { |
17 | Constraint::Serialize(serializer); |
18 | expression->Serialize(serializer); |
19 | } |
20 | |
21 | unique_ptr<Constraint> CheckConstraint::Deserialize(Deserializer &source) { |
22 | auto expression = ParsedExpression::Deserialize(source); |
23 | return make_unique<CheckConstraint>(move(expression)); |
24 | } |
25 |