1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/parser/constraints/not_null_constraint.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/parser/constraint.hpp"
12
13namespace duckdb {
14
15class NotNullConstraint : public Constraint {
16public:
17 static constexpr const ConstraintType TYPE = ConstraintType::NOT_NULL;
18
19public:
20 DUCKDB_API explicit NotNullConstraint(LogicalIndex index);
21 DUCKDB_API ~NotNullConstraint() override;
22
23 //! Column index this constraint pertains to
24 LogicalIndex index;
25
26public:
27 DUCKDB_API string ToString() const override;
28
29 DUCKDB_API unique_ptr<Constraint> Copy() const override;
30
31 //! Serialize to a stand-alone binary blob
32 DUCKDB_API void Serialize(FieldWriter &writer) const override;
33 //! Deserializes a NotNullConstraint
34 DUCKDB_API static unique_ptr<Constraint> Deserialize(FieldReader &source);
35};
36
37} // namespace duckdb
38