|
|
vector< unique_ptr< MacroFunction > > | macros |
|
string | name |
| | Function name.
|
|
string | alias_of |
| | The function name of which this function is an alias.
|
|
vector< FunctionDescription > | descriptions |
| | Function description.
|
|
CatalogType | type |
| | The to-be-created catalog type.
|
|
string | catalog |
| | The catalog name of the entry.
|
|
string | schema |
| | The schema name of the entry.
|
|
OnCreateConflict | on_conflict |
| | What to do on create conflict.
|
|
bool | temporary |
| | Whether or not the entry is temporary.
|
|
bool | internal |
| | Whether or not the entry is an internal entry.
|
|
string | sql |
| | The SQL string of the CREATE statement.
|
|
LogicalDependencyList | dependencies |
| | The inherent dependencies of the created entry.
|
|
Value | comment |
| | User provided comment.
|
|
InsertionOrderPreservingMap< string > | tags |
| | Key-value tags with additional metadata.
|
|
ParseInfoType | info_type |
|
|
static constexpr const ParseInfoType | TYPE = ParseInfoType::CREATE_INFO |
◆ CreateMacroInfo() [1/2]
| duckdb::CreateMacroInfo::CreateMacroInfo |
( |
CatalogType | type | ) |
|
|
explicit |
339459 : CreateFunctionInfo(
type, INVALID_SCHEMA) {
339460}
CatalogType type
The to-be-created catalog type.
Definition duckdb.hpp:28158
◆ CreateMacroInfo() [2/2]
This is a weird constructor that exists only for serialization, similarly to GetAllButFirstFunction.
339464 : CreateFunctionInfo(
type, INVALID_SCHEMA) {
339465 macros.push_back(std::move(function));
339466 for (auto ¯o : extra_functions) {
339467 macros.push_back(std::move(macro));
339468 }
339469}
◆ Copy()
Implements duckdb::CreateInfo.
339484 {
339485 auto result = make_uniq<CreateMacroInfo>(
type);
339486 for (auto ¯o : macros) {
339487 result->macros.push_back(macro->Copy());
339488 }
339489 result->name =
name;
339490 CopyFunctionProperties(*result);
339491 return std::move(result);
339492}
string name
Function name.
Definition duckdb.hpp:57707
◆ ToString()
| string duckdb::CreateMacroInfo::ToString |
( |
| ) |
const |
|
overridevirtual |
Reimplemented from duckdb::CreateInfo.
339471 {
339474 string definitions;
339475 for (auto &function : macros) {
339476 if (!definitions.empty()) {
339477 definitions += ", ";
339478 }
339479 definitions += function->ToSQL();
339480 }
339481 return prefix + definitions + ";";
339482}
bool temporary
Whether or not the entry is temporary.
Definition duckdb.hpp:28166
DUCKDB_API string GetCreatePrefix(const string &entry) const
Returns a string like "CREATE (OR REPLACE) (TEMPORARY) <entry> (IF NOT EXISTS) " for TABLE/VIEW/TYPE/...
Definition duckdb.cpp:339436
string catalog
The catalog name of the entry.
Definition duckdb.hpp:28160
string schema
The schema name of the entry.
Definition duckdb.hpp:28162
◆ Serialize()
| void duckdb::CreateMacroInfo::Serialize |
( |
Serializer & | serializer | ) |
const |
|
overridevirtual |
Reimplemented from duckdb::CreateInfo.
415749 {
415750 CreateInfo::Serialize(serializer);
415751 serializer.WritePropertyWithDefault<
string>(200,
"name",
name);
415752 serializer.WritePropertyWithDefault<unique_ptr<MacroFunction>>(201, "function", macros[0]);
415753 serializer.WritePropertyWithDefault<vector<unique_ptr<MacroFunction>>>(202,
"extra_functions",
GetAllButFirstFunction());
415754}
vector< unique_ptr< MacroFunction > > GetAllButFirstFunction() const
Definition duckdb.cpp:339494
◆ Deserialize()
415756 {
415757 auto name = deserializer.ReadPropertyWithDefault<
string>(200,
"name");
415758 auto function = deserializer.ReadPropertyWithDefault<unique_ptr<MacroFunction>>(201, "function");
415759 auto extra_functions = deserializer.ReadPropertyWithDefault<vector<unique_ptr<MacroFunction>>>(202, "extra_functions");
415760 auto result = duckdb::unique_ptr<CreateMacroInfo>(new CreateMacroInfo(deserializer.Get<CatalogType>(), std::move(function), std::move(extra_functions)));
415761 result->name = std::move(
name);
415762 return std::move(result);
415763}
◆ GetAllButFirstFunction()
This is a weird function that exists only for backwards compatibility of serialization Essentially we used to only support a single function in the CreateMacroInfo In order to not break backwards/forwards compatibility, we serialize the first function in the old manner Extra functions are serialized if present in a separate field
339494 {
339495 vector<unique_ptr<MacroFunction>> result;
339496 for (
idx_t i = 1; i < macros.size(); i++) {
339497 result.push_back(macros[i]->Copy());
339498 }
339499 return result;
339500}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
The documentation for this struct was generated from the following file: