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

Public Member Functions

DUCKDB_API DBConfig (bool read_only)
 
DUCKDB_API DBConfig (const case_insensitive_map_t< Value > &config_dict, bool read_only)
 
DUCKDB_API void AddExtensionOption (const string &name, string description, LogicalType parameter, const Value &default_value=Value(), set_option_callback_t function=nullptr, SetScope default_scope=SetScope::SESSION)
 
DUCKDB_API bool HasExtensionOption (const string &name) const
 
DUCKDB_API case_insensitive_map_t< ExtensionOptionGetExtensionSettings () const
 
DUCKDB_API bool TryGetExtensionOption (const String &name, ExtensionOption &result) const
 
DUCKDB_API void SetOption (const ConfigurationOption &option, const Value &value)
 
DUCKDB_API void SetOption (optional_ptr< DatabaseInstance > db, const ConfigurationOption &option, const Value &value)
 
DUCKDB_API void SetOption (const string &name, Value value)
 
DUCKDB_API void SetOption (idx_t setting_index, Value value)
 
DUCKDB_API void SetOptionByName (const string &name, const Value &value)
 
DUCKDB_API void SetOptionsByName (const case_insensitive_map_t< Value > &values)
 
DUCKDB_API void ResetOption (optional_ptr< DatabaseInstance > db, const ConfigurationOption &option)
 
DUCKDB_API void ResetOption (const ExtensionOption &extension_option)
 
DUCKDB_API void ResetGenericOption (idx_t setting_index)
 
DUCKDB_API optional_idx TryGetSettingIndex (const String &name, optional_ptr< const ConfigurationOption > &option) const
 
DUCKDB_API void CheckLock (const String &name)
 
DUCKDB_API vector< reference< const CompressionFunction > > GetCompressionFunctions (const PhysicalType physical_type) const
 Returns the list of possible compression functions for the physical type.
 
DUCKDB_API reference< const CompressionFunctionGetCompressionFunction (CompressionType type, const PhysicalType physical_type) const
 
DUCKDB_API optional_ptr< const CompressionFunctionTryGetCompressionFunction (CompressionType type, const PhysicalType physical_type) const
 
DUCKDB_API void SetDisabledCompressionMethods (const vector< CompressionType > &disabled_compression_methods)
 Sets the disabled compression methods.
 
DUCKDB_API vector< CompressionType > GetDisabledCompressionMethods () const
 Returns a list of disabled compression methods.
 
DUCKDB_API optional_ptr< EncodingFunctionGetEncodeFunction (const string &name) const
 Returns the encode function matching the encoding name.
 
DUCKDB_API void RegisterEncodeFunction (const EncodingFunction &function) const
 
DUCKDB_API vector< reference< EncodingFunction > > GetLoadedEncodedFunctions () const
 Returns the encode function names.
 
DUCKDB_API ArrowTypeExtension GetArrowExtension (ArrowExtensionMetadata info) const
 Returns the encode function matching the encoding name.
 
DUCKDB_API ArrowTypeExtension GetArrowExtension (const LogicalType &type) const
 
DUCKDB_API bool HasArrowExtension (const LogicalType &type) const
 
DUCKDB_API bool HasArrowExtension (ArrowExtensionMetadata info) const
 
DUCKDB_API void RegisterArrowExtension (const ArrowTypeExtension &extension) const
 
bool operator== (const DBConfig &other)
 
bool operator!= (const DBConfig &other)
 
DUCKDB_API CastFunctionSetGetCastFunctions ()
 
DUCKDB_API TypeManagerGetTypeManager ()
 
DUCKDB_API CollationBindingGetCollationBinding ()
 
DUCKDB_API IndexTypeSetGetIndexTypes ()
 
void SetDefaultMaxMemory ()
 
void SetDefaultTempDirectory ()
 
OrderType ResolveOrder (ClientContext &context, OrderType order_type) const
 
OrderByNullType ResolveNullOrder (ClientContext &context, OrderType order_type, OrderByNullType null_type) const
 
const string UserAgent () const
 
SettingLookupResult TryGetCurrentSetting (const string &key, Value &result) const
 Returns the value of a setting currently. If the setting is not set by the user, returns the default value.
 
SettingLookupResult TryGetCurrentUserSetting (idx_t setting_index, Value &result) const
 Returns the value of a setting set by the user currently.
 
bool CanAccessFile (const string &path, FileType type)
 
void AddAllowedConfig (const string &config_name)
 
void AddAllowedDirectory (const string &path)
 
void AddAllowedPath (const string &path)
 
string SanitizeAllowedPath (const string &path) const
 
ExtensionCallbackManagerGetCallbackManager ()
 
const ExtensionCallbackManagerGetCallbackManager () const
 
void SetHTTPUtil (const shared_ptr< HTTPUtil > &new_http_util)
 
HTTPUtilGetHTTPUtil () const
 

Static Public Member Functions

static DUCKDB_API DBConfigGetConfig (ClientContext &context)
 
static DUCKDB_API DBConfigGetConfig (DatabaseInstance &db)
 
static DUCKDB_API DBConfigGet (AttachedDatabase &db)
 
static DUCKDB_API const DBConfigGetConfig (const ClientContext &context)
 
static DUCKDB_API const DBConfigGetConfig (const DatabaseInstance &db)
 
static DUCKDB_API vector< ConfigurationOptionGetOptions ()
 
static DUCKDB_API vector< ConfigurationAliasGetAliases ()
 
static DUCKDB_API idx_t GetOptionCount ()
 
static DUCKDB_API idx_t GetAliasCount ()
 
static DUCKDB_API vector< string > GetOptionNames ()
 
static DUCKDB_API bool IsInMemoryDatabase (const char *database_path)
 
static DUCKDB_API optional_ptr< const ConfigurationOptionGetOptionByIndex (idx_t index)
 Fetch an option by index. Returns a pointer to the option, or nullptr if out of range.
 
static DUCKDB_API optional_ptr< const ConfigurationAliasGetAliasByIndex (idx_t index)
 Fetcha n alias by index, or nullptr if out of range.
 
static DUCKDB_API optional_ptr< const ConfigurationOptionGetOptionByName (const String &name)
 Fetch an option by name. Returns a pointer to the option, or nullptr if none exists.
 
static LogicalType ParseLogicalType (const string &type)
 
static DUCKDB_API idx_t ParseMemoryLimit (const string &arg)
 
static idx_t GetSystemMaxThreads (FileSystem &fs)
 
static idx_t GetSystemAvailableMemory (FileSystem &fs)
 
static optional_idx ParseMemoryLimitSlurm (const string &arg)
 
static SettingLookupResult TryGetDefaultValue (optional_ptr< const ConfigurationOption > option, Value &result)
 Returns the default value of an option.
 

Public Attributes

vector< ReplacementScanreplacement_scans
 Replacement table scans are automatically attempted when a table name cannot be found in the schema.
 
unique_ptr< FileSystemfile_system
 
unique_ptr< SecretManager > secret_manager
 Secret manager.
 
unique_ptr< Allocatorallocator
 The allocator used by the system.
 
unique_ptr< BlockAllocatorblock_allocator
 The block allocator used by the system.
 
DBConfigOptions options
 Database configuration options.
 
unique_ptr< ErrorManagererror_manager
 Error manager.
 
shared_ptr< Allocatordefault_allocator
 A reference to the (shared) default allocator (Allocator::DefaultAllocator)
 
shared_ptr< BufferPool > buffer_pool
 A buffer pool can be shared across multiple databases (if desired).
 
shared_ptr< BufferManagerbuffer_manager
 Provide a custom buffer manager implementation (if desired).
 
shared_ptr< EncryptionUtilencryption_util
 Encryption Util for OpenSSL and MbedTLS.
 
shared_ptr< DatabaseCacheEntrydb_cache_entry
 Reference to the database cache entry (if any)
 
shared_ptr< DatabaseFilePathManagerpath_manager
 Reference to the database file path manager.
 
GlobalUserSettings user_settings
 Database configuration variables as controlled by SET.
 

Private Attributes

mutex config_lock
 
unique_ptr< CompressionFunctionSetcompression_functions
 
unique_ptr< EncodingFunctionSetencoding_functions
 
unique_ptr< ArrowTypeExtensionSetarrow_extensions
 
unique_ptr< TypeManagertype_manager
 
unique_ptr< CollationBindingcollation_bindings
 
unique_ptr< IndexTypeSetindex_types
 
unique_ptr< ExtensionCallbackManagercallback_manager
 
bool is_user_config = true
 
shared_ptr< HTTPUtilhttp_util
 HTTP Request utility functions.
 
vector< shared_ptr< HTTPUtil > > old_http_utils
 
mutex http_util_lock
 

Friends

class DatabaseInstance
 
class StorageManager
 

Member Function Documentation

◆ GetCompressionFunction()

DUCKDB_API reference< const CompressionFunction > duckdb::DBConfig::GetCompressionFunction ( CompressionType  type,
const PhysicalType  physical_type 
) const

Returns the compression function matching the compression and physical type. Throws an error if the function does not exist.

◆ GetArrowExtension() [1/2]

ArrowTypeExtension duckdb::DBConfig::GetArrowExtension ( ArrowExtensionMetadata  info) const

Returns the encode function matching the encoding name.

45184 {
45185 lock_guard<mutex> l(arrow_extensions->lock);
45186 return GetArrowExtensionInternal(arrow_extensions->type_extensions, std::move(info));
45187}

◆ GetArrowExtension() [2/2]

ArrowTypeExtension duckdb::DBConfig::GetArrowExtension ( const LogicalType type) const
45189 {
45190 lock_guard<mutex> l(arrow_extensions->lock);
45191 TypeInfo type_info(type);
45192 if (!arrow_extensions->type_to_info[type_info].empty()) {
45193 return GetArrowExtensionInternal(arrow_extensions->type_extensions,
45194 arrow_extensions->type_to_info[type_info].front());
45195 }
45196 type_info.type = LogicalTypeId::ANY;
45197 return GetArrowExtensionInternal(arrow_extensions->type_extensions,
45198 arrow_extensions->type_to_info[type_info].front());
45199}

◆ HasArrowExtension() [1/2]

bool duckdb::DBConfig::HasArrowExtension ( const LogicalType type) const
45201 {
45202 lock_guard<mutex> l(arrow_extensions->lock);
45203 TypeInfo type_info(type);
45204 if (!arrow_extensions->type_to_info[type_info].empty()) {
45205 return true;
45206 }
45207 type_info.type = LogicalTypeId::ANY;
45208 return !arrow_extensions->type_to_info[type_info].empty();
45209}

◆ HasArrowExtension() [2/2]

bool duckdb::DBConfig::HasArrowExtension ( ArrowExtensionMetadata  info) const
45211 {
45212 lock_guard<mutex> l(arrow_extensions->lock);
45213 auto type_extensions = arrow_extensions->type_extensions;
45214
45215 if (type_extensions.find(info) != type_extensions.end()) {
45216 return true;
45217 }
45218
45219 auto og_info = info;
45220 info.SetArrowFormat("");
45221 if (type_extensions.find(info) != type_extensions.end()) {
45222 return true;
45223 }
45224
45225 return false;
45226}

◆ RegisterArrowExtension()

void duckdb::DBConfig::RegisterArrowExtension ( const ArrowTypeExtension extension) const
45153 {
45154 lock_guard<mutex> l(arrow_extensions->lock);
45155 auto extension_info = extension.GetInfo();
45156 if (arrow_extensions->type_extensions.find(extension_info) != arrow_extensions->type_extensions.end()) {
45157 throw NotImplementedException("Arrow Extension with configuration %s is already registered",
45158 extension_info.ToString());
45159 }
45160 arrow_extensions->type_extensions[extension_info] = extension;
45161 if (extension.HasType()) {
45162 const TypeInfo type_info(extension.GetLogicalType());
45163 arrow_extensions->type_to_info[type_info].push_back(extension_info);
45164 return;
45165 }
45166 const TypeInfo type_info(extension.GetInfo().GetExtensionName());
45167 arrow_extensions->type_to_info[type_info].push_back(extension_info);
45168}

Member Data Documentation

◆ file_system

unique_ptr<FileSystem> duckdb::DBConfig::file_system

The FileSystem to use, can be overwritten to allow for injecting custom file systems for testing purposes (e.g. RamFS or something similar)


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