1#include "duckdb/parser/parsed_data/alter_table_function_info.hpp"
2
3#include "duckdb/common/field_writer.hpp"
4#include "duckdb/parser/constraint.hpp"
5
6namespace duckdb {
7
8//===--------------------------------------------------------------------===//
9// AlterTableFunctionInfo
10//===--------------------------------------------------------------------===//
11AlterTableFunctionInfo::AlterTableFunctionInfo(AlterTableFunctionType type, AlterEntryData data)
12 : AlterInfo(AlterType::ALTER_TABLE_FUNCTION, std::move(data.catalog), std::move(data.schema), std::move(data.name),
13 data.if_not_found),
14 alter_table_function_type(type) {
15}
16AlterTableFunctionInfo::~AlterTableFunctionInfo() {
17}
18
19CatalogType AlterTableFunctionInfo::GetCatalogType() const {
20 return CatalogType::TABLE_FUNCTION_ENTRY;
21}
22
23void AlterTableFunctionInfo::Serialize(FieldWriter &writer) const {
24 writer.WriteField<AlterTableFunctionType>(element: alter_table_function_type);
25 writer.WriteString(val: catalog);
26 writer.WriteString(val: schema);
27 writer.WriteString(val: name);
28 writer.WriteField(element: if_not_found);
29}
30
31unique_ptr<AlterInfo> AlterTableFunctionInfo::Deserialize(FieldReader &reader) {
32 throw NotImplementedException("AlterTableFunctionInfo cannot be deserialized");
33}
34
35//===--------------------------------------------------------------------===//
36// AddTableFunctionOverloadInfo
37//===--------------------------------------------------------------------===//
38AddTableFunctionOverloadInfo::AddTableFunctionOverloadInfo(AlterEntryData data, TableFunctionSet new_overloads_p)
39 : AlterTableFunctionInfo(AlterTableFunctionType::ADD_FUNCTION_OVERLOADS, std::move(data)),
40 new_overloads(std::move(new_overloads_p)) {
41 this->allow_internal = true;
42}
43
44AddTableFunctionOverloadInfo::~AddTableFunctionOverloadInfo() {
45}
46
47unique_ptr<AlterInfo> AddTableFunctionOverloadInfo::Copy() const {
48 return make_uniq_base<AlterInfo, AddTableFunctionOverloadInfo>(args: GetAlterEntryData(), args: new_overloads);
49}
50
51} // namespace duckdb
52