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::CreateTypeInfo Struct Reference
Inheritance diagram for duckdb::CreateTypeInfo:
Collaboration diagram for duckdb::CreateTypeInfo:

Public Member Functions

 CreateTypeInfo (string name_p, LogicalType type_p, bind_logical_type_function_t bind_function_p=nullptr)
unique_ptr< CreateInfo > Copy () const override
DUCKDB_API void Serialize (Serializer &serializer) const override
string ToString () const override
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

string name
 Name of the Type.
LogicalType type
 Logical Type.
unique_ptr< SQLStatement > query
 Used by create enum from query.
bind_logical_type_function_t bind_function
 Bind type modifiers to the type.
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

◆ CreateTypeInfo() [1/2]

duckdb::CreateTypeInfo::CreateTypeInfo ( )
339809 : CreateInfo(CatalogType::TYPE_ENTRY), bind_function(nullptr) {
339810}
bind_logical_type_function_t bind_function
Bind type modifiers to the type.
Definition duckdb.hpp:53874

◆ CreateTypeInfo() [2/2]

duckdb::CreateTypeInfo::CreateTypeInfo ( string name_p,
LogicalType type_p,
bind_logical_type_function_t bind_function_p = nullptr )
339812 : CreateInfo(CatalogType::TYPE_ENTRY), name(std::move(name_p)), type(std::move(type_p)),
339813 bind_function(bind_function_p) {
339814}
string name
Name of the Type.
Definition duckdb.hpp:53868
LogicalType type
Logical Type.
Definition duckdb.hpp:53870

Member Function Documentation

◆ Copy()

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

Implements duckdb::CreateInfo.

339816 {
339817 auto result = make_uniq<CreateTypeInfo>();
339818 CopyProperties(*result);
339819 result->name = name;
339820 result->type = type;
339821 if (query) {
339822 result->query = query->Copy();
339823 }
339824 result->bind_function = bind_function;
339825 return std::move(result);
339826}
unique_ptr< SQLStatement > query
Used by create enum from query.
Definition duckdb.hpp:53872

◆ Serialize()

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

Reimplemented from duckdb::CreateInfo.

415820 {
415821 CreateInfo::Serialize(serializer);
415822 serializer.WritePropertyWithDefault<string>(200, "name", name);
415823 serializer.WriteProperty<LogicalType>(201, "logical_type", type);
415824}

◆ Deserialize()

unique_ptr< CreateInfo > duckdb::CreateTypeInfo::Deserialize ( Deserializer & deserializer)
static
415826 {
415827 auto result = duckdb::unique_ptr<CreateTypeInfo>(new CreateTypeInfo());
415828 deserializer.ReadPropertyWithDefault<string>(200, "name", result->name);
415829 deserializer.ReadProperty<LogicalType>(201, "logical_type", result->type);
415830 return std::move(result);
415831}

◆ ToString()

string duckdb::CreateTypeInfo::ToString ( ) const
overridevirtual

Reimplemented from duckdb::CreateInfo.

339828 {
339829 string result = GetCreatePrefix("TYPE");
339830 result += QualifierToString(temporary ? "" : catalog, schema, name);
339831 if (type.id() == LogicalTypeId::ENUM) {
339832 auto &values_insert_order = EnumType::GetValuesInsertOrder(type);
339833 idx_t size = EnumType::GetSize(type);
339834
339835 result += " AS ENUM ( ";
339836 for (idx_t i = 0; i < size; i++) {
339837 result += "'" + values_insert_order.GetValue(i).ToString() + "'";
339838 if (i != size - 1) {
339839 result += ", ";
339840 }
339841 }
339842 result += " );";
339843 } else if (type.id() == LogicalTypeId::INVALID) {
339844 // CREATE TYPE mood AS ENUM (SELECT 'happy')
339845 D_ASSERT(query);
339846 result += " AS ENUM (" + query->ToString() + ")";
339847 } else {
339848 result += " AS ";
339849 result += type.ToString();
339850 }
339851 result += ";";
339852 return result;
339853}
GOpaque< Size > size(const GMat &src)
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
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

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