338989 {
338990 string result = "";
338991 result += "ATTACH";
338992 if (
on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) {
338993 result += " IF NOT EXISTS";
338994 }
else if (
on_conflict == OnCreateConflict::REPLACE_ON_CONFLICT) {
338995 result += " OR REPLACE";
338996 }
338997 result += " DATABASE ";
338999 if (!
name.empty()) {
339001 }
339003 vector<string> stringified;
339005 stringified.push_back(
StringUtil::Format(
"%s %s", opt.first, opt.second->ToString()));
339006 }
339008 stringified.push_back(
StringUtil::Format(
"%s %s", opt.first, opt.second.ToSQLString()));
339009 }
339011 }
339012 result += ";";
339013 return result;
339014}
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 WriteQuoted(const string &text, char quote='\'')
Writes a string that is quoted.
Definition duckdb.cpp:338028
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497