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::DeleteStatement Class Reference
Inheritance diagram for duckdb::DeleteStatement:
Collaboration diagram for duckdb::DeleteStatement:

Public Member Functions

string ToString () const override
unique_ptr< SQLStatement > Copy () const override
 Create a copy of this SelectStatement.
Public Member Functions inherited from duckdb::SQLStatement
 SQLStatement (StatementType type)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

unique_ptr< ParsedExpression > condition
unique_ptr< TableRef > table
vector< unique_ptr< TableRef > > using_clauses
vector< unique_ptr< ParsedExpression > > returning_list
CommonTableExpressionMap cte_map
 CTEs.
Public Attributes inherited from duckdb::SQLStatement
StatementType type
 The statement type.
idx_t stmt_location = 0
 The statement location within the query string.
idx_t stmt_length = 0
 The statement length within the query string.
case_insensitive_map_t< idx_t > named_param_map
 The map of named parameter to param index.
string query
 The query text that corresponds to this SQL statement.

Static Public Attributes

static constexpr const StatementType TYPE = StatementType::DELETE_STATEMENT
Static Public Attributes inherited from duckdb::SQLStatement
static constexpr const StatementType TYPE = StatementType::INVALID_STATEMENT

Protected Member Functions

 DeleteStatement (const DeleteStatement &other)
Protected Member Functions inherited from duckdb::SQLStatement
 SQLStatement (const SQLStatement &other)=default

Constructor & Destructor Documentation

◆ DeleteStatement() [1/2]

duckdb::DeleteStatement::DeleteStatement ( )
349064 : SQLStatement(StatementType::DELETE_STATEMENT) {
349065}

◆ DeleteStatement() [2/2]

duckdb::DeleteStatement::DeleteStatement ( const DeleteStatement & other)
protected
349067 : SQLStatement(other), table(other.table->Copy()) {
349068 if (other.condition) {
349069 condition = other.condition->Copy();
349070 }
349071 for (const auto &using_clause : other.using_clauses) {
349072 using_clauses.push_back(using_clause->Copy());
349073 }
349074 for (auto &expr : other.returning_list) {
349075 returning_list.emplace_back(expr->Copy());
349076 }
349077 cte_map = other.cte_map.Copy();
349078}
CommonTableExpressionMap cte_map
CTEs.
Definition duckdb.cpp:261242

Member Function Documentation

◆ ToString()

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

Implements duckdb::SQLStatement.

349080 {
349081 string result;
349082 result = cte_map.ToString();
349083 result += "DELETE FROM ";
349084 result += table->ToString();
349085 if (!using_clauses.empty()) {
349086 result += " USING ";
349087 for (idx_t i = 0; i < using_clauses.size(); i++) {
349088 if (i > 0) {
349089 result += ", ";
349090 }
349091 result += using_clauses[i]->ToString();
349092 }
349093 }
349094 if (condition) {
349095 result += " WHERE " + condition->ToString();
349096 }
349097
349098 if (!returning_list.empty()) {
349099 result += " RETURNING ";
349100 for (idx_t i = 0; i < returning_list.size(); i++) {
349101 if (i > 0) {
349102 result += ", ";
349103 }
349104 auto column = returning_list[i]->ToString();
349105 if (!returning_list[i]->GetAlias().empty()) {
349106 column +=
349107 StringUtil::Format(" AS %s", KeywordHelper::WriteOptionallyQuoted(returning_list[i]->GetAlias()));
349108 }
349109 result += column;
349110 }
349111 }
349112 return result;
349113}
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
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Copy()

unique_ptr< SQLStatement > duckdb::DeleteStatement::Copy ( ) const
overridevirtual

Create a copy of this SelectStatement.

Implements duckdb::SQLStatement.

349115 {
349116 return unique_ptr<DeleteStatement>(new DeleteStatement(*this));
349117}

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