Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ff9a0c0
chore: add javascript workspace and repo-level configuration
kentkwu Mar 3, 2026
b506782
feat(javascript/driver-manager): add napi-rs package scaffold
kentkwu Mar 3, 2026
54a377d
feat(javascript/driver-manager): add Rust implementation
kentkwu Mar 3, 2026
e9d8ddf
feat(javascript/driver-manager): add TypeScript ADBC wrapper
kentkwu Mar 3, 2026
82169a8
test(javascript/driver-manager): add test suite
kentkwu Mar 3, 2026
c3b2717
ci(javascript/driver-manager): add build and packaging workflows
kentkwu Mar 3, 2026
1dabdc3
fix: bump arrow dependency upper bound for arrow 58 compatibility
kentkwu Mar 4, 2026
7f827a7
fix: address build PR feedback
kentkwu Mar 4, 2026
e50e0f6
fix: Rename node.yml to javascript.yml for consistency
kentkwu Mar 4, 2026
d1c19f0
fix: split lint into check:js and check:rust npm scripts
kentkwu Mar 4, 2026
2ac124a
fix: add Windows testing steps
kentkwu Mar 4, 2026
0ca3eba
fix: js build
kentkwu Mar 4, 2026
4be2eec
fix: set driver paths for sqlite tests
kentkwu Mar 4, 2026
52aaa27
fix: test lib driver path
kentkwu Mar 4, 2026
63820f5
fix: test lib path for windows
kentkwu Mar 4, 2026
12422f4
fix: use system sqlite for tests
kentkwu Mar 4, 2026
9e690f3
fix: sqlite test lib path on windows
kentkwu Mar 4, 2026
39b2e96
fix: sqlite test lib path on windows one more time
kentkwu Mar 4, 2026
f3e8dc7
refactor: propagate structured error fields
kentkwu Mar 5, 2026
c4ce87a
feat: add license.txt generation
kentkwu Mar 5, 2026
aa2fbe2
fix: license formatting
kentkwu Mar 5, 2026
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
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
[codespell]
dictionary = .codespell-dictionary,-
ignore-words = .codespell-ignore
skip = go/adbc/go.sum
skip = go/adbc/go.sum,javascript/package-lock.json
200 changes: 200 additions & 0 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: JavaScript

env:
DEBUG: napi:*
APP_NAME: adbc-driver-manager
MACOSX_DEPLOYMENT_TARGET: '10.15'
CARGO_INCREMENTAL: '1'

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'javascript/**'
- 'rust/**'
- '.github/workflows/javascript.yml'
pull_request:
paths:
- 'javascript/**'
- 'rust/**'
- '.github/workflows/javascript.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: Use stable Rust
run: |
rustup toolchain install stable --no-self-update
rustup default stable
rustup component add clippy rustfmt
- name: Install dependencies
working-directory: javascript
run: npm ci
- name: Check JS
working-directory: javascript
run: npm run check:js
- name: Check Rust
working-directory: javascript
run: npm run check:rust

build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-15-intel
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
- host: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
name: Build Node.js ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: Use stable Rust
run: |
rustup toolchain install stable --no-self-update
rustup default stable
rustup target add ${{ matrix.settings.target }}
- name: Install dependencies
working-directory: javascript
run: npm ci
- name: Build
working-directory: javascript
shell: bash
run: |
npx napi build --platform --release --target ${{ matrix.settings.target }}
mv index.js binding.js
mv index.d.ts binding.d.ts
npx tsc
- name: Ad-hoc sign binary (macOS)
if: runner.os == 'macOS'
working-directory: javascript
run: codesign --sign - *.node
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: javascript/*.node
if-no-files-found: error

test:
name: Test ${{ matrix.settings.target }}
needs: build
runs-on: ${{ matrix.settings.host }}
strategy:
fail-fast: false
matrix:
settings:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
- host: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- host: macos-15-intel
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: Install dependencies
working-directory: javascript
run: npm ci --omit=optional
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: javascript
- name: Setup conda (Windows)
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
with:
miniforge-version: latest
- name: Install C++ dependencies (Windows)
if: runner.os == 'Windows'
run: conda install -c conda-forge --file ci/conda_env_cpp.txt
- name: Install C++ dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install libsqlite3-dev
- name: Set cmake args (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: echo "ADBC_CMAKE_ARGS=-DCMAKE_PREFIX_PATH=$env:CONDA_PREFIX/Library" >> $env:GITHUB_ENV
- name: Build Driver
# We need to build the SQLite driver for tests.
shell: bash
run: ci/scripts/node_build.sh "${{ github.workspace }}/javascript/build"
- name: Set driver path (Linux)
if: runner.os == 'Linux'
run: echo "ADBC_DRIVER_MANAGER_TEST_LIB=${{ github.workspace }}/javascript/build/lib/libadbc_driver_sqlite.so" >> "$GITHUB_ENV"
- name: Set driver path (macOS)
if: runner.os == 'macOS'
run: echo "ADBC_DRIVER_MANAGER_TEST_LIB=${{ github.workspace }}/javascript/build/lib/libadbc_driver_sqlite.dylib" >> "$GITHUB_ENV"
- name: Set driver path (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
echo "PATH=${{ github.workspace }}/javascript/build/bin;$env:CONDA_PREFIX\Library\bin;$env:PATH" >> $env:GITHUB_ENV
echo "ADBC_DRIVER_MANAGER_TEST_LIB=${{ github.workspace }}/javascript/build/bin/adbc_driver_sqlite.dll" >> $env:GITHUB_ENV
- name: Run Tests
working-directory: javascript
run: npm test
134 changes: 134 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,136 @@ jobs:
docker compose run python-sdist-test
popd

node-binaries:
name: "Node.js ${{ matrix.settings.target }}"
runs-on: ${{ matrix.settings.host }}
needs:
- source
strategy:
fail-fast: false
matrix:
settings:
- host: macos-15-intel
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
- host: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/download-artifact@v6
with:
name: source

- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}

tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: adbc/javascript/package-lock.json

- name: Setup Rust
run: |
rustup toolchain install stable --no-self-update
rustup default stable
rustup target add ${{ matrix.settings.target }}

- name: Install Node dependencies
working-directory: adbc/javascript
run: npm ci

- name: Build Node.js binaries
working-directory: adbc/javascript
run: npx napi build --platform --release --target ${{ matrix.settings.target }}
shell: bash

- name: Sign binary (macOS)
if: runner.os == 'macOS'
working-directory: adbc/javascript
run: codesign --sign - *.node

- name: Upload Node.js binaries
uses: actions/upload-artifact@v5
with:
name: bindings-${{ matrix.settings.target }}
path: adbc/javascript/*.node
if-no-files-found: error

node-dist:
name: "Node.js Package"
runs-on: ubuntu-latest
needs:
- source
- node-binaries
steps:
- uses: actions/download-artifact@v6
with:
name: source

- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}

tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: adbc/javascript/package-lock.json

- name: Install Node dependencies
working-directory: adbc/javascript
run: npm ci

- name: Build Node.js JS
working-directory: adbc/javascript
run: npm run build:ts

- name: Download Node.js binaries
uses: actions/download-artifact@v6
with:
pattern: bindings-*
path: adbc/javascript/artifacts
merge-multiple: true

- name: Package Node.js artifacts
working-directory: adbc/javascript
env:
HUSKY: "0"
run: |
npx napi artifacts
# Pack the main package
npm pack
# Pack the platform-specific packages
for dir in npm/*; do
npm pack "./$dir"
done

- name: Upload Node.js packages
uses: actions/upload-artifact@v5
with:
name: node-packages
retention-days: 7
path: |
adbc/javascript/*.tgz

release:
name: "Create release"
runs-on: ubuntu-latest
Expand All @@ -1106,6 +1236,7 @@ jobs:
- source
- java
- linux
- node-dist
- python-manylinux
- python-macos
- python-windows
Expand Down Expand Up @@ -1140,6 +1271,9 @@ jobs:
')' \
-exec mv '{}' upload-staging \;

# Handle Node.js packages (in tarball form)
find ./release-artifacts/ -name 'adbc-driver-manager-*.tgz' -exec mv '{}' upload-staging \;

UPLOAD=$(find upload-staging -type f | sort | uniq)

echo "Uploading files:" >> $GITHUB_STEP_SUMMARY
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,10 @@ target/
# Meson subproject support
/c/subprojects/*
!/c/subprojects/*.wrap

# Node.js specific ignores
javascript/**/node_modules/
javascript/**/target/
javascript/**/dist/
javascript/native/*.node
javascript/native/build/
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ repos:
hooks:
- id: fmt
name: rustfmt
files: ^rust/
args: ["--all", "--manifest-path", "rust/Cargo.toml", "--"]
- id: fmt
name: rustfmt-node
files: ^javascript/
args: ["--all", "--manifest-path", "javascript/Cargo.toml", "--"]
- repo: https://github.com/codespell-project/codespell
rev: 63c8f8312b7559622c0d82815639671ae42132ac # v2.4.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion c/driver/sqlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if(EXISTS "${SQLite3_INCLUDE_DIRS}/sqlite3.h")
ADBC_SQLITE_WITH_LOAD_EXTENSION)
endif()

if(NOT ADBC_SQLITE_WITH_LOAD_EXTENSION)
if(ADBC_SQLITE_WITH_LOAD_EXTENSION EQUAL -1)
set(ADBC_SQLITE_COMPILE_DEFINES "-DADBC_SQLITE_WITH_NO_LOAD_EXTENSION")
endif()

Expand Down
Loading
Loading