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 +=
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