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::AttachOptions Struct Reference

AttachOptions holds information about a database we plan to attach. These options are generalized, i.e., they have to apply to any database file type (duckdb, sqlite, etc.). More...

#include <duckdb.hpp>

Collaboration diagram for duckdb::AttachOptions:

Public Member Functions

 AttachOptions (const DBConfigOptions &options)
 Constructor for databases we attach outside of the ATTACH DATABASE statement.
 AttachOptions (const unordered_map< string, Value > &options, const AccessMode default_access_mode)
 Constructor for databases we attach when using ATTACH DATABASE.

Public Attributes

AccessMode access_mode
 Defaults to the access mode configured in the DBConfig, unless specified otherwise.
RecoveryMode recovery_mode = RecoveryMode::DEFAULT
 The recovery type of the database.
string db_type
 The file format type. The default type is a duckdb database file, but other file formats are possible.
unordered_map< string, Value > options
 Set of remaining (key, value) options.
QualifiedName default_table
 (optionally) a catalog can be provided with a default table
bool is_main_database = false
 Whether this is the main database.
AttachVisibility visibility = AttachVisibility::SHOWN
 The visibility of the attached database.
unique_ptr< StoredDatabasePath > stored_database_path
 The stored database path (in the path manager).

Detailed Description

AttachOptions holds information about a database we plan to attach. These options are generalized, i.e., they have to apply to any database file type (duckdb, sqlite, etc.).

Constructor & Destructor Documentation

◆ AttachOptions() [1/2]

duckdb::AttachOptions::AttachOptions ( const DBConfigOptions & options)
explicit

Constructor for databases we attach outside of the ATTACH DATABASE statement.

262096 : access_mode(options.access_mode), db_type(options.database_type) {
262097}
unordered_map< string, Value > options
Set of remaining (key, value) options.
Definition duckdb.hpp:40371
string db_type
The file format type. The default type is a duckdb database file, but other file formats are possible...
Definition duckdb.hpp:40369
AccessMode access_mode
Defaults to the access mode configured in the DBConfig, unless specified otherwise.
Definition duckdb.hpp:40365

◆ AttachOptions() [2/2]

duckdb::AttachOptions::AttachOptions ( const unordered_map< string, Value > & options,
const AccessMode default_access_mode )

Constructor for databases we attach when using ATTACH DATABASE.

262100 : access_mode(default_access_mode) {
262101 for (auto &entry : attach_options) {
262102 if (entry.first == "readonly" || entry.first == "read_only") {
262103 // Extract the read access mode.
262104 auto read_only = BooleanValue::Get(entry.second.DefaultCastAs(LogicalType::BOOLEAN));
262105 if (read_only) {
262106 access_mode = AccessMode::READ_ONLY;
262107 } else {
262108 access_mode = AccessMode::READ_WRITE;
262109 }
262110 continue;
262111 }
262112
262113 if (entry.first == "recovery_mode") {
262114 // Extract the recovery mode.
262115 auto mode_str = StringValue::Get(entry.second.DefaultCastAs(LogicalType::VARCHAR));
262116 recovery_mode = EnumUtil::FromString<RecoveryMode>(mode_str);
262117 continue;
262118 }
262119
262120 if (entry.first == "readwrite" || entry.first == "read_write") {
262121 // Extract the write access mode.
262122 auto read_write = BooleanValue::Get(entry.second.DefaultCastAs(LogicalType::BOOLEAN));
262123 if (!read_write) {
262124 access_mode = AccessMode::READ_ONLY;
262125 } else {
262126 access_mode = AccessMode::READ_WRITE;
262127 }
262128 continue;
262129 }
262130
262131 if (entry.first == "type") {
262132 // Extract the database type.
262133 db_type = StringValue::Get(entry.second.DefaultCastAs(LogicalType::VARCHAR));
262134 continue;
262135 }
262136
262137 if (entry.first == "default_table") {
262138 default_table = QualifiedName::Parse(StringValue::Get(entry.second.DefaultCastAs(LogicalType::VARCHAR)));
262139 continue;
262140 }
262141
262142 if (entry.first == "hidden") {
262143 auto is_hidden = BooleanValue::Get(entry.second.DefaultCastAs(LogicalType::BOOLEAN));
262144 if (is_hidden) {
262145 visibility = AttachVisibility::HIDDEN;
262146 }
262147 continue;
262148 }
262149 options.emplace(entry.first, entry.second);
262150 }
262151}
RecoveryMode recovery_mode
The recovery type of the database.
Definition duckdb.hpp:40367
QualifiedName default_table
(optionally) a catalog can be provided with a default table
Definition duckdb.hpp:40373
AttachVisibility visibility
The visibility of the attached database.
Definition duckdb.hpp:40377
static QualifiedName Parse(const string &input)
Definition duckdb.cpp:347714
Here is the call graph for this function:

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