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::AttachInfo Struct Reference
Inheritance diagram for duckdb::AttachInfo:
Collaboration diagram for duckdb::AttachInfo:

Public Member Functions

unique_ptr< AttachInfo > Copy () const
 Copies this AttachInfo and returns an unique pointer to the new AttachInfo.
string ToString () const
void Serialize (Serializer &serializer) const override
Public Member Functions inherited from duckdb::ParseInfo
 ParseInfo (ParseInfoType info_type)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< ParseInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::ParseInfo
static unique_ptr< ParseInfo > Deserialize (Deserializer &deserializer)
static string QualifierToString (const string &catalog, const string &schema, const string &name)
static string TypeToString (CatalogType type)

Public Attributes

string name
 The alias of the attached database.
string path
 The path to the attached database.
case_insensitive_map_t< unique_ptr< ParsedExpression > > parsed_options
 Set of (key, value) options.
unordered_map< string, Value > options
 Set of bound (key, value) options.
OnCreateConflict on_conflict = OnCreateConflict::ERROR_ON_CONFLICT
 What to do on create conflict.
Public Attributes inherited from duckdb::ParseInfo
ParseInfoType info_type

Static Public Attributes

static constexpr const ParseInfoType TYPE = ParseInfoType::ATTACH_INFO

Constructor & Destructor Documentation

◆ AttachInfo()

duckdb::AttachInfo::AttachInfo ( )
inline
40663 : ParseInfo(TYPE) {
40664 }

Member Function Documentation

◆ Copy()

unique_ptr< AttachInfo > duckdb::AttachInfo::Copy ( ) const

Copies this AttachInfo and returns an unique pointer to the new AttachInfo.

338977 {
338978 auto result = make_uniq<AttachInfo>();
338979 result->name = name;
338980 result->path = path;
338981 result->options = options;
338982 for (auto &entry : parsed_options) {
338983 result->parsed_options[entry.first] = entry.second->Copy();
338984 }
338985 result->on_conflict = on_conflict;
338986 return result;
338987}
OnCreateConflict on_conflict
What to do on create conflict.
Definition duckdb.hpp:40675
string name
The alias of the attached database.
Definition duckdb.hpp:40667
unordered_map< string, Value > options
Set of bound (key, value) options.
Definition duckdb.hpp:40673
string path
The path to the attached database.
Definition duckdb.hpp:40669
case_insensitive_map_t< unique_ptr< ParsedExpression > > parsed_options
Set of (key, value) options.
Definition duckdb.hpp:40671

◆ ToString()

string duckdb::AttachInfo::ToString ( ) const
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 ";
338998 result += KeywordHelper::WriteQuoted(path, '\'');
338999 if (!name.empty()) {
339000 result += " AS " + KeywordHelper::WriteOptionallyQuoted(name);
339001 }
339002 if (!parsed_options.empty() || !options.empty()) {
339003 vector<string> stringified;
339004 for (auto &opt : parsed_options) {
339005 stringified.push_back(StringUtil::Format("%s %s", opt.first, opt.second->ToString()));
339006 }
339007 for (auto &opt : options) {
339008 stringified.push_back(StringUtil::Format("%s %s", opt.first, opt.second.ToSQLString()));
339009 }
339010 result += " (" + StringUtil::Join(stringified, ", ") + ")";
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

◆ Serialize()

void duckdb::AttachInfo::Serialize ( Serializer & serializer) const
overridevirtual

Reimplemented from duckdb::ParseInfo.

418219 {
418220 ParseInfo::Serialize(serializer);
418221 serializer.WritePropertyWithDefault<string>(200, "name", name);
418222 serializer.WritePropertyWithDefault<string>(201, "path", path);
418223 serializer.WritePropertyWithDefault<unordered_map<string, Value>>(202, "options", options);
418224 serializer.WritePropertyWithDefault<OnCreateConflict>(203, "on_conflict", on_conflict, OnCreateConflict::ERROR_ON_CONFLICT);
418225}

◆ Deserialize()

unique_ptr< ParseInfo > duckdb::AttachInfo::Deserialize ( Deserializer & deserializer)
static
418227 {
418228 auto result = duckdb::unique_ptr<AttachInfo>(new AttachInfo());
418229 deserializer.ReadPropertyWithDefault<string>(200, "name", result->name);
418230 deserializer.ReadPropertyWithDefault<string>(201, "path", result->path);
418231 deserializer.ReadPropertyWithDefault<unordered_map<string, Value>>(202, "options", result->options);
418232 deserializer.ReadPropertyWithExplicitDefault<OnCreateConflict>(203, "on_conflict", result->on_conflict, OnCreateConflict::ERROR_ON_CONFLICT);
418233 return std::move(result);
418234}

The documentation for this struct was generated from the following files: