diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 97de458..73dd16e 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' && github.sha || '' }} cancel-in-progress: true jobs: @@ -26,7 +26,7 @@ jobs: name: Build extension binaries uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main with: - duckdb_version: main + duckdb_version: v1.4-andium ci_tools_version: main extension_name: http_client exclude_archs: "windows_amd64_mingw" diff --git a/duckdb b/duckdb index 0b83e5d..f6b2306 160000 --- a/duckdb +++ b/duckdb @@ -1 +1 @@ -Subproject commit 0b83e5d2f68bc02dfefde74b846bd039f078affa +Subproject commit f6b2306dfd7368bfc61bee6ca6f42d0c4b269b65 diff --git a/extension-ci-tools b/extension-ci-tools index 929896d..86306f4 160000 --- a/extension-ci-tools +++ b/extension-ci-tools @@ -1 +1 @@ -Subproject commit 929896d8132ed0a3b376722380b38ea023505bd4 +Subproject commit 86306f45100210a75d1633521d83ebd1f640e960 diff --git a/src/http_client_extension.cpp b/src/http_client_extension.cpp index c0a3dbb..4af7a5d 100644 --- a/src/http_client_extension.cpp +++ b/src/http_client_extension.cpp @@ -4,7 +4,6 @@ #include "duckdb/common/types.hpp" #include "duckdb/common/vector_operations/generic_executor.hpp" #include "duckdb/function/scalar_function.hpp" -#include "duckdb/main/extension_util.hpp" #include "duckdb/common/atomic.hpp" #include "duckdb/common/exception/http_exception.hpp" #include @@ -359,10 +358,10 @@ static void HTTPPostFormRequestFunction(DataChunk &args, ExpressionState &state, } -static void LoadInternal(DatabaseInstance &instance) { +static void LoadInternal(ExtensionLoader &loader) { ScalarFunctionSet http_head("http_head"); http_head.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::JSON(), HTTPHeadRequestFunction)); - ExtensionUtil::RegisterFunction(instance, http_head); + loader.RegisterFunction(http_head); ScalarFunctionSet http_get("http_get"); http_get.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::JSON(), HTTPGetRequestFunction)); @@ -370,24 +369,24 @@ static void LoadInternal(DatabaseInstance &instance) { {LogicalType::VARCHAR, LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR), LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)}, LogicalType::JSON(), HTTPGetExRequestFunction)); - ExtensionUtil::RegisterFunction(instance, http_get); + loader.RegisterFunction(http_get); ScalarFunctionSet http_post("http_post"); http_post.AddFunction(ScalarFunction( {LogicalType::VARCHAR, LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR), LogicalType::JSON()}, LogicalType::JSON(), HTTPPostRequestFunction)); - ExtensionUtil::RegisterFunction(instance, http_post); + loader.RegisterFunction(http_post); ScalarFunctionSet http_post_form("http_post_form"); http_post_form.AddFunction(ScalarFunction( {LogicalType::VARCHAR, LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR), LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)}, LogicalType::JSON(), HTTPPostFormRequestFunction)); - ExtensionUtil::RegisterFunction(instance, http_post_form); + loader.RegisterFunction(http_post_form); } -void HttpClientExtension::Load(DuckDB &db) { - LoadInternal(*db.instance); +void HttpClientExtension::Load(ExtensionLoader &loader) { + LoadInternal(loader); } std::string HttpClientExtension::Name() { @@ -406,16 +405,8 @@ std::string HttpClientExtension::Version() const { } // namespace duckdb extern "C" { -DUCKDB_EXTENSION_API void http_client_init(duckdb::DatabaseInstance &db) { - duckdb::DuckDB db_wrapper(db); - db_wrapper.LoadExtension(); -} -DUCKDB_EXTENSION_API const char *http_client_version() { - return duckdb::DuckDB::LibraryVersion(); +DUCKDB_CPP_EXTENSION_ENTRY(http_client, loader) { + duckdb::LoadInternal(loader); } } - -#ifndef DUCKDB_EXTENSION_MAIN -#error DUCKDB_EXTENSION_MAIN not defined -#endif diff --git a/src/include/http_client_extension.hpp b/src/include/http_client_extension.hpp index d592819..b8ea68f 100644 --- a/src/include/http_client_extension.hpp +++ b/src/include/http_client_extension.hpp @@ -8,7 +8,7 @@ using HeaderMap = case_insensitive_map_t; class HttpClientExtension : public Extension { public: - void Load(DuckDB &db) override; + void Load(ExtensionLoader &loader) override; std::string Name() override; std::string Version() const override; diff --git a/src/include/http_functions.hpp b/src/include/http_functions.hpp index ea16407..e3bb147 100644 --- a/src/include/http_functions.hpp +++ b/src/include/http_functions.hpp @@ -6,13 +6,13 @@ namespace duckdb { struct HTTPFunctions { public: - static void Register(DatabaseInstance &db) { - RegisterHTTPRequestFunction(db); + static void Register(ExtensionLoader &loader) { + RegisterHTTPRequestFunction(loader); } private: //! Register HTTPRequest functions - static void RegisterHTTPRequestFunction(DatabaseInstance &db); + static void RegisterHTTPRequestFunction(ExtensionLoader &loader); }; } // namespace duckdb diff --git a/vcpkg.json b/vcpkg.json index 85936bf..dca393c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,13 @@ { - "dependencies": [ - "openssl" - ] + "dependencies": [ + "openssl" + ], + "vcpkg-configuration": { + "overlay-ports": [ + "./extension-ci-tools/vcpkg_ports" + ], + "overlay-triplets": [ + "./extension-ci-tools/toolchains" + ] + } } \ No newline at end of file