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::CreateInfo Struct Referenceabstract
Inheritance diagram for duckdb::CreateInfo:
Collaboration diagram for duckdb::CreateInfo:

Public Member Functions

 CreateInfo (CatalogType type, string schema=DEFAULT_SCHEMA, string catalog_p=INVALID_CATALOG)
void Serialize (Serializer &serializer) const override
virtual unique_ptr< CreateInfo > Copy () const =0
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.
virtual string ToString () const
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 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

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

Static Public Attributes

static constexpr const ParseInfoType TYPE = ParseInfoType::CREATE_INFO

Constructor & Destructor Documentation

◆ CreateInfo()

duckdb::CreateInfo::CreateInfo ( CatalogType type,
string schema = DEFAULT_SCHEMA,
string catalog_p = INVALID_CATALOG )
inlineexplicit
28151 : ParseInfo(TYPE), type(type), catalog(std::move(catalog_p)), schema(std::move(schema)),
28152 on_conflict(OnCreateConflict::ERROR_ON_CONFLICT), temporary(false), internal(false) {
28153 }
bool temporary
Whether or not the entry is temporary.
Definition duckdb.hpp:28166
bool internal
Whether or not the entry is an internal entry.
Definition duckdb.hpp:28168
string catalog
The catalog name of the entry.
Definition duckdb.hpp:28160
OnCreateConflict on_conflict
What to do on create conflict.
Definition duckdb.hpp:28164
CatalogType type
The to-be-created catalog type.
Definition duckdb.hpp:28158
string schema
The schema name of the entry.
Definition duckdb.hpp:28162

◆ ~CreateInfo()

duckdb::CreateInfo::~CreateInfo ( )
inlineoverride
28154 {
28155 }

Member Function Documentation

◆ Serialize()

void duckdb::CreateInfo::Serialize ( Serializer & serializer) const
overridevirtual

Reimplemented from duckdb::ParseInfo.

415651 {
415652 serializer.WriteProperty<CatalogType>(100, "type", type);
415653 serializer.WritePropertyWithDefault<string>(101, "catalog", catalog);
415654 serializer.WritePropertyWithDefault<string>(102, "schema", schema);
415655 serializer.WritePropertyWithDefault<bool>(103, "temporary", temporary);
415656 serializer.WritePropertyWithDefault<bool>(104, "internal", internal);
415657 serializer.WriteProperty<OnCreateConflict>(105, "on_conflict", on_conflict);
415658 serializer.WritePropertyWithDefault<string>(106, "sql", sql);
415659 serializer.WritePropertyWithDefault<Value>(107, "comment", comment, Value());
415660 serializer.WritePropertyWithDefault<InsertionOrderPreservingMap<string>>(108, "tags", tags, InsertionOrderPreservingMap<string>());
415661 if (serializer.ShouldSerialize(2)) {
415662 serializer.WritePropertyWithDefault<LogicalDependencyList>(109, "dependencies", dependencies, LogicalDependencyList());
415663 }
415664}
Value comment
User provided comment.
Definition duckdb.hpp:28174
InsertionOrderPreservingMap< string > tags
Key-value tags with additional metadata.
Definition duckdb.hpp:28176
string sql
The SQL string of the CREATE statement.
Definition duckdb.hpp:28170
LogicalDependencyList dependencies
The inherent dependencies of the created entry.
Definition duckdb.hpp:28172

◆ Deserialize()

unique_ptr< CreateInfo > duckdb::CreateInfo::Deserialize ( Deserializer & deserializer)
static
415666 {
415667 auto type = deserializer.ReadProperty<CatalogType>(100, "type");
415668 auto catalog = deserializer.ReadPropertyWithDefault<string>(101, "catalog");
415669 auto schema = deserializer.ReadPropertyWithDefault<string>(102, "schema");
415670 auto temporary = deserializer.ReadPropertyWithDefault<bool>(103, "temporary");
415671 auto internal = deserializer.ReadPropertyWithDefault<bool>(104, "internal");
415672 auto on_conflict = deserializer.ReadProperty<OnCreateConflict>(105, "on_conflict");
415673 auto sql = deserializer.ReadPropertyWithDefault<string>(106, "sql");
415674 auto comment = deserializer.ReadPropertyWithExplicitDefault<Value>(107, "comment", Value());
415675 auto tags = deserializer.ReadPropertyWithExplicitDefault<InsertionOrderPreservingMap<string>>(108, "tags", InsertionOrderPreservingMap<string>());
415676 auto dependencies = deserializer.ReadPropertyWithExplicitDefault<LogicalDependencyList>(109, "dependencies", LogicalDependencyList());
415677 deserializer.Set<CatalogType>(type);
415678 unique_ptr<CreateInfo> result;
415679 switch (type) {
415680 case CatalogType::INDEX_ENTRY:
415681 result = CreateIndexInfo::Deserialize(deserializer);
415682 break;
415683 case CatalogType::MACRO_ENTRY:
415684 result = CreateMacroInfo::Deserialize(deserializer);
415685 break;
415686 case CatalogType::SCHEMA_ENTRY:
415687 result = CreateSchemaInfo::Deserialize(deserializer);
415688 break;
415689 case CatalogType::SEQUENCE_ENTRY:
415690 result = CreateSequenceInfo::Deserialize(deserializer);
415691 break;
415692 case CatalogType::TABLE_ENTRY:
415693 result = CreateTableInfo::Deserialize(deserializer);
415694 break;
415695 case CatalogType::TABLE_MACRO_ENTRY:
415696 result = CreateMacroInfo::Deserialize(deserializer);
415697 break;
415698 case CatalogType::TYPE_ENTRY:
415699 result = CreateTypeInfo::Deserialize(deserializer);
415700 break;
415701 case CatalogType::VIEW_ENTRY:
415702 result = CreateViewInfo::Deserialize(deserializer);
415703 break;
415704 default:
415705 throw SerializationException("Unsupported type for deserialization of CreateInfo!");
415706 }
415707 deserializer.Unset<CatalogType>();
415708 result->catalog = std::move(catalog);
415709 result->schema = std::move(schema);
415710 result->temporary = temporary;
415711 result->internal = internal;
415712 result->on_conflict = on_conflict;
415713 result->sql = std::move(sql);
415714 result->comment = comment;
415715 result->tags = std::move(tags);
415716 result->dependencies = dependencies;
415717 return result;
415718}

◆ CopyProperties()

void duckdb::CreateInfo::CopyProperties ( CreateInfo & other) const
339419 {
339420 other.type = type;
339421 other.catalog = catalog;
339422 other.schema = schema;
339423 other.on_conflict = on_conflict;
339424 other.temporary = temporary;
339425 other.internal = internal;
339426 other.sql = sql;
339427 other.dependencies = dependencies;
339428 other.comment = comment;
339429 other.tags = tags;
339430}

◆ GetAlterInfo()

unique_ptr< AlterInfo > duckdb::CreateInfo::GetAlterInfo ( ) const
virtual

Generates an alter statement from the create statement - used for OnCreateConflict::ALTER_ON_CONFLICT.

Reimplemented in duckdb::CreateScalarFunctionInfo, and duckdb::CreateTableFunctionInfo.

339432 {
339433 throw NotImplementedException("GetAlterInfo not implemented for this type");
339434}
Here is the caller graph for this function:

◆ GetCreatePrefix()

string duckdb::CreateInfo::GetCreatePrefix ( const string & entry) const

Returns a string like "CREATE (OR REPLACE) (TEMPORARY) <entry> (IF NOT EXISTS) " for TABLE/VIEW/TYPE/MACRO.

339436 {
339437 string prefix = "CREATE";
339438 if (on_conflict == OnCreateConflict::REPLACE_ON_CONFLICT) {
339439 prefix += " OR REPLACE";
339440 }
339441 if (temporary) {
339442 prefix += " TEMP";
339443 }
339444 prefix += " " + entry + " ";
339445
339446 if (on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) {
339447 prefix += " IF NOT EXISTS ";
339448 }
339449 return prefix;
339450}

◆ ToString()

virtual string duckdb::CreateInfo::ToString ( ) const
inlinevirtual
28190 {
28191 throw NotImplementedException("ToString not supported for this type of CreateInfo: '%s'",
28192 EnumUtil::ToString(info_type));
28193 }

The documentation for this struct was generated from the following files: