1#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
2#include "duckdb/parser/parsed_data/alter_table_function_info.hpp"
3
4namespace duckdb {
5
6CreateTableFunctionInfo::CreateTableFunctionInfo(TableFunction function)
7 : CreateFunctionInfo(CatalogType::TABLE_FUNCTION_ENTRY), functions(function.name) {
8 name = function.name;
9 functions.AddFunction(function: std::move(function));
10 internal = true;
11}
12CreateTableFunctionInfo::CreateTableFunctionInfo(TableFunctionSet set)
13 : CreateFunctionInfo(CatalogType::TABLE_FUNCTION_ENTRY), functions(std::move(set)) {
14 name = functions.name;
15 for (auto &func : functions.functions) {
16 func.name = functions.name;
17 }
18 internal = true;
19}
20
21unique_ptr<CreateInfo> CreateTableFunctionInfo::Copy() const {
22 TableFunctionSet set(name);
23 set.functions = functions.functions;
24 auto result = make_uniq<CreateTableFunctionInfo>(args: std::move(set));
25 CopyProperties(other&: *result);
26 return std::move(result);
27}
28
29unique_ptr<AlterInfo> CreateTableFunctionInfo::GetAlterInfo() const {
30 return make_uniq_base<AlterInfo, AddTableFunctionOverloadInfo>(
31 args: AlterEntryData(catalog, schema, name, OnEntryNotFound::RETURN_NULL), args: functions);
32}
33
34} // namespace duckdb
35