Skip to content
Merged
Show file tree
Hide file tree
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
81 changes: 81 additions & 0 deletions .github/workflows/DuckDBNodeBindingsAndAPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ on:
type: boolean
required: true
default: false
windows_arm64:
description: 'Run on Windows arm64'
type: boolean
required: true
default: false
# publish_win32_arm64:
# description: 'Publish Bindings for Win32 arm64'
# type: boolean
# required: true
# default: false
windows_x64:
description: 'Run on Windows x64'
type: boolean
Expand Down Expand Up @@ -359,3 +369,74 @@ jobs:
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-win32-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest

windows_arm64:
name: Windows arm64
runs-on: windows-11-arm
permissions:
contents: read
id-token: write # for OIDC, for trusted publishing
if: ${{ github.event_name != 'workflow_dispatch' || inputs.windows_arm64 }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v6
with:
node-version: 24

- name: Record Node directory
shell: bash
run: echo "NODE_DIR=C:\\a\\node-v24.10.0" >> "$GITHUB_ENV"

- name: Cache Node directory
id: cache-node-dir
uses: actions/cache@v4
with:
path: C:\\a\\node-v24.10.0
key: node-dir-v24.10.0-win-arm64

- name: Download Node headers
if: steps.cache-node-dir.outputs.cache-hit != 'true'
shell: bash
run: curl -sSL "https://nodejs.org/download/release/v24.10.0/node-v24.10.0-headers.tar.gz" -o "C:/a/node-v24.10.0-headers.tar.gz"

- name: Extract Node headers
if: steps.cache-node-dir.outputs.cache-hit != 'true'
run: tar -xzf C:\a\node-v24.10.0-headers.tar.gz -C C:\a

- name: Download Node lib
if: steps.cache-node-dir.outputs.cache-hit != 'true'
shell: bash
run: curl -sSL "https://nodejs.org/download/release/v24.10.0/win-arm64/node.lib" --create-dirs -o "$NODE_DIR/Release/node.lib"

- uses: pnpm/action-setup@v3
with:
version: 9

- name: Workspace - Install
run: pnpm install --ignore-scripts

- name: Bindings - Build
working-directory: bindings
run: pnpm run build

- name: Bindings - Test
working-directory: bindings
run: pnpm test

- name: API - Build
working-directory: api
run: pnpm run build

- name: API - Test
working-directory: api
run: pnpm test

- name: Git Status
if: ${{ inputs.publish }}
run: git status

- name: Publish - Bindings - Win32 arm64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-win32-arm64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [@duckdb/node-bindings-darwin-x64](bindings/pkgs/@duckdb/node-bindings-darwin-x64/README.md)
- [@duckdb/node-bindings-linux-arm64](bindings/pkgs/@duckdb/node-bindings-linux-arm64/README.md)
- [@duckdb/node-bindings-linux-x64](bindings/pkgs/@duckdb/node-bindings-linux-x64/README.md)
- [@duckdb/node-bindings-win32-arm64](bindings/pkgs/@duckdb/node-bindings-win32-arm64/README.md)
- [@duckdb/node-bindings-win32-x64](bindings/pkgs/@duckdb/node-bindings-win32-x64/README.md)

### Published
Expand All @@ -22,6 +23,7 @@
- [@duckdb/node-bindings-darwin-x64](https://www.npmjs.com/package/@duckdb/node-bindings-darwin-x64)
- [@duckdb/node-bindings-linux-arm64](https://www.npmjs.com/package/@duckdb/node-bindings-linux-arm64)
- [@duckdb/node-bindings-linux-x64](https://www.npmjs.com/package/@duckdb/node-bindings-linux-x64)
- [@duckdb/node-bindings-win32-arm64](https://www.npmjs.com/package/@duckdb/node-bindings-win32-arm64)
- [@duckdb/node-bindings-win32-x64](https://www.npmjs.com/package/@duckdb/node-bindings-win32-x64)

## Development
Expand Down Expand Up @@ -53,6 +55,7 @@ Change version in:
- `bindings/pkgs/@duckdb/node-bindings-darwin-x64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-linux-arm64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-linux-x64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-win32-arm64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-win32-x64/package.json`

### Upgrade DuckDB Version
Expand All @@ -62,6 +65,7 @@ Change version in:
- `bindings/scripts/fetch_libduckdb_linux_arm64.py`
- `bindings/scripts/fetch_libduckdb_osx_universal.py`
- `bindings/scripts/fetch_libduckdb_windows_amd64.py`
- `bindings/scripts/fetch_libduckdb_windows_arm64.py`
- `bindings/test/constants.test.ts`

Also change DuckDB version in package versions.
Expand Down
26 changes: 26 additions & 0 deletions bindings/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
'script_path': '<(module_root_dir)/scripts/fetch_libduckdb_osx_universal.py',
},
}],
['OS=="win" and target_arch=="arm64"', {
'variables': {
'script_path': '<(module_root_dir)/scripts/fetch_libduckdb_windows_arm64.py',
},
}],
['OS=="win" and target_arch=="x64"', {
'variables': {
'script_path': '<(module_root_dir)/scripts/fetch_libduckdb_windows_amd64.py',
Expand Down Expand Up @@ -112,6 +117,19 @@
},
],
}],
['OS=="win" and target_arch=="arm64"', {
'link_settings': {
'libraries': [
'<(module_root_dir)/libduckdb/duckdb.lib',
],
},
'copies': [
{
'files': ['<(module_root_dir)/libduckdb/duckdb.dll'],
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-win32-arm64',
},
],
}],
['OS=="win" and target_arch=="x64"', {
'link_settings': {
'libraries': [
Expand Down Expand Up @@ -164,6 +182,14 @@
},
],
}],
['OS=="win" and target_arch=="arm64"', {
'copies': [
{
'files': ['<(module_root_dir)/build/Release/duckdb.node'],
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-win32-arm64',
},
],
}],
['OS=="win" and target_arch=="x64"', {
'copies': [
{
Expand Down
15 changes: 15 additions & 0 deletions bindings/pkgs/@duckdb/node-bindings-win32-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@duckdb/node-bindings-win32-arm64",
"version": "1.4.4-r.2",
"license": "MIT",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"repository": {
"type": "git",
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
2 changes: 2 additions & 0 deletions bindings/pkgs/@duckdb/node-bindings/duckdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const getNativeNodeBinding = (runtimePlatformArch) => {
return require('@duckdb/node-bindings-darwin-arm64/duckdb.node');
case 'darwin-x64':
return require('@duckdb/node-bindings-darwin-x64/duckdb.node');
case 'win32-arm64':
return require('@duckdb/node-bindings-win32-arm64/duckdb.node');
case 'win32-x64':
return require('@duckdb/node-bindings-win32-x64/duckdb.node');
default:
Expand Down
1 change: 1 addition & 0 deletions bindings/pkgs/@duckdb/node-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@duckdb/node-bindings-darwin-x64": "workspace:*",
"@duckdb/node-bindings-linux-arm64": "workspace:*",
"@duckdb/node-bindings-linux-x64": "workspace:*",
"@duckdb/node-bindings-win32-arm64": "workspace:*",
"@duckdb/node-bindings-win32-x64": "workspace:*"
},
"repository": {
Expand Down
12 changes: 12 additions & 0 deletions bindings/scripts/fetch_libduckdb_windows_arm64.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
from fetch_libduckdb import fetch_libduckdb

zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.4.4/libduckdb-windows-arm64.zip"
output_dir = os.path.join(os.path.dirname(__file__), "..", "libduckdb")
files = [
"duckdb.h",
"duckdb.lib",
"duckdb.dll",
]

fetch_libduckdb(zip_url, output_dir, files)
5 changes: 5 additions & 0 deletions pnpm-lock.yaml

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