Skip to content

Commit

Permalink
use loadable extensions api (#17)
Browse files Browse the repository at this point in the history
adds support for duckdb 1.1.0
  • Loading branch information
0xcaff authored Sep 11, 2024
1 parent aaeaba8 commit 488cec7
Show file tree
Hide file tree
Showing 11 changed files with 21,004 additions and 68 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ jobs:
--input target/${{ matrix.target }}/release/${{ matrix.library_output }}
--output target/${{ matrix.target }}/release/protobuf.duckdb_extension
--extension-version v0.0.1
--duckdb-version v1.0.0
--duckdb-api-version v0.0.1
--extension-abi-type C_STRUCT
--platform ${{ matrix.duckdb_platform }}
- name: save artifacts
Expand Down Expand Up @@ -76,17 +77,17 @@ jobs:
aws s3 cp \
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
./release/protobuf.osx_arm64.duckdb_extension \
s3://duckdb-extensions/v1.0.0/osx_arm64/protobuf.duckdb_extension
s3://duckdb-extensions/v1.1.0/osx_arm64/protobuf.duckdb_extension
aws s3 cp \
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
./release/protobuf.linux_amd64_gcc4.duckdb_extension \
s3://duckdb-extensions/v1.0.0/linux_amd64_gcc4/protobuf.duckdb_extension
s3://duckdb-extensions/v1.1.0/linux_amd64_gcc4/protobuf.duckdb_extension
aws s3 cp \
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
./release/protobuf.windows_amd64.duckdb_extension \
s3://duckdb-extensions/v1.0.0/windows_amd64/protobuf.duckdb_extension
s3://duckdb-extensions/v1.1.0/windows_amd64/protobuf.duckdb_extension
- name: release
uses: softprops/action-gh-release@v2
Expand Down
116 changes: 78 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

DUCKDB_PLATFORM := osx_arm64
DUCKDB_EXTENSION_VERSION := v0.0.1
DUCKDB_VERSION := v1.0.0
DUCKDB_API_VERSION := v0.0.1

ifeq ($(DUCKDB_PLATFORM),windows_amd64)
LIBRARY_OUTPUT := duckdb_protobuf.dll
Expand All @@ -24,11 +24,13 @@ packages/vendor/duckdb:

packages/vendor/duckdb-loadable-macros:
mkdir -p packages/vendor/duckdb-loadable-macros
curl -L https://crates.io/api/v1/crates/duckdb-loadable-macros/0.1.1/download | tar --strip-components=1 -xz -C packages/vendor/duckdb-loadable-macros
curl -L https://crates.io/api/v1/crates/duckdb-loadable-macros/0.1.2/download | tar --strip-components=1 -xz -C packages/vendor/duckdb-loadable-macros
patch --strip=1 --directory=packages/vendor/duckdb-loadable-macros < patches/duckdb-loadable-macros+0.1.2.patch

packages/vendor/libduckdb-sys:
mkdir -p packages/vendor/libduckdb-sys
curl -L https://crates.io/api/v1/crates/libduckdb-sys/1.0.0/download | tar --strip-components=1 -xz -C packages/vendor/libduckdb-sys
patch --strip=1 --directory=packages/vendor/libduckdb-sys < patches/libduckdb-sys+1.0.0.patch

vendor: packages/vendor/duckdb packages/vendor/duckdb-loadable-macros packages/vendor/libduckdb-sys

Expand All @@ -41,8 +43,9 @@ debug: vendor
--input target/debug/$(LIBRARY_OUTPUT) \
--output target/debug/protobuf.duckdb_extension \
--extension-version $(DUCKDB_EXTENSION_VERSION) \
--duckdb-version $(DUCKDB_VERSION) \
--platform $(DUCKDB_PLATFORM)
--duckdb-api-version $(DUCKDB_API_VERSION) \
--platform $(DUCKDB_PLATFORM) \
--extension-abi-type C_STRUCT

release: vendor
cargo build --package duckdb_protobuf --release
Expand All @@ -53,8 +56,9 @@ release: vendor
--input target/release/$(LIBRARY_OUTPUT) \
--output target/release/protobuf.duckdb_extension \
--extension-version $(DUCKDB_EXTENSION_VERSION) \
--duckdb-version $(DUCKDB_VERSION) \
--platform $(DUCKDB_PLATFORM)
--duckdb-api-version $(DUCKDB_API_VERSION) \
--platform $(DUCKDB_PLATFORM) \
--extension-abi-type C_STRUCT

test: release
cargo test --package duckdb_protobuf
Expand Down
Loading

0 comments on commit 488cec7

Please sign in to comment.