349665 {
349666 string result;
349668 result +=
" AND " +
condition->ToString() +
" ";
349669 }
349670 result += "THEN ";
349672 case MergeActionType::MERGE_UPDATE:
349673 result += "UPDATE ";
349674 if (
column_order == InsertColumnOrder::INSERT_BY_NAME) {
349675 result += "BY NAME ";
349676 }
349679 }
349680 break;
349681 case MergeActionType::MERGE_DELETE:
349682 result += "DELETE";
349683 break;
349684 case MergeActionType::MERGE_INSERT:
349685 result += "INSERT ";
349686 if (
column_order == InsertColumnOrder::INSERT_BY_NAME) {
349687 result += "BY NAME ";
349688 }
349690 result += "(";
349692 if (c > 0) {
349693 result += ", ";
349694 }
349696 }
349697 result += ") ";
349698 }
349701 result += "DEFAULT VALUES";
349702 } else {
349703 result += "*";
349704 }
349705 } else {
349706 result += "VALUES (";
349708 if (c > 0) {
349709 result += ", ";
349710 }
349712 }
349713 result += ")";
349714 }
349715 break;
349716 case MergeActionType::MERGE_DO_NOTHING:
349717 result += "DO NOTHING";
349718 break;
349719 case MergeActionType::MERGE_ERROR:
349720 result += "ERROR";
349723 }
349724 break;
349725 default:
349726 throw InternalException("Unsupported merge action in ToString");
349727 }
349728 return result;
349729}
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
vector< unique_ptr< ParsedExpression > > expressions
Set of expressions for INSERT.
Definition duckdb.cpp:196299
bool default_values
Whether or not this is a INSERT DEFAULT VALUES.
Definition duckdb.cpp:196303
vector< string > insert_columns
Column names to insert into (if action_type == MERGE_INSERT).
Definition duckdb.cpp:196297
unique_ptr< ParsedExpression > condition
Condition - or NULL if this should always be performed for the given action.
Definition duckdb.cpp:196293
MergeActionType action_type
The merge action type.
Definition duckdb.cpp:196291
InsertColumnOrder column_order
INSERT BY POSITION or INSERT BY NAME.
Definition duckdb.cpp:196301
unique_ptr< UpdateSetInfo > update_info
The SET information (if action_type == MERGE_UPDATE).
Definition duckdb.cpp:196295
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237