Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/httpfs_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,6 @@

namespace duckdb {

static void SetHttpfsClientImplementation(DBConfig &config, const string &value) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks duplicate functionality with

auto callback_httpfs_client_implementation = [](ClientContext &context, SetScope scope, Value &parameter) {
auto &config = DBConfig::GetConfig(context);
string value = StringValue::Get(parameter);
if (config.http_util && config.http_util->GetName() == "WasmHTTPUtils") {
if (value == "wasm" || value == "default") {
return;
}
throw InvalidInputException("Unsupported option for httpfs_client_implementation, only `wasm` and "
"`default` are currently supported for duckdb-wasm");
}
#ifndef EMSCRIPTEN
if (value == "curl") {
if (!config.http_util || config.http_util->GetName() != "HTTPFSUtil-Curl") {
config.http_util = make_shared_ptr<HTTPFSCurlUtil>();
}
return;
}
if (value == "httplib" || value == "default") {
if (!config.http_util || config.http_util->GetName() != "HTTPFSUtil") {
config.http_util = make_shared_ptr<HTTPFSUtil>();
}
return;
}
#endif
throw InvalidInputException("Unsupported option for httpfs_client_implementation, only `curl`, `httplib` and "
"`default` are currently supported");
};

if (config.http_util && config.http_util->GetName() == "WasmHTTPUtils") {
if (value == "wasm" || value == "default") {
// Already handled, do not override
return;
}
throw InvalidInputException("Unsupported option for httpfs_client_implementation, only `wasm` and "
"`default` are currently supported for duckdb-wasm");
}
if (value == "httplib" || value == "default") {
if (!config.http_util || config.http_util->GetName() != "HTTPFSUtil") {
config.http_util = make_shared_ptr<HTTPFSUtil>();
}
return;
}
throw InvalidInputException("Unsupported option for httpfs_client_implementation, only `curl`, `httplib` and "
"`default` are currently supported");
}

static void LoadInternal(ExtensionLoader &loader) {
auto &instance = loader.GetDatabaseInstance();
auto &fs = instance.GetFileSystem();
Expand Down
Loading