1 | #include "duckdb/parser/parsed_data/detach_info.hpp" |
---|---|
2 | #include "duckdb/common/field_writer.hpp" |
3 | |
4 | namespace duckdb { |
5 | |
6 | DetachInfo::DetachInfo() { |
7 | } |
8 | |
9 | unique_ptr<DetachInfo> DetachInfo::Copy() const { |
10 | auto result = make_uniq<DetachInfo>(); |
11 | result->name = name; |
12 | result->if_not_found = if_not_found; |
13 | return result; |
14 | } |
15 | |
16 | void DetachInfo::Serialize(Serializer &serializer) const { |
17 | FieldWriter writer(serializer); |
18 | writer.WriteString(val: name); |
19 | writer.WriteField(element: if_not_found); |
20 | writer.Finalize(); |
21 | } |
22 | |
23 | unique_ptr<ParseInfo> DetachInfo::Deserialize(Deserializer &deserializer) { |
24 | auto result = make_uniq<DetachInfo>(); |
25 | |
26 | FieldReader reader(deserializer); |
27 | result->name = reader.ReadRequired<string>(); |
28 | result->if_not_found = reader.ReadRequired<OnEntryNotFound>(); |
29 | reader.Finalize(); |
30 | |
31 | return std::move(result); |
32 | } |
33 | |
34 | } // namespace duckdb |
35 |