349616 {
349617 string result;
349618 result =
cte_map.ToString();
349619 result += "MERGE INTO ";
349620 result += target->ToString();
349621 result += " USING ";
349622 result += source->ToString();
349623 if (join_condition) {
349624 result += " ON ";
349625 result += join_condition->ToString();
349626 } else {
349627 result += " USING (";
349628 for (
idx_t c = 0; c < using_columns.size(); c++) {
349629 if (c > 0) {
349630 result += ", ";
349631 }
349632 result += using_columns[c];
349633 }
349634 result += ")";
349635 }
349636 for (auto &entry : actions) {
349637 for (auto &action : entry.second) {
349638 result += " ";
349639 result += MergeIntoStatement::ActionConditionToString(entry.first);
349640 result += " ";
349641 result += action->ToString();
349642 }
349643 }
349645 result += " RETURNING ";
349647 if (i > 0) {
349648 result += ", ";
349649 }
349652 column +=
349654 }
349655 result += column;
349656 }
349657 }
349658 return result;
349659}
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