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::ShowRef Class Reference

Represents a SHOW/DESCRIBE/SUMMARIZE statement. More...

Inheritance diagram for duckdb::ShowRef:
Collaboration diagram for duckdb::ShowRef:

Public Member Functions

string ToString () const override
 Convert the object to a string.
bool Equals (const TableRef &other_p) const override
unique_ptr< TableRef > Copy () override
void Serialize (Serializer &serializer) const override
 Deserializes a blob back into a ExpressionListRef.
Public Member Functions inherited from duckdb::TableRef
 TableRef (TableReferenceType type)
void Print ()
void CopyProperties (TableRef &target) const
 Copy the properties of this table ref to the target.
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< TableRef > Deserialize (Deserializer &source)
Static Public Member Functions inherited from duckdb::TableRef
static bool Equals (const unique_ptr< TableRef > &left, const unique_ptr< TableRef > &right)
static unique_ptr< TableRef > Deserialize (Deserializer &deserializer)

Public Attributes

string table_name
 The table name (if any).
string catalog_name
 The catalog name (if any).
string schema_name
 The schema name (if any).
unique_ptr< QueryNode > query
 The QueryNode of select query (if any).
ShowType show_type
 Whether or not we are requesting a summary or a describe.
Public Attributes inherited from duckdb::TableRef
TableReferenceType type
string alias
unique_ptr< SampleOptions > sample
 Sample options (if any).
optional_idx query_location
 The location in the query (if any).
shared_ptr< ExternalDependency > external_dependency
 External dependencies of this table function.
vector< string > column_name_alias
 Aliases for the column names.

Static Public Attributes

static constexpr const TableReferenceType TYPE = TableReferenceType::SHOW_REF
Static Public Attributes inherited from duckdb::TableRef
static constexpr const TableReferenceType TYPE = TableReferenceType::INVALID

Additional Inherited Members

Protected Member Functions inherited from duckdb::TableRef
string BaseToString (string result) const
string BaseToString (string result, const vector< string > &column_name_alias) const
string AliasToString (const vector< string > &column_name_alias) const
string SampleToString () const

Detailed Description

Represents a SHOW/DESCRIBE/SUMMARIZE statement.

Constructor & Destructor Documentation

◆ ShowRef()

duckdb::ShowRef::ShowRef ( )
351044 : TableRef(TableReferenceType::SHOW_REF), show_type(ShowType::DESCRIBE) {
351045}
ShowType show_type
Whether or not we are requesting a summary or a describe.
Definition duckdb.cpp:61408

Member Function Documentation

◆ ToString()

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

Convert the object to a string.

Implements duckdb::TableRef.

351047 {
351048 string result;
351049 if (show_type == ShowType::SUMMARY) {
351050 result += "SUMMARIZE ";
351051 } else if (show_type == ShowType::SHOW_FROM) {
351052 result += "SHOW TABLES FROM ";
351053 string name = "";
351054 if (!catalog_name.empty()) {
351056 if (!schema_name.empty()) {
351057 name += ".";
351058 }
351059 }
351061 result += name;
351062 } else {
351063 result += "DESCRIBE ";
351064 }
351065 if (query) {
351066 result += "(";
351067 result += query->ToString();
351068 result += ")";
351069 } else if (table_name != "__show_tables_expanded") {
351070 result += table_name;
351071 }
351072 return result;
351073}
static string WriteOptionallyQuoted(const string &text, char quote='"', bool allow_caps = true, KeywordCategory category = KeywordCategory::KEYWORD_NONE)
Writes a string that is optionally quoted + escaped so it can be used as an identifier.
Definition duckdb.cpp:338034
unique_ptr< QueryNode > query
The QueryNode of select query (if any).
Definition duckdb.cpp:61406
string schema_name
The schema name (if any).
Definition duckdb.cpp:61404
string table_name
The table name (if any).
Definition duckdb.cpp:61400
string catalog_name
The catalog name (if any).
Definition duckdb.cpp:61402
Here is the call graph for this function:

◆ Equals()

bool duckdb::ShowRef::Equals ( const TableRef & other_p) const
overridevirtual

Reimplemented from duckdb::TableRef.

351075 {
351076 if (!TableRef::Equals(other_p)) {
351077 return false;
351078 }
351079 auto &other = other_p.Cast<ShowRef>();
351080 if (other.query.get() != query.get()) {
351081 if (!other.query->Equals(query.get())) {
351082 return false;
351083 }
351084 }
351085 return table_name == other.table_name && show_type == other.show_type;
351086}

◆ Copy()

unique_ptr< TableRef > duckdb::ShowRef::Copy ( )
overridevirtual

Implements duckdb::TableRef.

351088 {
351089 auto copy = make_uniq<ShowRef>();
351090
351091 copy->catalog_name = catalog_name;
351092 copy->schema_name = schema_name;
351093 copy->table_name = table_name;
351094 copy->query = query ? query->Copy() : nullptr;
351095 copy->show_type = show_type;
351096 CopyProperties(*copy);
351097
351098 return std::move(copy);
351099}
void CopyProperties(TableRef &target) const
Copy the properties of this table ref to the target.
Definition duckdb.cpp:351228

◆ Serialize()

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

Deserializes a blob back into a ExpressionListRef.

Reimplemented from duckdb::TableRef.

419758 {
419759 TableRef::Serialize(serializer);
419760 serializer.WritePropertyWithDefault<string>(200, "table_name", table_name);
419761 serializer.WritePropertyWithDefault<unique_ptr<QueryNode>>(201, "query", query);
419762 serializer.WriteProperty<ShowType>(202, "show_type", show_type);
419763 serializer.WritePropertyWithDefault<string>(203, "catalog_name", catalog_name);
419764 serializer.WritePropertyWithDefault<string>(204, "schema_name", schema_name);
419765}

◆ Deserialize()

unique_ptr< TableRef > duckdb::ShowRef::Deserialize ( Deserializer & source)
static
419767 {
419768 auto result = duckdb::unique_ptr<ShowRef>(new ShowRef());
419769 deserializer.ReadPropertyWithDefault<string>(200, "table_name", result->table_name);
419770 deserializer.ReadPropertyWithDefault<unique_ptr<QueryNode>>(201, "query", result->query);
419771 deserializer.ReadProperty<ShowType>(202, "show_type", result->show_type);
419772 deserializer.ReadPropertyWithDefault<string>(203, "catalog_name", result->catalog_name);
419773 deserializer.ReadPropertyWithDefault<string>(204, "schema_name", result->schema_name);
419774 return std::move(result);
419775}

The documentation for this class was generated from the following file: