277153 {
277154 config.options = new_config.options;
277155 config.user_settings = new_config.user_settings;
277156
277157 if (Settings::Get<DuckDBAPISetting>(*this).empty()) {
277158 config.SetOptionByName("duckdb_api", "cpp");
277159 }
277160
277161 if (database_path) {
277162 config.options.database_path = database_path;
277163 } else {
277164 config.options.database_path.clear();
277165 }
277166
277167 if (new_config.options.temporary_directory.empty()) {
277168 config.SetDefaultTempDirectory();
277169 }
277170
277171 if (config.options.access_mode == AccessMode::UNDEFINED) {
277172 config.options.access_mode = AccessMode::READ_WRITE;
277173 }
277174 if (new_config.file_system) {
277175 config.file_system = std::move(new_config.file_system);
277176 } else {
277178 }
277179 if (database_path && !Settings::Get<EnableExternalAccessSetting>(*this)) {
277180 config.AddAllowedPath(database_path);
277181 config.AddAllowedPath(database_path + string(".wal"));
277182 config.AddAllowedPath(database_path + string(".wal.checkpoint"));
277183 config.AddAllowedPath(database_path + string(".wal.recovery"));
277184 if (!config.options.temporary_directory.empty()) {
277185 config.AddAllowedDirectory(config.options.temporary_directory);
277186 }
277187 }
277188 if (new_config.secret_manager) {
277189 config.secret_manager = std::move(new_config.secret_manager);
277190 }
277192 config.SetDefaultMaxMemory();
277193 }
277195 config.options.maximum_threads = config.GetSystemMaxThreads(*config.file_system);
277196 }
277197 config.allocator = std::move(new_config.allocator);
277198 if (!config.allocator) {
277199 config.allocator = make_uniq<Allocator>();
277200 }
277201 config.block_allocator = std::move(new_config.block_allocator);
277202 if (!config.block_allocator) {
277203 auto default_block_size = Settings::Get<DefaultBlockSizeSetting>(config);
277204 config.block_allocator = make_uniq<BlockAllocator>(
277205 *config.allocator, default_block_size, DBConfig::GetSystemAvailableMemory(*config.file_system) * 8 / 10,
277206 config.options.block_allocator_size);
277207 }
277208 config.replacement_scans = std::move(new_config.replacement_scans);
277209 if (new_config.callback_manager) {
277210 config.callback_manager = std::move(new_config.callback_manager);
277211 new_config.callback_manager = make_uniq<ExtensionCallbackManager>();
277212 }
277213
277214 config.callback_manager->Register("__open_file__", OpenFileStorageExtension::Create());
277215
277216 config.error_manager = std::move(new_config.error_manager);
277217 if (!config.error_manager) {
277218 config.error_manager = make_uniq<ErrorManager>();
277219 }
277220 if (!config.default_allocator) {
277221 config.default_allocator = Allocator::DefaultAllocatorReference();
277222 }
277223 if (new_config.buffer_pool) {
277224 config.buffer_pool = std::move(new_config.buffer_pool);
277225 } else {
277226 config.buffer_pool = make_shared_ptr<BufferPool>(*config.block_allocator, config.options.maximum_memory,
277227 config.options.buffer_manager_track_eviction_timestamps,
277228 config.options.allocator_bulk_deallocation_flush_threshold);
277229 }
277230 config.db_cache_entry = std::move(new_config.db_cache_entry);
277231 config.path_manager = std::move(new_config.path_manager);
277232}
static DUCKDB_API unique_ptr< FileSystem > CreateLocal()
Create a LocalFileSystem.
Definition duckdb.cpp:80214
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117