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