You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kentkwu (via GitHub)" <gi...@apache.org> on 2026/03/04 16:30:11 UTC

[PR] feat(javascript/adbc-driver-manager): Add JavaScript NAPI Driver Manager [arrow-adbc]

kentkwu opened a new pull request, #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046

   This PR introduces an ADBC Driver Manager for JavaScript.
   
   It is architected as a [Node-API](https://nodejs.org/api/n-api.html) native module that wraps the Rust ADBC Driver Manager via [NAPI-RS](https://napi.rs). This was chosen to leverage existing Arrow infrastructure in Rust and the mature Rust/JS FFI ecosystem.
   
   This means that the driver manager will run on Node (and bun, but currently untested).
   
   - Rust layer (src/): Wraps adbc_driver_manager crate.
     - Async operations are run on the libuv thread pool via [NAPI-RS AsyncTask](https://napi.rs/docs/concepts/async-task). Results cross the boundary as Arrow IPC streams
     - IPC is used as JS does not currently have a C Data Interface implementation. In the future, we can switch the driver manager to use the C Data Interface for true zero-copy once that is implemented
   - TypeScript layer (lib/)
     - JS Binding API with AdbcDatabase, AdbcConnection, AdbcStatement
   - Platform binaries are built for
     - linux-x64
     - linux-arm64
     - darwin-x64
     - darwin-arm64
     - win32-x64
   
   I've omitted final publishing to NPM in this PR. I will file a separate issue to set up publishing once this is merged.
   
   Closes #3734


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2884975035


##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt

Review Comment:
   Yes I'll make this match for consistency.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2887274917


##########
javascript/LICENSE.txt:
##########


Review Comment:
   I took a stab at this in https://github.com/apache/arrow-adbc/pull/4046/commits/c4ce87a749102c5d47c182fd06cd9b8bc859a9e8 ,using the [cargo-about](https://github.com/EmbarkStudios/cargo-about) crate to generate the license. Let me know if a different approach is preferred.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "eitsupi (via GitHub)" <gi...@apache.org>.
eitsupi commented on PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#issuecomment-4015600851

   The CI failure is unrelated to this change (see #4055).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2886923340


##########
javascript/lib/error.ts:
##########
@@ -0,0 +1,54 @@
+// 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.
+
+/**
+ * Structured error class for ADBC operations.
+ */
+export class AdbcError extends Error {
+  code: string
+  vendorCode?: number
+  sqlState?: string
+
+  constructor(message: string, code: string, vendorCode?: number, sqlState?: string) {
+    super(message)
+    this.name = 'AdbcError'
+    this.code = code
+    this.vendorCode = vendorCode
+    this.sqlState = sqlState
+  }
+
+  /**
+   * Parses a raw error message from the native binding into a structured AdbcError.
+   * Expected format: "[STATUS] Message (Vendor Code: X, SQL State: Y)"
+   *
+   * If the error does not match this specific format (e.g. it is a standard JS TypeError),
+   * the original error is returned unmodified.
+   */
+  static fromError(err: any): any {
+    if (err instanceof Error) {
+      // Regex to match: [Status] Message (Vendor Code: 123, SQL State: XYZ)
+      // Note: Message might contain parentheses, so we match strictly on the suffix.
+      const match = err.message.trim().match(/^\[(.*?)\] (.*) \(Vendor Code: (-?\d+), SQL State: (.*)\)$/s)

Review Comment:
   The error macro doesn't generate types for additional error fields, but yeah I agree this is unnecessarily fragile. I'll refactor the bindings to attach the fields manually and update the TS class to use them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2887243509


##########
javascript/lib/error.ts:
##########
@@ -0,0 +1,54 @@
+// 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.
+
+/**
+ * Structured error class for ADBC operations.
+ */
+export class AdbcError extends Error {
+  code: string
+  vendorCode?: number
+  sqlState?: string
+
+  constructor(message: string, code: string, vendorCode?: number, sqlState?: string) {
+    super(message)
+    this.name = 'AdbcError'
+    this.code = code
+    this.vendorCode = vendorCode
+    this.sqlState = sqlState
+  }
+
+  /**
+   * Parses a raw error message from the native binding into a structured AdbcError.
+   * Expected format: "[STATUS] Message (Vendor Code: X, SQL State: Y)"
+   *
+   * If the error does not match this specific format (e.g. it is a standard JS TypeError),
+   * the original error is returned unmodified.
+   */
+  static fromError(err: any): any {
+    if (err instanceof Error) {
+      // Regex to match: [Status] Message (Vendor Code: 123, SQL State: XYZ)
+      // Note: Message might contain parentheses, so we match strictly on the suffix.
+      const match = err.message.trim().match(/^\[(.*?)\] (.*) \(Vendor Code: (-?\d+), SQL State: (.*)\)$/s)

Review Comment:
   @lidavidm updated to thread through the ADBC error fields.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2885000180


##########
javascript/package.json:
##########
@@ -0,0 +1,88 @@
+{
+  "name": "adbc-driver-manager",
+  "version": "0.0.1",
+  "description": "Node.js ADBC Driver Manager",
+  "main": "dist/index.js",
+  "types": "dist/index.d.ts",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/apache/arrow-adbc.git",
+    "directory": "javascript"
+  },
+  "license": "Apache-2.0",
+  "keywords": [
+    "adbc",
+    "arrow",
+    "database",
+    "arrow-adbc"
+  ],
+  "files": [
+    "dist",
+    "binding.d.ts",
+    "binding.js"
+  ],
+  "napi": {
+    "binaryName": "adbc-driver-manager",
+    "targets": [
+      "x86_64-pc-windows-msvc",
+      "x86_64-apple-darwin",
+      "x86_64-unknown-linux-gnu",
+      "aarch64-unknown-linux-gnu",
+      "aarch64-apple-darwin"
+    ]
+  },
+  "engines": {
+    "node": ">=22.0.0"
+  },
+  "scripts": {
+    "artifacts": "napi artifacts",
+    "build": "napi build --platform --release && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc",
+    "build:debug": "napi build --platform && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc",
+    "build:ts": "tsc",
+    "build:driver": "../ci/scripts/node_build.sh $(pwd)/build",
+    "fix": "prettier . -w && oxlint . --fix",
+    "check": "prettier --check . && oxlint . && tsc --noEmit",
+    "test": "tsx --test __test__/*.spec.ts",
+    "preversion": "napi build --platform && git add .",
+    "version": "napi version",
+    "prepare": "husky"
+  },
+  "devDependencies": {
+    "@napi-rs/cli": "^3.2.0",
+    "@taplo/cli": "^0.7.0",
+    "tsx": "^4.0.0",
+    "husky": "^9.1.7",
+    "lint-staged": "^16.1.6",
+    "oxlint": "^1.14.0",
+    "prettier": "^3.6.2",
+    "typescript": "^5.9.2"
+  },
+  "lint-staged": {
+    "*.@(js|ts|tsx)": [
+      "oxlint --fix"
+    ],
+    "*.@(js|ts|tsx|yml|yaml|md|json)": [
+      "prettier --write"
+    ],
+    "*.toml": [
+      "taplo format"
+    ]
+  },
+  "prettier": {
+    "printWidth": 120,
+    "semi": false,
+    "trailingComma": "all",
+    "singleQuote": true,
+    "arrowParens": "always"
+  },
+  "peerDependencies": {
+    "apache-arrow": "^21.1.0"
+  },

Review Comment:
   what's the difference between `peerDependencies` and `dependencies`, I never quite understood that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2887247933


##########
javascript/LICENSE.txt:
##########


Review Comment:
   @lidavidm is there a recommended or idiomatic way to handle this for Rust crates?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2884994222


##########
javascript/README.md:
##########
@@ -0,0 +1,116 @@
+<!---
+  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.
+-->
+
+# Apache Arrow ADBC: Node.js Driver Manager
+
+Node.js bindings for the [Arrow Database Connectivity (ADBC)](https://arrow.apache.org/adbc/) standard.
+Built on a native [NAPI](https://nodejs.org/api/n-api.html) addon — requires Node.js 22+ and does not
+support browser or Deno environments. Bun is not officially tested.
+
+**Alpha: APIs may change without notice.**
+
+## Installation
+
+```bash
+npm install adbc-driver-manager apache-arrow

Review Comment:
   This is actually an issue with an implementation detail of the `arrow-js` library. It's specified as a peer dependency because arrow-js has issues if multiple copies are installed.
   
   It requires a deeper upstream fix.
   
   See:
   - https://github.com/duckdb/duckdb-wasm/issues/1761
   - https://github.com/apache/arrow-js/issues/56



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2886789693


##########
javascript/lib/error.ts:
##########
@@ -0,0 +1,54 @@
+// 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.
+
+/**
+ * Structured error class for ADBC operations.
+ */
+export class AdbcError extends Error {
+  code: string
+  vendorCode?: number
+  sqlState?: string
+
+  constructor(message: string, code: string, vendorCode?: number, sqlState?: string) {
+    super(message)
+    this.name = 'AdbcError'
+    this.code = code
+    this.vendorCode = vendorCode
+    this.sqlState = sqlState
+  }
+
+  /**
+   * Parses a raw error message from the native binding into a structured AdbcError.
+   * Expected format: "[STATUS] Message (Vendor Code: X, SQL State: Y)"
+   *
+   * If the error does not match this specific format (e.g. it is a standard JS TypeError),
+   * the original error is returned unmodified.
+   */
+  static fromError(err: any): any {
+    if (err instanceof Error) {
+      // Regex to match: [Status] Message (Vendor Code: 123, SQL State: XYZ)
+      // Note: Message might contain parentheses, so we match strictly on the suffix.
+      const match = err.message.trim().match(/^\[(.*?)\] (.*) \(Vendor Code: (-?\d+), SQL State: (.*)\)$/s)

Review Comment:
   Huh, the bindings don't expose the actual fields?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2885007736


##########
javascript/package.json:
##########
@@ -0,0 +1,88 @@
+{
+  "name": "adbc-driver-manager",
+  "version": "0.0.1",
+  "description": "Node.js ADBC Driver Manager",
+  "main": "dist/index.js",
+  "types": "dist/index.d.ts",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/apache/arrow-adbc.git",
+    "directory": "javascript"
+  },
+  "license": "Apache-2.0",
+  "keywords": [
+    "adbc",
+    "arrow",
+    "database",
+    "arrow-adbc"
+  ],
+  "files": [
+    "dist",
+    "binding.d.ts",
+    "binding.js"
+  ],
+  "napi": {
+    "binaryName": "adbc-driver-manager",
+    "targets": [
+      "x86_64-pc-windows-msvc",
+      "x86_64-apple-darwin",
+      "x86_64-unknown-linux-gnu",
+      "aarch64-unknown-linux-gnu",
+      "aarch64-apple-darwin"
+    ]
+  },
+  "engines": {
+    "node": ">=22.0.0"
+  },
+  "scripts": {
+    "artifacts": "napi artifacts",
+    "build": "napi build --platform --release && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc",
+    "build:debug": "napi build --platform && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc",
+    "build:ts": "tsc",
+    "build:driver": "../ci/scripts/node_build.sh $(pwd)/build",
+    "fix": "prettier . -w && oxlint . --fix",
+    "check": "prettier --check . && oxlint . && tsc --noEmit",
+    "test": "tsx --test __test__/*.spec.ts",
+    "preversion": "napi build --platform && git add .",
+    "version": "napi version",
+    "prepare": "husky"
+  },
+  "devDependencies": {
+    "@napi-rs/cli": "^3.2.0",
+    "@taplo/cli": "^0.7.0",
+    "tsx": "^4.0.0",
+    "husky": "^9.1.7",
+    "lint-staged": "^16.1.6",
+    "oxlint": "^1.14.0",
+    "prettier": "^3.6.2",
+    "typescript": "^5.9.2"
+  },
+  "lint-staged": {
+    "*.@(js|ts|tsx)": [
+      "oxlint --fix"
+    ],
+    "*.@(js|ts|tsx|yml|yaml|md|json)": [
+      "prettier --write"
+    ],
+    "*.toml": [
+      "taplo format"
+    ]
+  },
+  "prettier": {
+    "printWidth": 120,
+    "semi": false,
+    "trailingComma": "all",
+    "singleQuote": true,
+    "arrowParens": "always"
+  },
+  "peerDependencies": {
+    "apache-arrow": "^21.1.0"
+  },

Review Comment:
   `peerDependencies` means this library **requires it to be installed**, but won't transitively install it.
   
   Whereas if it's in `dependencies` a copy will be transitively installed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2884928714


##########
.github/workflows/packaging.yml:
##########
@@ -1096,6 +1096,151 @@ jobs:
           docker compose run python-sdist-test
           popd
 
+  node-binaries:
+    name: "Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}"
+    runs-on: ${{ matrix.settings.host }}
+    needs:
+      - source
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npx napi build --platform --release --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npx napi build --platform --release --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npx napi build --platform --release --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npx napi build --platform --release --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest

Review Comment:
   same as above, should use the arm image



##########
.github/workflows/packaging.yml:
##########
@@ -1096,6 +1096,151 @@ jobs:
           docker compose run python-sdist-test
           popd
 
+  node-binaries:
+    name: "Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}"
+    runs-on: ${{ matrix.settings.host }}
+    needs:
+      - source
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npx napi build --platform --release --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npx napi build --platform --release --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npx napi build --platform --release --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npx napi build --platform --release --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npx napi build --platform --release --target aarch64-unknown-linux-gnu --use-napi-cross
+    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
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}
+
+      - name: Install Node dependencies
+        working-directory: adbc/javascript
+        run: npm install

Review Comment:
   `npm ci`



##########
.github/workflows/packaging.yml:
##########
@@ -1096,6 +1096,151 @@ jobs:
           docker compose run python-sdist-test
           popd
 
+  node-binaries:
+    name: "Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}"
+    runs-on: ${{ matrix.settings.host }}
+    needs:
+      - source
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npx napi build --platform --release --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npx napi build --platform --release --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npx napi build --platform --release --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npx napi build --platform --release --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npx napi build --platform --release --target aarch64-unknown-linux-gnu --use-napi-cross
+    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
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}
+
+      - name: Install Node dependencies
+        working-directory: adbc/javascript
+        run: npm install
+
+      - name: Build Node.js binaries
+        working-directory: adbc/javascript
+        run: ${{ matrix.settings.build }}
+        shell: bash
+
+      - name: Sign binary (macOS)
+        if: runner.os == 'macOS'
+        working-directory: adbc/javascript
+        run: codesign --sign - *.node

Review Comment:
   do we actually have the env set up properly for doing codesigning here? @lidavidm 



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install
+      - name: Cargo fmt
+        working-directory: javascript
+        run: cargo fmt -- --check
+      - name: Clippy
+        working-directory: javascript
+        run: cargo clippy -- -D warnings
+
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npm run build -- --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npm run build -- --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npm run build -- --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npm run build -- --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest

Review Comment:
   `ubuntu-24.04-arm`?



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install
+      - name: Cargo fmt
+        working-directory: javascript
+        run: cargo fmt -- --check
+      - name: Clippy
+        working-directory: javascript
+        run: cargo clippy -- -D warnings
+
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npm run build -- --target x86_64-apple-darwin

Review Comment:
   since these all match the pattern of `npm run build -- --target {{ target }}` can we extract this from the matrix and just use that pattern below instead?



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install
+      - name: Cargo fmt
+        working-directory: javascript
+        run: cargo fmt -- --check
+      - name: Clippy
+        working-directory: javascript
+        run: cargo clippy -- -D warnings
+
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npm run build -- --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npm run build -- --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npm run build -- --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npm run build -- --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npm run build -- --target aarch64-unknown-linux-gnu --use-napi-cross
+    name: Build Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}
+    runs-on: ${{ matrix.settings.host }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install

Review Comment:
   same as above, `npm ci`?



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install
+      - name: Cargo fmt
+        working-directory: javascript
+        run: cargo fmt -- --check
+      - name: Clippy
+        working-directory: javascript
+        run: cargo clippy -- -D warnings
+
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npm run build -- --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npm run build -- --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npm run build -- --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npm run build -- --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npm run build -- --target aarch64-unknown-linux-gnu --use-napi-cross
+    name: Build Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}
+    runs-on: ${{ matrix.settings.host }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install
+      - name: Build
+        working-directory: javascript
+        run: ${{ matrix.settings.build }}
+        shell: bash
+      - 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: macos-latest
+            target: x86_64-apple-darwin

Review Comment:
   what about `macos-15-intel` and `ubuntu-24.04-arm`?



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install

Review Comment:
   `npm ci`?



##########
.github/workflows/packaging.yml:
##########
@@ -1096,6 +1096,151 @@ jobs:
           docker compose run python-sdist-test
           popd
 
+  node-binaries:
+    name: "Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}"
+    runs-on: ${{ matrix.settings.host }}
+    needs:
+      - source
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npx napi build --platform --release --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npx napi build --platform --release --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npx napi build --platform --release --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npx napi build --platform --release --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npx napi build --platform --release --target aarch64-unknown-linux-gnu --use-napi-cross
+    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
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}
+
+      - name: Install Node dependencies
+        working-directory: adbc/javascript
+        run: npm install
+
+      - name: Build Node.js binaries
+        working-directory: adbc/javascript
+        run: ${{ matrix.settings.build }}
+        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 install

Review Comment:
   `npm ci`



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt

Review Comment:
   should we match the cargo setup in the `rust.yml` workflow?



##########
.github/workflows/node.yml:
##########
@@ -0,0 +1,172 @@
+# 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: Node.js Binding
+
+env:
+  DEBUG: napi:*
+  APP_NAME: adbc-driver-manager
+  MACOSX_DEPLOYMENT_TARGET: '10.13'
+  CARGO_INCREMENTAL: '1'
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+  pull_request:
+    paths:
+      - 'javascript/**'
+      - 'rust/**'
+      - '.github/workflows/node.yml'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          components: clippy, rustfmt
+      - name: Install dependencies
+        working-directory: javascript
+        run: npm install
+      - name: Cargo fmt
+        working-directory: javascript
+        run: cargo fmt -- --check
+      - name: Clippy
+        working-directory: javascript
+        run: cargo clippy -- -D warnings
+
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npm run build -- --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npm run build -- --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npm run build -- --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npm run build -- --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npm run build -- --target aarch64-unknown-linux-gnu --use-napi-cross
+    name: Build Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}
+    runs-on: ${{ matrix.settings.host }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22
+          cache: 'npm'
+          cache-dependency-path: javascript/package-lock.json
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}

Review Comment:
   same comment as above regarding matching the same cargo config/setup as the rust.yml workflows



##########
dev/release/rat_exclude_files.txt:
##########
@@ -43,3 +43,6 @@ r/*/.Rbuildignore
 r/*/tests/testthat/_snaps/*
 rust/Cargo.lock
 testing/*
+javascript/core/Cargo.lock
+javascript/binding.d.ts
+javascript/binding.js

Review Comment:
   if these are generated, we should probably add that to `.gitattributes`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2884978696


##########
javascript/README.md:
##########
@@ -0,0 +1,116 @@
+<!---
+  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.
+-->
+
+# Apache Arrow ADBC: Node.js Driver Manager
+
+Node.js bindings for the [Arrow Database Connectivity (ADBC)](https://arrow.apache.org/adbc/) standard.
+Built on a native [NAPI](https://nodejs.org/api/n-api.html) addon — requires Node.js 22+ and does not
+support browser or Deno environments. Bun is not officially tested.
+
+**Alpha: APIs may change without notice.**
+
+## Installation
+
+```bash
+npm install adbc-driver-manager apache-arrow

Review Comment:
   should `apache-arrow` be a dependency of `adbc-driver-manager` so that we don't need to specify both?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2886739066


##########
javascript/LICENSE.txt:
##########


Review Comment:
   Technically, the JavaScript module's license should only need to include attribution for stuff it actually uses (the transitive dependencies of the Rust driver manager), for things shipped in the binary. (If the NPM upload includes sources of transitive JavaScript dependencies, we should include those licenses too.)



##########
ci/scripts/node_build.sh:
##########
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+# 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.
+
+set -e
+
+# Usage: ./node_build.sh <out_dir>
+if [ "$#" -ne 1 ]; then
+  echo "Usage: $0 <out_dir>"
+  exit 1
+fi
+
+REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
+OUT_DIR="$1"
+
+# 1. Build the C++ Drivers
+echo "=== Building C++ Drivers ==="
+mkdir -p "${OUT_DIR}"
+
+# On macOS, the system sqlite3.h omits sqlite3_load_extension. The cmake
+# auto-detection has a bug (string(FIND) returns -1 which is truthy in
+# cmake's if(), so the NO_LOAD_EXTENSION guard is never set). Pass it
+# explicitly on macOS to avoid a compilation error.
+if [[ "$(uname)" == "Darwin" ]]; then
+  ADBC_CMAKE_ARGS="${ADBC_CMAKE_ARGS} -DADBC_SQLITE_COMPILE_DEFINES=-DADBC_SQLITE_WITH_NO_LOAD_EXTENSION"
+fi

Review Comment:
   Ideally we just fix that in the CMake itself given it's in the same repo



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2892757878


##########
javascript/lib/index.ts:
##########
@@ -0,0 +1,321 @@
+// 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.
+
+import { NativeAdbcDatabase, NativeAdbcConnection, NativeAdbcStatement } from '../binding.js'
+
+import type {
+  AdbcDatabase as AdbcDatabaseInterface,
+  AdbcConnection as AdbcConnectionInterface,
+  AdbcStatement as AdbcStatementInterface,
+  ConnectOptions,
+  GetObjectsOptions,
+} from './types.js'
+
+import { RecordBatchReader, RecordBatch, Table, tableToIPC, Schema } from 'apache-arrow'
+import { AdbcError } from './error.js'
+
+// Safely define Symbol.asyncDispose for compatibility with Node.js environments older than v21.
+const asyncDisposeSymbol = (Symbol as any).asyncDispose ?? Symbol('Symbol.asyncDispose')
+
+type NativeIterator = { next(): Promise<Buffer | null | undefined>; close(): void }
+
+async function iteratorToReader(iterator: NativeIterator): Promise<RecordBatchReader> {

Review Comment:
   what is this used for / how does this get from a uint8array to being a recordbatch reader? I'm likely just missing something, but we should probably add comments / document what this is *actually* doing, yes?



##########
javascript/lib/types.ts:
##########
@@ -0,0 +1,264 @@
+// 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.
+
+import { RecordBatch, RecordBatchReader, Table, Schema } from 'apache-arrow'
+
+/**
+ * Options for connecting to a driver/database.
+ *
+ * These options configure how the ADBC driver is loaded and how the initial connection is established.
+ */
+export interface ConnectOptions {
+  /**
+   * Path to the driver library or short name of the driver.
+   * Short names (e.g. "sqlite") work when the corresponding ADBC driver is installed on the system.
+   * Full paths to a .so/.dylib/.dll or a manifest .toml file are also accepted.
+   */
+  driver: string

Review Comment:
   the driver manager also accepts a URI here (such as `postgresql://.......` or `sqlite:file::memory:`, or even `profile://path/to/profile`



##########
javascript/lib/types.ts:
##########
@@ -0,0 +1,264 @@
+// 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.
+
+import { RecordBatch, RecordBatchReader, Table, Schema } from 'apache-arrow'
+
+/**
+ * Options for connecting to a driver/database.
+ *
+ * These options configure how the ADBC driver is loaded and how the initial connection is established.
+ */
+export interface ConnectOptions {
+  /**
+   * Path to the driver library or short name of the driver.
+   * Short names (e.g. "sqlite") work when the corresponding ADBC driver is installed on the system.
+   * Full paths to a .so/.dylib/.dll or a manifest .toml file are also accepted.
+   */
+  driver: string
+  /**
+   * Name of the entrypoint function (optional).
+   * If not provided, ADBC will attempt to guess the entrypoint symbol name based on the driver name.
+   */
+  entrypoint?: string
+  /**
+   * Paths to search for the driver (optional).
+   * Useful if the driver is not in the standard library paths.
+   */
+  searchPaths?: string[]
+  /**
+   * Load flags (optional).
+   * Bitmask controlling how the driver is loaded (e.g., search system paths, search user paths).
+   */
+  loadFlags?: number

Review Comment:
   should we also export constants for these flags and document the default behavior?



##########
javascript/lib/types.ts:
##########
@@ -0,0 +1,264 @@
+// 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.
+
+import { RecordBatch, RecordBatchReader, Table, Schema } from 'apache-arrow'
+
+/**
+ * Options for connecting to a driver/database.
+ *
+ * These options configure how the ADBC driver is loaded and how the initial connection is established.
+ */
+export interface ConnectOptions {
+  /**
+   * Path to the driver library or short name of the driver.
+   * Short names (e.g. "sqlite") work when the corresponding ADBC driver is installed on the system.
+   * Full paths to a .so/.dylib/.dll or a manifest .toml file are also accepted.
+   */
+  driver: string
+  /**
+   * Name of the entrypoint function (optional).
+   * If not provided, ADBC will attempt to guess the entrypoint symbol name based on the driver name.
+   */
+  entrypoint?: string
+  /**
+   * Paths to search for the driver (optional).
+   * Useful if the driver is not in the standard library paths.
+   */
+  searchPaths?: string[]
+  /**
+   * Load flags (optional).
+   * Bitmask controlling how the driver is loaded (e.g., search system paths, search user paths).
+   */
+  loadFlags?: number
+  /**
+   * Database-specific options.
+   * Key-value pairs passed to the driver during database initialization (e.g., "uri", "username").
+   */
+  databaseOptions?: Record<string, string>
+}
+
+/** Options for getObjects metadata call. */
+export interface GetObjectsOptions {
+  /**
+   * The level of depth to retrieve.
+   * 0: All (Catalogs, Schemas, Tables, and Columns)
+   * 1: Catalogs only
+   * 2: Catalogs and Schemas
+   * 3: Catalogs, Schemas, and Tables
+   * 4: Catalogs, Schemas, Tables, and Columns (same as 0)
+   */
+  depth?: number
+  /** Filter by catalog name pattern. */
+  catalog?: string
+  /** Filter by database schema name pattern. */
+  dbSchema?: string
+  /** Filter by table name pattern. */
+  tableName?: string
+  /** Filter by table type (e.g., ["table", "view"]). */
+  tableType?: string[]
+  /** Filter by column name pattern. */
+  columnName?: string
+}
+
+/**
+ * Represents an ADBC Database.
+ *
+ * An AdbcDatabase represents a handle to a database. This may be a single file (SQLite),
+ * a connection configuration (PostgreSQL), or an in-memory database.
+ * It holds state that is shared across multiple connections.
+ */
+export interface AdbcDatabase {
+  /**
+   * Open a new connection to the database.
+   *
+   * @returns A Promise resolving to a new AdbcConnection.
+   */
+  connect(): Promise<AdbcConnection>
+
+  /**
+   * Release the database resources.
+   * After closing, the database object should not be used.
+   */
+  close(): Promise<void>
+}
+
+/**
+ * Represents a single connection to a database.
+ *
+ * An AdbcConnection maintains the state of a connection to the database, such as
+ * current transaction state and session options.
+ */
+export interface AdbcConnection {
+  /**
+   * Create a new statement for executing queries.
+   *
+   * @returns A Promise resolving to a new AdbcStatement.
+   */
+  createStatement(): Promise<AdbcStatement>
+
+  /**
+   * Set an option on the connection.
+   *
+   * @param key The option name (e.g., "adbc.connection.autocommit").
+   * @param value The option value.
+   */
+  setOption(key: string, value: string): void
+
+  /**
+   * Toggle autocommit behavior.
+   *
+   * @param enabled Whether autocommit should be enabled.
+   */
+  setAutoCommit(enabled: boolean): void
+
+  /**
+   * Toggle read-only mode.
+   *
+   * @param enabled Whether the connection should be read-only.
+   */
+  setReadOnly(enabled: boolean): void
+
+  /**
+   * Get a hierarchical view of database objects (catalogs, schemas, tables, columns).
+   *
+   * @param options Filtering options for the metadata query.
+   * @returns A RecordBatchReader containing the metadata.
+   */
+  getObjects(options?: GetObjectsOptions): Promise<RecordBatchReader>
+
+  /**
+   * Get the Arrow schema for a specific table.
+   *
+   * @param options An object containing catalog, dbSchema, and tableName.
+   * @param options.catalog The catalog name (or undefined).
+   * @param options.dbSchema The schema name (or undefined).
+   * @param options.tableName The table name.
+   * @returns A Promise resolving to the Arrow Schema of the table.
+   */
+  getTableSchema(options: { catalog?: string; dbSchema?: string; tableName: string }): Promise<Schema>
+
+  /**
+   * Get a list of table types supported by the database.
+   *
+   * @returns A RecordBatchReader containing a single string column of table types.
+   */
+  getTableTypes(): Promise<RecordBatchReader>
+
+  /**
+   * Get metadata about the driver and database.
+   *
+   * @param infoCodes Optional list of integer info codes to retrieve.
+   * @returns A RecordBatchReader containing the requested metadata info.
+   */
+  getInfo(infoCodes?: number[]): Promise<RecordBatchReader>

Review Comment:
   same here, we probably want an enum/typed value here so we can have constants



##########
javascript/lib/types.ts:
##########
@@ -0,0 +1,264 @@
+// 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.
+
+import { RecordBatch, RecordBatchReader, Table, Schema } from 'apache-arrow'
+
+/**
+ * Options for connecting to a driver/database.
+ *
+ * These options configure how the ADBC driver is loaded and how the initial connection is established.
+ */
+export interface ConnectOptions {
+  /**
+   * Path to the driver library or short name of the driver.
+   * Short names (e.g. "sqlite") work when the corresponding ADBC driver is installed on the system.
+   * Full paths to a .so/.dylib/.dll or a manifest .toml file are also accepted.
+   */
+  driver: string
+  /**
+   * Name of the entrypoint function (optional).
+   * If not provided, ADBC will attempt to guess the entrypoint symbol name based on the driver name.
+   */
+  entrypoint?: string
+  /**
+   * Paths to search for the driver (optional).
+   * Useful if the driver is not in the standard library paths.
+   */
+  searchPaths?: string[]
+  /**
+   * Load flags (optional).
+   * Bitmask controlling how the driver is loaded (e.g., search system paths, search user paths).
+   */
+  loadFlags?: number
+  /**
+   * Database-specific options.
+   * Key-value pairs passed to the driver during database initialization (e.g., "uri", "username").
+   */
+  databaseOptions?: Record<string, string>
+}
+
+/** Options for getObjects metadata call. */
+export interface GetObjectsOptions {
+  /**
+   * The level of depth to retrieve.
+   * 0: All (Catalogs, Schemas, Tables, and Columns)
+   * 1: Catalogs only
+   * 2: Catalogs and Schemas
+   * 3: Catalogs, Schemas, and Tables
+   * 4: Catalogs, Schemas, Tables, and Columns (same as 0)
+   */
+  depth?: number

Review Comment:
   Can this be a typed enum so that we can provide constants for users to use here?



##########
javascript/lib/types.ts:
##########
@@ -0,0 +1,264 @@
+// 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.
+
+import { RecordBatch, RecordBatchReader, Table, Schema } from 'apache-arrow'
+
+/**
+ * Options for connecting to a driver/database.
+ *
+ * These options configure how the ADBC driver is loaded and how the initial connection is established.
+ */
+export interface ConnectOptions {
+  /**
+   * Path to the driver library or short name of the driver.
+   * Short names (e.g. "sqlite") work when the corresponding ADBC driver is installed on the system.
+   * Full paths to a .so/.dylib/.dll or a manifest .toml file are also accepted.
+   */
+  driver: string
+  /**
+   * Name of the entrypoint function (optional).
+   * If not provided, ADBC will attempt to guess the entrypoint symbol name based on the driver name.
+   */
+  entrypoint?: string
+  /**
+   * Paths to search for the driver (optional).
+   * Useful if the driver is not in the standard library paths.
+   */

Review Comment:
   also for searching for profiles too



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2886392468


##########
.github/workflows/packaging.yml:
##########
@@ -1096,6 +1096,151 @@ jobs:
           docker compose run python-sdist-test
           popd
 
+  node-binaries:
+    name: "Node.js ${{ matrix.settings.arch }} ${{ matrix.settings.os }}"
+    runs-on: ${{ matrix.settings.host }}
+    needs:
+      - source
+    strategy:
+      fail-fast: false
+      matrix:
+        settings:
+          - host: macos-15-intel
+            target: x86_64-apple-darwin
+            arch: amd64
+            os: macOS
+            build: npx napi build --platform --release --target x86_64-apple-darwin
+          - host: macos-latest
+            target: aarch64-apple-darwin
+            arch: arm64
+            os: macOS
+            build: npx napi build --platform --release --target aarch64-apple-darwin
+          - host: windows-latest
+            target: x86_64-pc-windows-msvc
+            arch: amd64
+            os: Windows
+            build: npx napi build --platform --release --target x86_64-pc-windows-msvc
+          - host: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            arch: amd64
+            os: Linux
+            build: npx napi build --platform --release --target x86_64-unknown-linux-gnu --use-napi-cross
+          - host: ubuntu-latest
+            target: aarch64-unknown-linux-gnu
+            arch: arm64
+            os: Linux
+            build: npx napi build --platform --release --target aarch64-unknown-linux-gnu --use-napi-cross
+    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
+        uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
+        with:
+          toolchain: stable
+          targets: ${{ matrix.settings.target }}
+
+      - name: Install Node dependencies
+        working-directory: adbc/javascript
+        run: npm install
+
+      - name: Build Node.js binaries
+        working-directory: adbc/javascript
+        run: ${{ matrix.settings.build }}
+        shell: bash
+
+      - name: Sign binary (macOS)
+        if: runner.os == 'macOS'
+        working-directory: adbc/javascript
+        run: codesign --sign - *.node

Review Comment:
   @zeroshade this ad hoc signing is sufficient for a npm distributed `.node` file. Certificate signing is only required for apps (ex. `.dmg`) that will be opened by a user. Ad hoc signed binaries can be opened via `dlopen()` without issue on macOS.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript): add Node.js ADBC driver manager [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2887506994


##########
javascript/LICENSE.txt:
##########


Review Comment:
   That looks great, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(javascript/driver-manager): add Node.js ADBC driver manager [arrow-adbc]

Posted by "kentkwu (via GitHub)" <gi...@apache.org>.
kentkwu commented on code in PR #4046:
URL: https://github.com/apache/arrow-adbc/pull/4046#discussion_r2885007736


##########
javascript/package.json:
##########
@@ -0,0 +1,88 @@
+{
+  "name": "adbc-driver-manager",
+  "version": "0.0.1",
+  "description": "Node.js ADBC Driver Manager",
+  "main": "dist/index.js",
+  "types": "dist/index.d.ts",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/apache/arrow-adbc.git",
+    "directory": "javascript"
+  },
+  "license": "Apache-2.0",
+  "keywords": [
+    "adbc",
+    "arrow",
+    "database",
+    "arrow-adbc"
+  ],
+  "files": [
+    "dist",
+    "binding.d.ts",
+    "binding.js"
+  ],
+  "napi": {
+    "binaryName": "adbc-driver-manager",
+    "targets": [
+      "x86_64-pc-windows-msvc",
+      "x86_64-apple-darwin",
+      "x86_64-unknown-linux-gnu",
+      "aarch64-unknown-linux-gnu",
+      "aarch64-apple-darwin"
+    ]
+  },
+  "engines": {
+    "node": ">=22.0.0"
+  },
+  "scripts": {
+    "artifacts": "napi artifacts",
+    "build": "napi build --platform --release && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc",
+    "build:debug": "napi build --platform && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc",
+    "build:ts": "tsc",
+    "build:driver": "../ci/scripts/node_build.sh $(pwd)/build",
+    "fix": "prettier . -w && oxlint . --fix",
+    "check": "prettier --check . && oxlint . && tsc --noEmit",
+    "test": "tsx --test __test__/*.spec.ts",
+    "preversion": "napi build --platform && git add .",
+    "version": "napi version",
+    "prepare": "husky"
+  },
+  "devDependencies": {
+    "@napi-rs/cli": "^3.2.0",
+    "@taplo/cli": "^0.7.0",
+    "tsx": "^4.0.0",
+    "husky": "^9.1.7",
+    "lint-staged": "^16.1.6",
+    "oxlint": "^1.14.0",
+    "prettier": "^3.6.2",
+    "typescript": "^5.9.2"
+  },
+  "lint-staged": {
+    "*.@(js|ts|tsx)": [
+      "oxlint --fix"
+    ],
+    "*.@(js|ts|tsx|yml|yaml|md|json)": [
+      "prettier --write"
+    ],
+    "*.toml": [
+      "taplo format"
+    ]
+  },
+  "prettier": {
+    "printWidth": 120,
+    "semi": false,
+    "trailingComma": "all",
+    "singleQuote": true,
+    "arrowParens": "always"
+  },
+  "peerDependencies": {
+    "apache-arrow": "^21.1.0"
+  },

Review Comment:
   `peerDependencies` means this library **requires it to be installed**, but won't transitively install it.
   
   Whereas if it's in `dependencies` a copy will be transitively installed. Potentially even a different version. The version mismatch is what causes issues with arrow-js due to some implementation details.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org