1#include "duckdb/parser/parsed_data/transaction_info.hpp"
2#include "duckdb/common/field_writer.hpp"
3
4namespace duckdb {
5
6TransactionInfo::TransactionInfo(TransactionType type) : type(type) {
7}
8
9void TransactionInfo::Serialize(Serializer &serializer) const {
10 FieldWriter writer(serializer);
11 writer.WriteField(element: type);
12 writer.Finalize();
13}
14
15unique_ptr<ParseInfo> TransactionInfo::Deserialize(Deserializer &deserializer) {
16 FieldReader reader(deserializer);
17 auto transaction_type = reader.ReadRequired<TransactionType>();
18 reader.Finalize();
19
20 auto transaction_info = make_uniq<TransactionInfo>(args&: transaction_type);
21 return std::move(transaction_info);
22}
23
24} // namespace duckdb
25