Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::CreateMacroInfo Struct Reference
Inheritance diagram for duckdb::CreateMacroInfo:
Collaboration diagram for duckdb::CreateMacroInfo:

Public Member Functions

 CreateMacroInfo (CatalogType type)
unique_ptr< CreateInfo > Copy () const override
string ToString () const override
DUCKDB_API void Serialize (Serializer &serializer) const override
vector< unique_ptr< MacroFunction > > GetAllButFirstFunction () const
 CreateMacroInfo (CatalogType type, unique_ptr< MacroFunction > function, vector< unique_ptr< MacroFunction > > extra_functions)
 This is a weird constructor that exists only for serialization, similarly to GetAllButFirstFunction.
Public Member Functions inherited from duckdb::CreateFunctionInfo
 CreateFunctionInfo (CatalogType type, string schema=DEFAULT_SCHEMA)
DUCKDB_API void CopyFunctionProperties (CreateFunctionInfo &other) const
Public Member Functions inherited from duckdb::CreateInfo
 CreateInfo (CatalogType type, string schema=DEFAULT_SCHEMA, string catalog_p=INVALID_CATALOG)
DUCKDB_API void CopyProperties (CreateInfo &other) const
virtual DUCKDB_API unique_ptr< AlterInfo > GetAlterInfo () const
 Generates an alter statement from the create statement - used for OnCreateConflict::ALTER_ON_CONFLICT.
DUCKDB_API string GetCreatePrefix (const string &entry) const
 Returns a string like "CREATE (OR REPLACE) (TEMPORARY) <entry> (IF NOT EXISTS) " for TABLE/VIEW/TYPE/MACRO.
Public Member Functions inherited from duckdb::ParseInfo
 ParseInfo (ParseInfoType info_type)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static DUCKDB_API unique_ptr< CreateInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::CreateInfo
static unique_ptr< CreateInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::ParseInfo
static unique_ptr< ParseInfo > Deserialize (Deserializer &deserializer)
static string QualifierToString (const string &catalog, const string &schema, const string &name)
static string TypeToString (CatalogType type)

Public Attributes

vector< unique_ptr< MacroFunction > > macros
Public Attributes inherited from duckdb::CreateFunctionInfo
string name
 Function name.
string alias_of
 The function name of which this function is an alias.
vector< FunctionDescription > descriptions
 Function description.
Public Attributes inherited from duckdb::CreateInfo
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.
Public Attributes inherited from duckdb::ParseInfo
ParseInfoType info_type

Additional Inherited Members

Static Public Attributes inherited from duckdb::CreateInfo
static constexpr const ParseInfoType TYPE = ParseInfoType::CREATE_INFO

Constructor & Destructor Documentation

◆ 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]

duckdb::CreateMacroInfo::CreateMacroInfo ( CatalogType type,
unique_ptr< MacroFunction > function,
vector< unique_ptr< MacroFunction > > extra_functions )

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 &macro : extra_functions) {
339467 macros.push_back(std::move(macro));
339468 }
339469}

Member Function Documentation

◆ Copy()

unique_ptr< CreateInfo > duckdb::CreateMacroInfo::Copy ( ) const
overridevirtual

Implements duckdb::CreateInfo.

339484 {
339485 auto result = make_uniq<CreateMacroInfo>(type);
339486 for (auto &macro : 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 {
339472 auto prefix = GetCreatePrefix("MACRO");
339473 prefix += QualifierToString(temporary ? "" : catalog, schema, name) + " ";
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()

unique_ptr< CreateInfo > duckdb::CreateMacroInfo::Deserialize ( Deserializer & deserializer)
static
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()

vector< unique_ptr< MacroFunction > > duckdb::CreateMacroInfo::GetAllButFirstFunction ( ) const

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: