-
Notifications
You must be signed in to change notification settings - Fork 179
feat(javascript): add Node.js ADBC driver manager #4046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kentkwu
wants to merge
21
commits into
apache:main
Choose a base branch
from
kentkwu:gh-3734
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,470
−2
Open
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 b506782
feat(javascript/driver-manager): add napi-rs package scaffold
kentkwu 54a377d
feat(javascript/driver-manager): add Rust implementation
kentkwu e9d8ddf
feat(javascript/driver-manager): add TypeScript ADBC wrapper
kentkwu 82169a8
test(javascript/driver-manager): add test suite
kentkwu c3b2717
ci(javascript/driver-manager): add build and packaging workflows
kentkwu 1dabdc3
fix: bump arrow dependency upper bound for arrow 58 compatibility
kentkwu 7f827a7
fix: address build PR feedback
kentkwu e50e0f6
fix: Rename node.yml to javascript.yml for consistency
kentkwu d1c19f0
fix: split lint into check:js and check:rust npm scripts
kentkwu 2ac124a
fix: add Windows testing steps
kentkwu 0ca3eba
fix: js build
kentkwu 4be2eec
fix: set driver paths for sqlite tests
kentkwu 52aaa27
fix: test lib driver path
kentkwu 63820f5
fix: test lib path for windows
kentkwu 12422f4
fix: use system sqlite for tests
kentkwu 9e690f3
fix: sqlite test lib path on windows
kentkwu 39b2e96
fix: sqlite test lib path on windows one more time
kentkwu f3e8dc7
refactor: propagate structured error fields
kentkwu c4ce87a
feat: add license.txt generation
kentkwu aa2fbe2
fix: license formatting
kentkwu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.