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

Public Types

using RETURN_TYPE = vector<string>

Static Public Member Functions

static void SetGlobal (DatabaseInstance *db, DBConfig &config, const Value &parameter)
static void ResetGlobal (DatabaseInstance *db, DBConfig &config)
static Value GetSetting (const ClientContext &context)

Static Public Attributes

static constexpr const char * Name = "allowed_directories"
static constexpr const char * Description
static constexpr const char * InputType = "VARCHAR[]"

Member Function Documentation

◆ SetGlobal()

void duckdb::AllowedDirectoriesSetting::SetGlobal ( DatabaseInstance * db,
DBConfig & config,
const Value & parameter )
static
301546 {
301547 if (!Settings::Get<EnableExternalAccessSetting>(config)) {
301548 throw InvalidInputException("Cannot change allowed_directories when enable_external_access is disabled");
301549 }
301550 if (!config.file_system) {
301551 throw InvalidInputException("Cannot change/set allowed_directories before the database is started");
301552 }
301553 config.options.allowed_directories.clear();
301554 auto &list = ListValue::GetChildren(input);
301555 for (auto &val : list) {
301556 config.AddAllowedDirectory(val.GetValue<string>());
301557 }
301558}
set< string > allowed_directories
Directories that are explicitly allowed, even if enable_external_access is false.
Definition duckdb.hpp:40056
unique_ptr< FileSystem > file_system
The FileSystem to use, can be overwritten to allow for injecting custom file systems for testing purp...
Definition duckdb.hpp:40082
DBConfigOptions options
Database configuration options.
Definition duckdb.hpp:40090

◆ ResetGlobal()

void duckdb::AllowedDirectoriesSetting::ResetGlobal ( DatabaseInstance * db,
DBConfig & config )
static
301560 {
301561 if (!Settings::Get<EnableExternalAccessSetting>(config)) {
301562 throw InvalidInputException("Cannot change allowed_directories when enable_external_access is disabled");
301563 }
301564 config.options.allowed_directories = DBConfigOptions().allowed_directories;
301565}

◆ GetSetting()

Value duckdb::AllowedDirectoriesSetting::GetSetting ( const ClientContext & context)
static
301567 {
301568 auto &config = DBConfig::GetConfig(context);
301569 vector<Value> allowed_directories;
301570 for (auto &dir : config.options.allowed_directories) {
301571 allowed_directories.emplace_back(dir);
301572 }
301573 return Value::LIST(LogicalType::VARCHAR, std::move(allowed_directories));
301574}
static DUCKDB_API Value LIST(const LogicalType &child_type, vector< Value > values)
Create a list value with the given entries.
Definition duckdb.cpp:132555

Member Data Documentation

◆ Description

const char* duckdb::AllowedDirectoriesSetting::Description
staticconstexpr
Initial value:
= "List of directories/prefixes that are ALWAYS allowed to be queried - "
"even when enable_external_access is false"

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