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

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< TableRef > table
unique_ptr< TableRef > from_table
vector< unique_ptr< ParsedExpression > > returning_list
 keep track of optional returningList if statement contains a RETURNING keyword
unique_ptr< UpdateSetInfo > set_info
CommonTableExpressionMap cte_map
 CTEs.
bool prioritize_table_when_binding
 bind the same way as ALTER TABLE expressions, (where the catalog the table is in is preferred)
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::UPDATE_STATEMENT
Static Public Attributes inherited from duckdb::SQLStatement
static constexpr const StatementType TYPE = StatementType::INVALID_STATEMENT

Protected Member Functions

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

Constructor & Destructor Documentation

◆ UpdateStatement() [1/2]

duckdb::UpdateStatement::UpdateStatement ( )
350109 : SQLStatement(StatementType::UPDATE_STATEMENT), prioritize_table_when_binding(false) {
350110}
bool prioritize_table_when_binding
bind the same way as ALTER TABLE expressions, (where the catalog the table is in is preferred)
Definition duckdb.cpp:61277

◆ UpdateStatement() [2/2]

duckdb::UpdateStatement::UpdateStatement ( const UpdateStatement & other)
protected
350113 : SQLStatement(other), table(other.table->Copy()), set_info(other.set_info->Copy()) {
350114 if (other.from_table) {
350115 from_table = other.from_table->Copy();
350116 }
350117 for (auto &expr : other.returning_list) {
350118 returning_list.emplace_back(expr->Copy());
350119 }
350120 cte_map = other.cte_map.Copy();
350121 prioritize_table_when_binding = other.prioritize_table_when_binding;
350122}
CommonTableExpressionMap cte_map
CTEs.
Definition duckdb.cpp:61275
vector< unique_ptr< ParsedExpression > > returning_list
keep track of optional returningList if statement contains a RETURNING keyword
Definition duckdb.cpp:61272

Member Function Documentation

◆ ToString()

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

Implements duckdb::SQLStatement.

350124 {
350125 string result;
350126 result = cte_map.ToString();
350127 result += "UPDATE ";
350128 result += table->ToString();
350129 result += " ";
350130 result += set_info->ToString();
350131 if (from_table) {
350132 result += " FROM " + from_table->ToString();
350133 }
350134 if (set_info->condition) {
350135 result += " WHERE " + set_info->condition->ToString();
350136 }
350137 if (!returning_list.empty()) {
350138 result += " RETURNING ";
350139 for (idx_t i = 0; i < returning_list.size(); i++) {
350140 if (i > 0) {
350141 result += ", ";
350142 }
350143 auto column = returning_list[i]->ToString();
350144 if (!returning_list[i]->GetAlias().empty()) {
350145 column +=
350147 }
350148 result += column;
350149 }
350150 }
350151 return result;
350152}
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::UpdateStatement::Copy ( ) const
overridevirtual

Create a copy of this SelectStatement.

Implements duckdb::SQLStatement.

350154 {
350155 return unique_ptr<UpdateStatement>(new UpdateStatement(*this));
350156}

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