1#include "duckdb/parser/parsed_data/detach_info.hpp"
2#include "duckdb/common/field_writer.hpp"
3
4namespace duckdb {
5
6DetachInfo::DetachInfo() {
7}
8
9unique_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
16void 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
23unique_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