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::AllowedPathsSetting 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_paths"
static constexpr const char * Description
static constexpr const char * InputType = "VARCHAR[]"

Member Function Documentation

◆ SetGlobal()

void duckdb::AllowedPathsSetting::SetGlobal ( DatabaseInstance * db,
DBConfig & config,
const Value & parameter )
static
301579 {
301580 if (!Settings::Get<EnableExternalAccessSetting>(config)) {
301581 throw InvalidInputException("Cannot change allowed_paths when enable_external_access is disabled");
301582 }
301583 if (!config.file_system) {
301584 throw InvalidInputException("Cannot change/set allowed_paths before the database is started");
301585 }
301586
301587 config.options.allowed_paths.clear();
301588 auto &list = ListValue::GetChildren(input);
301589 for (auto &val : list) {
301590 config.AddAllowedPath(val.GetValue<string>());
301591 }
301592}
unordered_set< string > allowed_paths
Paths that are explicitly allowed, even if enable_external_access is false.
Definition duckdb.hpp:40054
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::AllowedPathsSetting::ResetGlobal ( DatabaseInstance * db,
DBConfig & config )
static
301594 {
301595 if (!Settings::Get<EnableExternalAccessSetting>(config)) {
301596 throw InvalidInputException("Cannot change allowed_paths when enable_external_access is disabled");
301597 }
301598 config.options.allowed_paths = DBConfigOptions().allowed_paths;
301599}

◆ GetSetting()

Value duckdb::AllowedPathsSetting::GetSetting ( const ClientContext & context)
static
301601 {
301602 auto &config = DBConfig::GetConfig(context);
301603 vector<Value> allowed_paths;
301604 for (auto &dir : config.options.allowed_paths) {
301605 allowed_paths.emplace_back(dir);
301606 }
301607 return Value::LIST(LogicalType::VARCHAR, std::move(allowed_paths));
301608}
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::AllowedPathsSetting::Description
staticconstexpr
Initial value:
=
"List of files 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: