From 0c2312f80228e074180cddbab9857bd4326eaf11 Mon Sep 17 00:00:00 2001 From: Madhavendra Rathore Date: Mon, 25 May 2026 12:51:43 +0530 Subject: [PATCH] =?UTF-8?q?feat(napi):=20napi-rs=20binding=20crate=20skele?= =?UTF-8?q?ton=20=E2=80=94=20Cargo=20+=20lib=20+=20error=20envelope=20+=20?= =?UTF-8?q?util=20+=20runtime=20+=20logger=20(stack=202/8)=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Stack Linear stack of 8 PRs on `databricks/databricks-sql-kernel` landing the **SEA-driver kernel-side enablement** work. Merge in order from base ↑ to tip. The tip branch (`msrathore/krn-status-fields`, PR [#23](https://github.com/databricks/databricks-sql-kernel/pull/23)) is the single snapshot containing every kernel-side change in flight. | Pos | PR | Branch | Scope | |---|---|---|---| | 1/8 | [#26](https://github.com/databricks/databricks-sql-kernel/pull/26) | `kernel-async-public-api` | Remove `block_on` from ResultStream + Send-safety on Statement + rustls-tls + e2e test ported from [#20](https://github.com/databricks/databricks-sql-kernel/pull/20) | | 2/8 | [#27](https://github.com/databricks/databricks-sql-kernel/pull/27) | `kernel-napi-skeleton` | napi-rs binding crate skeleton: Cargo manifest + lib + error envelope + util + runtime + logger | | 3/8 | [#25](https://github.com/databricks/databricks-sql-kernel/pull/25) | `kernel-napi-classes` | Database / Connection / Statement / ResultStream napi classes | | 4/8 | [#29](https://github.com/databricks/databricks-sql-kernel/pull/29) | `kernel-napi-statement-validity` | StatementInner ValidityFlag fix propagated from sea-operation | | 5/8 | [#28](https://github.com/databricks/databricks-sql-kernel/pull/28) | `kernel-oauth-error-class` | Reclassify OAuth token-exchange failures as `Error::unauthenticated()` (2-line fix in auth/oauth/m2m.rs + u2m.rs) | | 6/8 | [#30](https://github.com/databricks/databricks-sql-kernel/pull/30) | `krn-connection-pool-default-bump` | Bump `HttpConfig.pool_max_idle_per_host` default from 10 → 100 | | 7/8 | [#24](https://github.com/databricks/databricks-sql-kernel/pull/24) | `krn-tls-public-api` | Expose `TlsConfig` fields (custom_ca_cert + accept_self_signed + skip_hostname_verification) + stop discarding in session.rs | | 8/8 | [#23](https://github.com/databricks/databricks-sql-kernel/pull/23) | `krn-status-fields` **← TIP** | Expose 5 status accessors on `ExecutedStatement` (num_modified_rows / progress / display_message / diagnostic_info / error_details_json) | **Companion NodeJS stack** (`databricks/databricks-sql-nodejs`): 8 PRs — root [#378](https://github.com/databricks/databricks-sql-nodejs/pull/378) (sea-abstraction) → [#380](https://github.com/databricks/databricks-sql-nodejs/pull/380) → [#377](https://github.com/databricks/databricks-sql-nodejs/pull/377) → [#379](https://github.com/databricks/databricks-sql-nodejs/pull/379) → [#382](https://github.com/databricks/databricks-sql-nodejs/pull/382) → [#381](https://github.com/databricks/databricks-sql-nodejs/pull/381) → [#384](https://github.com/databricks/databricks-sql-nodejs/pull/384) → [#383](https://github.com/databricks/databricks-sql-nodejs/pull/383) (tip). **Policy:** new PRs always stack on the current tip. No sibling/parallel topology. No force-pushes on existing PRs unless absolutely necessary; if a PR's content is wrong, add a fix-up commit on top of the stack tip rather than rewriting history. --- **This PR is position 2/8.** ## Summary Lands the napi-rs binding crate as a workspace member with **infrastructure only**: no exported classes yet. ~442 LOC across 10 files. **Files added:** - `Cargo.toml` — workspace membership declaration - `napi/Cargo.toml`, `napi/build.rs`, `napi/package.json`, `napi/.gitignore` — crate manifest + napi-rs build glue - `napi/src/lib.rs` — entry point declaring 4 infra modules (no class modules yet); exports a smoke-test `version()` fn - `napi/src/error.rs` — formatter for the `__databricks_error__:` napi error envelope decoded by the JS-side adapter - `napi/src/util.rs` — shared helpers - `napi/src/runtime.rs` — tokio multi-thread runtime helper - `napi/src/logger.rs` — `tracing`-to-JS logger bridge stub ## Compilability `cargo check -p databricks-sea-native` is clean. The crate compiles standalone and exposes only the `version()` probe — the JS-side loader would find a valid `.node` but no functional API yet. This split makes the infra layer reviewable on its own; the next PR adds the user-facing surface. ## Tracking - [PECOBLR-2670](https://databricks.atlassian.net/browse/PECOBLR-2670) — Make the async interface for rust kernel — napi crate skeleton - Parent epic: [PECOBLR-2666](https://databricks.atlassian.net/browse/PECOBLR-2666) Co-authored-by: Isaac [PECOBLR-2670]: https://databricks.atlassian.net/browse/PECOBLR-2670?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: Madhavendra Rathore --- .github/workflows/napi-checks.yml | 124 ++ Cargo.toml | 10 +- napi/.gitignore | 5 + napi/Cargo.lock | 2624 +++++++++++++++++++++++++++++ napi/Cargo.toml | 124 ++ napi/build.rs | 17 + napi/package.json | 23 + napi/src/error.rs | 443 +++++ napi/src/lib.rs | 66 + napi/src/logger.rs | 52 + napi/src/runtime.rs | 129 ++ napi/src/util.rs | 156 ++ 12 files changed, 3771 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/napi-checks.yml create mode 100644 napi/.gitignore create mode 100644 napi/Cargo.lock create mode 100644 napi/Cargo.toml create mode 100644 napi/build.rs create mode 100644 napi/package.json create mode 100644 napi/src/error.rs create mode 100644 napi/src/lib.rs create mode 100644 napi/src/logger.rs create mode 100644 napi/src/runtime.rs create mode 100644 napi/src/util.rs diff --git a/.github/workflows/napi-checks.yml b/.github/workflows/napi-checks.yml new file mode 100644 index 00000000..1c7d1e81 --- /dev/null +++ b/.github/workflows/napi-checks.yml @@ -0,0 +1,124 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed 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. + +# napi-rs sub-crate CI. The napi/ directory is a *standalone* Cargo +# workspace (see napi/Cargo.toml — `[workspace] members = ["."]`) +# because it pins `tls-rustls` on the kernel while the root workspace +# picks `tls-native` via pyo3. Feature-unification under a single +# workspace would link both TLS stacks into the resulting cdylib. +# +# Consequence: every cargo invocation here runs from `napi/`, not the +# repo root. Lockfile drift detection uses `--locked` against +# `napi/Cargo.lock` rather than the kernel's root lock. +# +# Path-gated on `napi/**` so this workflow fires only when the +# directory or its inputs change. + +name: napi Checks + +on: + push: + branches: [main] + paths: + - "napi/**" + # Root Cargo.toml change can affect napi via its `path = ".."` + # kernel dep, so this workflow re-runs to catch mismatches. + - "Cargo.toml" + - ".github/workflows/napi-checks.yml" + pull_request: + branches: [main] + paths: + - "napi/**" + - "Cargo.toml" + - ".github/workflows/napi-checks.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + # Cheap gate job — runs once, no toolchain installs. The check-and-test + # job depends on this and is skipped (no runner boot beyond the + # precondition runner itself) when the napi/ sub-crate doesn't + # exist. Avoids wasted setup cost on kernel-only PRs that trigger + # this workflow via root Cargo.toml changes before the napi crate + # has merged. + precondition: + name: "Check napi/ sub-crate exists" + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + outputs: + ready: ${{ steps.check.outputs.ready }} + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: "Check for napi/Cargo.toml" + id: check + run: | + if [[ -f "napi/Cargo.toml" ]]; then + echo "ready=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::napi/ sub-crate does not exist yet — skipping napi checks. (Workflow may fire on root Cargo.toml changes before the napi crate has merged.)" + echo "ready=false" >> "$GITHUB_OUTPUT" + fi + + check-and-test: + name: "napi fmt + clippy + test" + needs: precondition + if: needs.precondition.outputs.ready == 'true' + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + defaults: + run: + # All cargo commands run from the napi/ standalone workspace. + working-directory: napi + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2 + with: + components: rustfmt, clippy + + - name: cargo fmt --all -- --check + run: cargo fmt --all -- --check + + # `--locked` makes the build fail if `napi/Cargo.lock` is out of + # sync with `napi/Cargo.toml` — catches contributors who bump a + # dep version in Cargo.toml without re-running `cargo update`. + # Mirrors the dual-Cargo.lock-drift concern from review. + - name: cargo clippy --all-targets --locked -- -D warnings + run: cargo clippy --all-targets --locked -- -D warnings + + - name: cargo test --locked + # The napi crate's Rust-side unit tests (error envelope, panic + # guard, runtime handle, version) run here. No network, no + # secrets — purely cdylib + rlib in-tree tests. + run: cargo test --locked + + # Release-profile build verifies the cdylib actually links with + # the production profile knobs (lto=true, codegen-units=1, + # strip="debuginfo"). Slower (~1m) but cheap insurance against + # release-only regressions that the debug-profile `cargo test` + # above wouldn't catch. + - name: cargo build --release --locked + run: cargo build --release --locked diff --git a/Cargo.toml b/Cargo.toml index 3236f0b2..973bfb2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,13 @@ tls-rustls = ["reqwest/rustls-tls"] name = "databricks_sql_kernel" crate-type = ["lib", "cdylib", "staticlib"] -# Workspace — the kernel is the root crate; language bindings live as -# sibling members. PyO3 first; napi-rs / etc. slot in here later. +# Workspace — the kernel is the root crate; pyo3 is a sibling member. +# +# The napi binding crate (`napi/`) is deliberately NOT a member: it +# uses `tls-rustls` while pyo3 uses the default `tls-native`, and a +# single-workspace build would unify both kernel features and link +# both TLS stacks (defeating the rustls switch — see [features] +# comment above). napi declares its own `[workspace]` at `napi/Cargo.toml` +# and reaches the kernel via `path = ".."`. [workspace] members = [".", "pyo3"] diff --git a/napi/.gitignore b/napi/.gitignore new file mode 100644 index 00000000..aa81b75d --- /dev/null +++ b/napi/.gitignore @@ -0,0 +1,5 @@ +target/ +index.node +*.node +index.d.ts +index.js diff --git a/napi/Cargo.lock b/napi/Cargo.lock new file mode 100644 index 00000000..4732b960 --- /dev/null +++ b/napi/Cargo.lock @@ -0,0 +1,2624 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "const-random", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrow-array" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8a4ab47b3f3eac60f7fd31b81e9028fda018607bcc63451aca4f2b755269862" +dependencies = [ + "ahash", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "chrono", + "half", + "hashbrown 0.16.1", + "num-complex", + "num-integer", + "num-traits", +] + +[[package]] +name = "arrow-buffer" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d18b89b4c4f4811d0858175e79541fe98e33e18db3b011708bc287b1240593f" +dependencies = [ + "bytes", + "half", + "num-bigint", + "num-traits", +] + +[[package]] +name = "arrow-cast" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722b5c41dd1d14d0a879a1bce92c6fe33f546101bb2acce57a209825edd075b3" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-ord", + "arrow-schema", + "arrow-select", + "atoi", + "base64", + "chrono", + "half", + "lexical-core", + "num-traits", + "ryu", +] + +[[package]] +name = "arrow-data" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1683705c63dcf0d18972759eda48489028cbbff67af7d6bef2c6b7b74ab778a" +dependencies = [ + "arrow-buffer", + "arrow-schema", + "half", + "num-integer", + "num-traits", +] + +[[package]] +name = "arrow-ipc" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf72d04c07229fbf4dbebe7145cac37d7cf7ec582fe705c6b92cb314af096ab" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "arrow-select", + "flatbuffers", +] + +[[package]] +name = "arrow-ord" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082342947d4e5a2bcccf029a0a0397e21cb3bb8421edd9571d34fb5dd2670256" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "arrow-select", +] + +[[package]] +name = "arrow-schema" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4cf0d4a6609679e03002167a61074a21d7b1ad9ea65e462b2c0a97f8a3b2bc6" + +[[package]] +name = "arrow-select" +version = "57.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b320d86a9806923663bb0fd9baa65ecaba81cb0cd77ff8c1768b9716b4ef891" +dependencies = [ + "ahash", + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "num-traits", +] + +[[package]] +name = "async-compression" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79b3f8a79cccc2898f31920fc69f304859b3bd567490f75ebf51ae1c792a9ac" +dependencies = [ + "compression-codecs", + "compression-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "compression-codecs" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce2548391e9c1929c21bf6aa2680af86fe4c1b33e6cea9ac1cfeec0bd11218cf" +dependencies = [ + "compression-core", + "flate2", + "memchr", +] + +[[package]] +name = "compression-core" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc14f565cf027a105f7a44ccf9e5b424348421a1d8952a8fc9d499d313107789" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "databricks-sea-native" +version = "0.1.0" +dependencies = [ + "arrow-array", + "arrow-ipc", + "arrow-schema", + "databricks-sql-kernel", + "futures", + "napi", + "napi-build", + "napi-derive", + "once_cell", + "serde_json", + "tokio", +] + +[[package]] +name = "databricks-sql-kernel" +version = "0.1.0" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-cast", + "arrow-ipc", + "arrow-ord", + "arrow-schema", + "arrow-select", + "async-trait", + "base64", + "chrono", + "dashmap", + "dirs", + "futures", + "lz4_flex", + "oauth2", + "open", + "rand 0.9.4", + "reqwest", + "serde", + "serde_json", + "sha2", + "thiserror 2.0.18", + "tokio", + "tokio-util", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flatbuffers" +version = "25.12.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f6839d7b3b98adde531effaf34f0c2badc6f4735d26fe74709d8e513a96ef3" +dependencies = [ + "bitflags", + "rustc_version", +] + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "num-traits", + "zerocopy", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lexical-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8d125a277f807e55a77304455eb7b1cb52f2b18c143b60e766c120bd64a594" +dependencies = [ + "lexical-parse-float", + "lexical-parse-integer", + "lexical-util", + "lexical-write-float", + "lexical-write-integer", +] + +[[package]] +name = "lexical-parse-float" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a9f232fbd6f550bc0137dcb5f99ab674071ac2d690ac69704593cb4abbea56" +dependencies = [ + "lexical-parse-integer", + "lexical-util", +] + +[[package]] +name = "lexical-parse-integer" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a7a039f8fb9c19c996cd7b2fcce303c1b2874fe1aca544edc85c4a5f8489b34" +dependencies = [ + "lexical-util", +] + +[[package]] +name = "lexical-util" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2604dd126bb14f13fb5d1bd6a66155079cb9fa655b37f875b3a742c705dbed17" + +[[package]] +name = "lexical-write-float" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c438c87c013188d415fbabbb1dceb44249ab81664efbd31b14ae55dabb6361" +dependencies = [ + "lexical-util", + "lexical-write-integer", +] + +[[package]] +name = "lexical-write-integer" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "409851a618475d2d5796377cad353802345cba92c867d9fbcde9cf4eac4e14df" +dependencies = [ + "lexical-util", +] + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libredox" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +dependencies = [ + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "lz4_flex" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373f5eceeeab7925e0c1098212f2fbc4d416adec9d35051a6ab251e824c1854a" +dependencies = [ + "twox-hash", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "napi" +version = "2.16.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55740c4ae1d8696773c78fdafd5d0e5fe9bc9f1b071c7ba493ba5c413a9184f3" +dependencies = [ + "bitflags", + "ctor", + "napi-derive", + "napi-sys", + "once_cell", + "tokio", +] + +[[package]] +name = "napi-build" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9c366d2c8c60b86fa632df75f745509b52f9128f91a6bad4c796e44abb505e1" + +[[package]] +name = "napi-derive" +version = "2.16.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cbe2585d8ac223f7d34f13701434b9d5f4eb9c332cccce8dee57ea18ab8ab0c" +dependencies = [ + "cfg-if", + "convert_case", + "napi-derive-backend", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "napi-derive-backend" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1639aaa9eeb76e91c6ae66da8ce3e89e921cd3885e99ec85f4abacae72fc91bf" +dependencies = [ + "convert_case", + "once_cell", + "proc-macro2", + "quote", + "regex", + "semver", + "syn", +] + +[[package]] +name = "napi-sys" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" +dependencies = [ + "libloading", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "oauth2" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51e219e79014df21a225b1860a479e2dcd7cbd9130f4defd4bd0e191ea31d67d" +dependencies = [ + "base64", + "chrono", + "getrandom 0.2.17", + "http", + "rand 0.8.6", + "reqwest", + "serde", + "serde_json", + "serde_path_to_error", + "sha2", + "thiserror 1.0.69", + "url", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "open" +version = "5.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fbaa89d2ddc8473c78a3adf69eea8cffa28c483b8e02a971ef31527cd0fc92c" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.4", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51" +dependencies = [ + "async-compression", + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "pin-project-lite", + "tokio", + "tokio-util", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/napi/Cargo.toml b/napi/Cargo.toml new file mode 100644 index 00000000..5949b986 --- /dev/null +++ b/napi/Cargo.toml @@ -0,0 +1,124 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed 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. + +# Standalone workspace. +# +# This crate is intentionally NOT a member of the kernel workspace at +# `../Cargo.toml`. The reason is Cargo feature unification: pyo3 (a +# kernel-workspace member) builds the kernel with the default +# `tls-native` feature; this crate builds it with `tls-rustls`. If both +# lived in the same workspace, `cargo build --workspace` would unify +# the kernel's feature set to `tls-native ∪ tls-rustls`, link both TLS +# stacks into the resulting napi cdylib, and reintroduce the OpenSSL ↔ +# Node symbol clash the rustls switch was meant to avoid. +# +# Building this crate is therefore done from `napi/` (not from the +# kernel root with `--workspace`). The kernel is reached via `path = +# ".."` — the same source tree, just a different workspace view. +# +# Side benefit: `[profile.release]` below is now honored. Profile +# sections in non-root workspace members are silently ignored by Cargo; +# making this crate its own workspace root activates them. +[workspace] +members = ["."] + +[package] +name = "databricks-sea-native" +version = "0.1.0" +edition = "2021" +authors = ["Databricks"] +license = "Apache-2.0" +description = "Databricks SQL Node.js SEA native binding (napi-rs)" +publish = false + +[lib] +# `rlib` alongside `cdylib` so `cargo test -p databricks-sea-native` +# can pick up `#[cfg(test)]` modules in src/**. With only `cdylib`, +# cargo silently reports "running 0 tests / ok" even when `#[test]` +# functions exist — a real footgun for any later Rust-side test. +# Mirrors the equivalent decision in `pyo3/Cargo.toml`. +crate-type = ["cdylib", "rlib"] + +[dependencies] +# napi-rs v2 line; `napi6` enables N-API 6 surface, `async` enables the +# `#[napi] async fn` glue that drives futures on napi-rs's tokio runtime. +napi = { version = "2", default-features = false, features = ["napi6", "async"] } +napi-derive = "2" + +# Kernel — path dep on the async-public-api branch worktree. Once the +# kernel is published this becomes a version dep. +# +# We disable the kernel's `default` feature (which selects `tls-native`) +# and opt into `tls-rustls` instead. This avoids the OpenSSL-symbol clash +# between `native-tls` (system OpenSSL 1.1 on Linux) and Node.js (statically +# linked OpenSSL 3.x): loading a napi module that pulls in OpenSSL 1.1 +# symbols into a Node process segfaults before any Rust code runs. The +# pure-Rust rustls backend has no such conflict. +# +# Direct-Rust users + the C-ABI (future ODBC) keep `tls-native` via the +# kernel's default feature. +databricks-sql-kernel = { path = "..", default-features = false, features = ["tls-rustls"] } + +# Tokio is a transitive dep via the kernel and via napi's `async` feature; +# declared explicitly so we can name `tokio::runtime::Handle` and +# `tokio::sync::Mutex` directly. +tokio = { version = "1", default-features = false, features = ["rt", "sync"] } + +# Lazy `OnceCell` for the captured tokio Handle. +once_cell = "1" + +# `catch_unwind` wrapper around async futures (pattern #8 of the +# napi-rs patterns doc). Transitively a dep of the kernel already, but +# declared here so we can `use FutureExt;` directly. +futures = { version = "0.3", default-features = false, features = ["std"] } + +# Arrow IPC encoding of result batches across the napi boundary. +# `arrow-array` / `arrow-schema` come in via the kernel's public types +# (`RecordBatch`, `SchemaRef`); `arrow-ipc` is for the `StreamWriter` +# we use on the encode side. Versions kept in lock-step with the +# kernel's `arrow-*` deps to avoid two arrow versions in the dep graph. +arrow-array = "57" +arrow-schema = "57" +arrow-ipc = "57" + +# Error envelope serialization. Already a kernel transitive dep; the +# direct declaration is so we can use `serde_json::json!` in +# `src/error.rs` without bouncing through a hand-rolled escaper. +serde_json = "1" + +[build-dependencies] +napi-build = "2" + +[profile.release] +lto = true +# Single codegen unit for the cdylib: ~30-60s slower build for +# meaningfully smaller binary + better cross-crate inlining. Mirrors +# the standard napi-rs release-profile recipe. +codegen-units = 1 +# `panic = "abort"` MUST NOT be added here. The crate relies on +# `util::guarded`'s `catch_unwind` to convert futures-panics into +# `napi::Error` rejected promises (pattern #8 in the napi-rs patterns +# doc). With `panic = "abort"`, `catch_unwind` becomes a no-op and the +# Node process exits instead — turning a recoverable per-statement +# panic into a fleet-wide outage. The 5 `util::guarded_recovers_*` +# tests cover this contract; if any future optimisation flips this +# flag the test binary itself will abort under panic before reporting. +# `strip = "debuginfo"` (not `"symbols"`) — keeps function-name symbols +# so production stack traces from `panic_payload_msg` (and any future +# native crash dump) are readable. Stripping `debuginfo` only drops the +# DWARF/PDB debug sections, which costs ~no binary size on cdylibs but +# preserves the symbol table that's needed to make a numeric backtrace +# useful in incident triage. If you need a smaller artifact, strip +# `"symbols"` in CI and archive an unstripped `.node` for symbolication. +strip = "debuginfo" diff --git a/napi/build.rs b/napi/build.rs new file mode 100644 index 00000000..398bb2da --- /dev/null +++ b/napi/build.rs @@ -0,0 +1,17 @@ +// Copyright (c) 2026 Databricks, Inc. +// +// Licensed 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. + +fn main() { + napi_build::setup(); +} diff --git a/napi/package.json b/napi/package.json new file mode 100644 index 00000000..fab3d77f --- /dev/null +++ b/napi/package.json @@ -0,0 +1,23 @@ +{ + "name": "@databricks/sea-native-linux-x64-gnu", + "version": "0.1.0", + "description": "Databricks SQL Node.js SEA native binding (linux-x64-gnu).", + "main": "index.js", + "types": "index.d.ts", + "files": [ + "index.js", + "index.d.ts", + "*.node" + ], + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + }, + "napi": { + "binaryName": "sea-native", + "targets": [ + "x86_64-unknown-linux-gnu" + ] + }, + "private": true +} diff --git a/napi/src/error.rs b/napi/src/error.rs new file mode 100644 index 00000000..3467d247 --- /dev/null +++ b/napi/src/error.rs @@ -0,0 +1,443 @@ +// Copyright (c) 2026 Databricks, Inc. +// +// Licensed 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. + +//! Kernel-error → `napi::Error` mapping. +//! +//! The kernel returns a richly-typed [`Error`](databricks_sql_kernel::Error) +//! with `code`, `message`, `sql_state`, `error_code`, `vendor_code`, +//! `http_status`, `retryable`, `query_id`, `location`, and `cause` +//! fields. The napi `Error` type only carries `status` + `reason` +//! directly — to attach the extra fields as own-properties on the JS +//! error object we'd need an `Env` reference, which `#[napi] async fn` +//! bodies don't have access to cheaply. +//! +//! Compromise (one helper, DRY): encode a subset of the kernel's +//! structured metadata into the `reason` field as a JSON envelope +//! prefixed with a sentinel `__databricks_error__:` token. The TS +//! adapter detects the sentinel, parses the payload, and reconstructs +//! the typed error class (`DBSQLError`, `AuthError`, …). Plain-string +//! errors from the binding's own code paths fall through the sentinel +//! detection unchanged. +//! +//! ## What's NOT in the envelope today +//! +//! The current v1 envelope schema intentionally omits two kernel +//! `Error` fields: +//! +//! - `location` — `Option` describing the kernel source location +//! of the error (mostly useful for `ErrorCode::Internal` kernel bugs). +//! Omitted to keep the wire shape stable for JS consumers; adding it +//! requires a coordinated TS-side reviver update. +//! - `cause` — recursive `Option>` carrying the source +//! error chain. Omitted because recursive serialization needs an +//! intentional schema decision (max depth? cycle detection?) and the +//! TS reviver would need matching logic. +//! +//! Both are tracked as follow-up envelope extensions. The kernel's +//! own `message` field already includes the upstream cause's `Display` +//! output via `.context()`, so today's wire shape isn't useless — +//! callers see the message chain, just not the structured cause graph +//! or the kernel-internal `location`. +//! +//! Round 3 may switch to the `Env::create_error` + own-properties +//! pattern once we have a stable point in each entry where `env: Env` +//! is available (likely by wrapping the async glue in a sync entry +//! point that calls `tokio::spawn` after capturing `env`). + +use databricks_sql_kernel::{Error as KernelError, ErrorCode}; +use napi::{Error as NapiError, Status}; +use serde_json::{json, Map, Value}; + +/// Sentinel that tells the TS adapter the `reason` string is a JSON +/// envelope rather than a plain message. Has to be ASCII-only so it +/// survives any `String` round-trip the napi layer might do. +/// +/// **Invariant:** ONLY [`napi_err_from_kernel`] is allowed to write a +/// `NapiError` whose `reason` begins with this string. Any other code +/// path constructing a `napi::Error` (e.g. `util::guarded`'s panic +/// case, or future plain-string failures from the binding's own glue) +/// MUST ensure its message does not start with `ERROR_SENTINEL` — +/// otherwise the TS-side reviver mis-detects a plain message as a +/// structured envelope and either crashes or fabricates fields. +/// [`napi_err_from_kernel`] itself enforces this with a `debug_assert!` +/// to catch accidental kernel `Error::message` payloads that begin +/// with the sentinel (an unlikely but possible source of confusion). +pub(crate) const ERROR_SENTINEL: &str = "__databricks_error__:"; + +/// Map a kernel [`Error`] into a `napi::Error`. Preserves the kernel +/// `ErrorCode` (mapped to the closest napi `Status`), and stuffs eight +/// of the ten structured kernel-`Error` fields (`code`, `message`, +/// `sql_state`, `error_code`, `vendor_code`, `http_status`, `retryable`, +/// `query_id`) into a JSON envelope on the reason so the TS layer can +/// reconstruct the typed error class. `location` and `cause` are +/// intentionally omitted from the v1 envelope — see the module-level +/// doc for rationale. +/// +/// The whole JSON-envelope-on-`reason` scheme is interim. The follow-up +/// PR that lands the first `#[napi]` entry points (PR #25) is expected +/// to replace it with typed errors via `Env::create_error` + +/// `set_named_property` (mirroring pyo3's `setattr` approach in +/// `pyo3/src/errors.rs`). The sentinel + envelope vanish once that +/// lands. See `sea-workflow/jira-candidates/2026-05-23-napi-typed-error-refactor.md` +/// for the deferred-spec write-up. +pub(crate) fn napi_err_from_kernel(e: KernelError) -> NapiError { + let status = status_from_kernel_code(e.code); + + // Sentinel-collision defense (dev-time only): a kernel `Error.message` + // that itself starts with `ERROR_SENTINEL` would land verbatim inside + // the JSON envelope's `"message"` field. serde_json escapes it + // correctly so a JSON-parsing TS reviver still recovers the right + // payload; the practical hazard is a naive `indexOf(SENTINEL)`-based + // reviver mis-locating the boundary. Today the kernel never emits + // such a message; this `debug_assert!` catches any future kernel-side + // change that would start to. We deliberately do NOT add a + // release-build runtime escape — the right fix is to delete the + // envelope scheme entirely (see typed-error refactor deferred-spec) + // rather than harden the workaround. + debug_assert!( + !e.message.starts_with(ERROR_SENTINEL), + "kernel Error.message must not start with ERROR_SENTINEL (would corrupt the wire envelope)" + ); + + // Build the envelope as a `serde_json::Map` so the TS contract is + // single-sourced in one place (the key set below) and the value + // escaping is delegated to serde_json. Optional fields are only + // inserted when present so the wire shape stays compact and the + // TS-side `reviver` doesn't have to special-case nulls. + let mut obj = Map::new(); + obj.insert("code".to_owned(), Value::from(error_code_str(e.code))); + obj.insert("message".to_owned(), Value::from(e.message)); + if let Some(s) = e.sql_state { + obj.insert("sqlState".to_owned(), Value::from(s)); + } + if let Some(ec) = e.error_code { + obj.insert("errorCode".to_owned(), Value::from(ec)); + } + if let Some(vc) = e.vendor_code { + obj.insert("vendorCode".to_owned(), Value::from(vc)); + } + if let Some(hs) = e.http_status { + obj.insert("httpStatus".to_owned(), Value::from(hs)); + } + if e.retryable { + obj.insert("retryable".to_owned(), Value::from(true)); + } + if let Some(qid) = e.query_id { + obj.insert("queryId".to_owned(), Value::from(qid)); + } + + // `to_string` on a JSON object is infallible: every field above is + // a `String` / `i64` / `u16` / `bool` whose serialization can't fail. + let payload = json!(obj).to_string(); + let mut envelope = String::with_capacity(ERROR_SENTINEL.len() + payload.len()); + envelope.push_str(ERROR_SENTINEL); + envelope.push_str(&payload); + + NapiError::new(status, envelope) +} + +/// Map kernel `ErrorCode` → napi `Status`. The status is mostly +/// cosmetic on the napi side (the TS layer dispatches on `code` from +/// the envelope); we pick the closest match so unwrapped errors still +/// look reasonable in raw napi consumers. +fn status_from_kernel_code(code: ErrorCode) -> Status { + match code { + ErrorCode::InvalidArgument | ErrorCode::InvalidStatementHandle => Status::InvalidArg, + ErrorCode::Cancelled => Status::Cancelled, + _ => Status::GenericFailure, + } +} + +/// String tag for each kernel `ErrorCode` — stable across kernel +/// versions because v0's `ErrorCode` is `#[non_exhaustive]` and we +/// pattern-match exhaustively against the known set. +fn error_code_str(code: ErrorCode) -> &'static str { + match code { + ErrorCode::InvalidArgument => "InvalidArgument", + ErrorCode::Unauthenticated => "Unauthenticated", + ErrorCode::PermissionDenied => "PermissionDenied", + ErrorCode::NotFound => "NotFound", + ErrorCode::ResourceExhausted => "ResourceExhausted", + ErrorCode::Unavailable => "Unavailable", + ErrorCode::Timeout => "Timeout", + ErrorCode::Cancelled => "Cancelled", + ErrorCode::DataLoss => "DataLoss", + ErrorCode::Internal => "Internal", + ErrorCode::InvalidStatementHandle => "InvalidStatementHandle", + ErrorCode::NetworkError => "NetworkError", + ErrorCode::SqlError => "SqlError", + // Forward-compat: ErrorCode is `#[non_exhaustive]`. Any new + // variant the kernel adds in v0.x lands here until we mirror + // it in this match. The TS layer treats Unknown as a generic + // failure. + _ => "Unknown", + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn envelope_carries_sentinel_and_code() { + let e = KernelError::invalid_argument().message("hi"); + let napi_err = napi_err_from_kernel(e); + let reason = napi_err.reason.to_string(); + assert!(reason.starts_with(ERROR_SENTINEL)); + let payload = &reason[ERROR_SENTINEL.len()..]; + let v: serde_json::Value = serde_json::from_str(payload).unwrap(); + assert_eq!(v["code"], "InvalidArgument"); + assert_eq!(v["message"], "hi"); + } + + #[test] + fn message_escaping_round_trips() { + let nasty = "quote\"backslash\\newline\nctrl\u{1}end"; + let e = KernelError::internal().message(nasty); + let napi_err = napi_err_from_kernel(e); + let reason = napi_err.reason.to_string(); + let payload = &reason[ERROR_SENTINEL.len()..]; + let v: serde_json::Value = serde_json::from_str(payload).unwrap(); + assert_eq!(v["message"], nasty); + } + + /// All known kernel `ErrorCode` variants map to a non-"Unknown" + /// slug. Regression guard for the `_ => "Unknown"` fallback: if + /// a future kernel addition adds a variant and we forget to + /// extend the match here, this test still passes against the old + /// variant set but the new variant silently slugs as "Unknown". + /// That degraded behavior is what we want to catch — when this + /// test is updated for a new variant, the slug change is auditable. + #[test] + fn error_code_str_covers_all_known_variants() { + // Listing all 13 known v0 variants explicitly: this is the + // single source of truth for the wire-format `code` slug. + let cases: &[(ErrorCode, &str)] = &[ + (ErrorCode::InvalidArgument, "InvalidArgument"), + (ErrorCode::Unauthenticated, "Unauthenticated"), + (ErrorCode::PermissionDenied, "PermissionDenied"), + (ErrorCode::NotFound, "NotFound"), + (ErrorCode::ResourceExhausted, "ResourceExhausted"), + (ErrorCode::Unavailable, "Unavailable"), + (ErrorCode::Timeout, "Timeout"), + (ErrorCode::Cancelled, "Cancelled"), + (ErrorCode::DataLoss, "DataLoss"), + (ErrorCode::Internal, "Internal"), + (ErrorCode::InvalidStatementHandle, "InvalidStatementHandle"), + (ErrorCode::NetworkError, "NetworkError"), + (ErrorCode::SqlError, "SqlError"), + ]; + for (code, expected_slug) in cases { + let slug = error_code_str(*code); + assert_eq!( + slug, *expected_slug, + "ErrorCode::{:?} should slug to {:?}, got {:?}", + code, expected_slug, slug + ); + assert_ne!( + slug, "Unknown", + "ErrorCode::{:?} fell through to the Unknown fallback", + code + ); + } + } + + /// Dev-time invariant: a kernel `Error.message` that starts with + /// `ERROR_SENTINEL` is treated as a policy violation and fires the + /// `debug_assert!` in `napi_err_from_kernel`. The kernel never emits + /// such a message today; this test catches any future kernel-side + /// change that would start to. `cargo test` runs under the debug + /// profile, so the assertion is active; we use `catch_unwind` to + /// observe the panic without aborting the test process. + /// + /// This is **dev-time only on purpose**. Release builds compile + /// `debug_assert!` out, so a sentinel-prefixed kernel message would + /// be embedded inside the JSON envelope's `"message"` field + /// verbatim — well-formed JSON (serde_json escapes it correctly), + /// safe for a JSON-parsing TS reviver. The only consumers that + /// would mis-parse are naive `indexOf(SENTINEL)`-style revivers, + /// which we explicitly don't support. The deeper fix is to delete + /// the envelope scheme entirely in favour of typed errors via + /// `Env::create_error` + `set_named_property`. See + /// `sea-workflow/jira-candidates/2026-05-23-napi-typed-error-refactor.md`. + #[test] + fn sentinel_prefix_triggers_debug_assert() { + use std::panic; + + let nasty = format!("{ERROR_SENTINEL}injected"); + let prev_hook = panic::take_hook(); + panic::set_hook(Box::new(|_| {})); + let asserted = panic::catch_unwind(panic::AssertUnwindSafe(|| { + let e = KernelError::internal().message(&nasty); + let _ = napi_err_from_kernel(e); + })); + panic::set_hook(prev_hook); + assert!( + asserted.is_err(), + "debug_assert! should fire in debug builds when kernel \ + message starts with ERROR_SENTINEL — got Ok back, the \ + dev-time trap is missing" + ); + } + + /// Parity guard: the napi envelope must surface the same kernel + /// `Error` field set that pyo3's typed `KernelError` exposes via + /// `setattr`. The two bindings diverge on *wire mechanism* (typed + /// exception attrs vs JSON envelope) and on *naming convention* + /// (snake_case attrs in pyo3 vs camelCase JSON keys in napi) — but + /// the *field set* must stay aligned or downstream wrappers that + /// claim Python ↔ Node parity will silently drop information when + /// crossing the language boundary. + /// + /// pyo3 attaches via `attach_attrs(...)` in `pyo3/src/errors.rs:67`: + /// `code, message, sql_state, error_code, vendor_code, http_status, + /// retryable, query_id`. Both bindings intentionally omit `location` + /// (kernel-internal `file:line` for `Internal` errors) and `cause` + /// (recursive — needs an explicit schema decision). This test pins + /// the envelope to that 8-field contract. + /// + /// Reviewer-flagged at PR #27 / error.rs:76 — see comment text + /// `pyo3 attaches kernel error fields as Python attributes…`. + #[test] + fn envelope_field_set_matches_pyo3_setattr_contract() { + // Build a kernel error with every optional field populated so + // the conditional `if let Some(...)` branches in the encoder + // all fire and we exercise the full key set in one shot. + let mut e = KernelError::new(ErrorCode::NetworkError, "x"); + e.sql_state = Some("08000".to_string()); + e.error_code = Some("WAREHOUSE_STOPPED".to_string()); + e.vendor_code = Some(1234); + e.http_status = Some(503); + e.retryable = true; + e.query_id = Some("01eedeadbeefdeadbeefdeadbeefdead".to_string()); + // Set the *intentionally-omitted* fields too — the test should + // confirm they do NOT appear on the wire. + e.location = Some("kernel/src/foo.rs:42".to_string()); + e.cause = Some(Box::new(KernelError::internal().message("inner"))); + + let napi_err = napi_err_from_kernel(e); + let reason = napi_err.reason.to_string(); + let payload = &reason[ERROR_SENTINEL.len()..]; + let v: serde_json::Value = + serde_json::from_str(payload).expect("envelope payload must be valid JSON"); + let obj = v + .as_object() + .expect("envelope payload must be a JSON object"); + + // Mirrors pyo3's `attach_attrs` field list, in pyo3's snake_case + // → napi's camelCase. Update both lists together when the + // contract changes. + let expected_keys: &[&str] = &[ + "code", // pyo3: "code" + "message", // pyo3: "message" + "sqlState", // pyo3: "sql_state" + "errorCode", // pyo3: "error_code" + "vendorCode", // pyo3: "vendor_code" + "httpStatus", // pyo3: "http_status" + "retryable", // pyo3: "retryable" + "queryId", // pyo3: "query_id" + ]; + for k in expected_keys { + assert!( + obj.contains_key(*k), + "envelope is missing the `{k}` key — pyo3 sets this via \ + setattr, napi binding must keep parity. payload: {payload}" + ); + } + + // Intentionally-omitted fields must NOT leak into the wire + // shape (the module doc and the kernel `Error` struct both + // identify `location` and `cause` as v1-omitted). If a future + // refactor accidentally includes them, this test breaks + // before the wire contract does. + for forbidden in &["location", "cause"] { + assert!( + !obj.contains_key(*forbidden), + "v1 envelope must NOT include `{forbidden}` — see the \ + module-level doc for the rationale. payload: {payload}" + ); + } + + // No surprise keys: the wire shape stays the documented set + // (exact-size check, not subset). A future field addition + // requires updating both pyo3's attach_attrs and this list. + assert_eq!( + obj.len(), + expected_keys.len(), + "envelope has unexpected extra keys vs the pyo3 parity set. \ + expected: {expected_keys:?}, got: {:?}", + obj.keys().collect::>() + ); + } + + /// Optional fields are omitted from the wire shape when `None` (no + /// `null` entries). This keeps the envelope compact AND means a TS + /// reviver doesn't need to special-case `null` separately from + /// "key missing", matching the pyo3 side where `setattr(..., None)` + /// still leaves an attribute set to Python `None` — but the + /// downstream client adapter inspects truthy-ness either way. + #[test] + fn envelope_omits_none_optional_fields() { + let e = KernelError::invalid_argument().message("hi"); + let napi_err = napi_err_from_kernel(e); + let payload = &napi_err.reason.to_string()[ERROR_SENTINEL.len()..]; + let v: serde_json::Value = serde_json::from_str(payload).unwrap(); + let obj = v.as_object().unwrap(); + // Only the always-on fields appear: code + message. + // `retryable` defaults to `false` and is also omitted (the + // encoder branch only inserts it when `true`). + for absent in &[ + "sqlState", + "errorCode", + "vendorCode", + "httpStatus", + "retryable", + "queryId", + ] { + assert!( + !obj.contains_key(*absent), + "key `{absent}` should be omitted when kernel field is \ + None/false, got: {payload}" + ); + } + assert!(obj.contains_key("code")); + assert!(obj.contains_key("message")); + } + + #[test] + fn status_from_kernel_code_maps_special_cases() { + // Status mapping is mostly cosmetic but the 3 distinguished + // cases (InvalidArg, Cancelled, GenericFailure) are the contract. + assert_eq!( + status_from_kernel_code(ErrorCode::InvalidArgument), + Status::InvalidArg + ); + assert_eq!( + status_from_kernel_code(ErrorCode::InvalidStatementHandle), + Status::InvalidArg + ); + assert_eq!( + status_from_kernel_code(ErrorCode::Cancelled), + Status::Cancelled + ); + assert_eq!( + status_from_kernel_code(ErrorCode::Internal), + Status::GenericFailure + ); + assert_eq!( + status_from_kernel_code(ErrorCode::NetworkError), + Status::GenericFailure + ); + } +} diff --git a/napi/src/lib.rs b/napi/src/lib.rs new file mode 100644 index 00000000..b418e743 --- /dev/null +++ b/napi/src/lib.rs @@ -0,0 +1,66 @@ +// Copyright (c) 2026 Databricks, Inc. +// +// Licensed 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. + +//! `databricks-sea-native` — napi-rs binding crate for the Databricks +//! SQL Node.js driver's SEA (Statement Execution API) path. +//! +//! **Skeleton commit.** This commit lands the crate's infrastructure: +//! Cargo manifest, build script, error envelope formatter, tokio +//! runtime helper, `tracing` logger bridge, and shared utilities. +//! The actual `#[napi]` classes (`Database`, `Connection`, `Statement`, +//! `ResultStream`) are added in the follow-up commit. + +#![deny(unsafe_op_in_unsafe_fn)] +// Skeleton-PR state: every `pub(crate)` item in this crate (error +// envelope helpers, tokio Handle accessor, panic-guarded wrapper) is +// authored against the contract used by the follow-up napi-classes PR +// (#25). Until that PR lands, the lib-only build has zero production +// callers and every helper looks dead. Tests in `#[cfg(test)] mod +// tests` exercise them, which is why `cargo test` is green even +// while `cargo clippy --lib -- -D warnings` would otherwise reject +// the build. +// +// We narrow the suppression to non-test builds so the lint still +// fires on genuinely-unused test code. +#![cfg_attr(not(test), allow(dead_code))] + +#[macro_use] +extern crate napi_derive; + +pub(crate) mod error; +pub(crate) mod logger; +pub(crate) mod runtime; +pub(crate) mod util; + +/// Returns the native binding's crate version (`CARGO_PKG_VERSION`). +/// +/// Originally the round-1b smoke test; kept as a cheap "is the binding +/// loaded?" probe for the JS-side loader's structured diagnostics. +#[napi] +pub fn version() -> String { + env!("CARGO_PKG_VERSION").to_string() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn version_matches_cargo_pkg_version() { + // Doubles as the "binding loaded" smoke contract — keep this + // even when the function is otherwise inert. + assert_eq!(version(), env!("CARGO_PKG_VERSION")); + assert!(!version().is_empty()); + } +} diff --git a/napi/src/logger.rs b/napi/src/logger.rs new file mode 100644 index 00000000..ad73c2a2 --- /dev/null +++ b/napi/src/logger.rs @@ -0,0 +1,52 @@ +// Copyright (c) 2026 Databricks, Inc. +// +// Licensed 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. + +//! `tracing` → JS `DBSQLLogger` bridge via `ThreadsafeFunction`. +//! +//! **Round 3 work — empty in Round 1b.** This file is intentionally a +//! stub: the `pub(crate) mod logger;` declaration in `lib.rs` is kept +//! so the Round 3 PR landing the implementation can do so without a +//! `mod` reshuffle that ripples through every downstream stack branch. +//! +//! ## Round 3 design sketch +//! +//! The kernel emits ~46 `tracing::` events on hot paths (per-statement +//! lifecycle, retries, CloudFetch download progress). Forwarding each +//! event individually to JS via `ThreadsafeFunction::call` (≈10-50µs +//! per call) would eat the recent SELECT-1 latency wins; the bridge +//! has to batch. +//! +//! Planned shape: +//! +//! - **Kernel side:** a `tracing::Subscriber` Layer pushes events into +//! a bounded `tokio::sync::mpsc::channel` (capacity ~1024). +//! - **Drain task:** one dedicated tokio task drains the channel in +//! batches at ~100Hz and forwards each batch via a single +//! `ThreadsafeFunction::call` with +//! `ThreadsafeFunctionCallMode::NonBlocking`. +//! - **Backpressure:** drop-oldest on full channel (logs are +//! advisory; never block a kernel-side hot path on JS-side +//! back-pressure). A `dropped_log_count` counter is exposed for +//! observability. +//! - **Default level:** Subscriber-level filtering defaults to +//! `WARN` so the channel is only loaded when a JS consumer opts in +//! (`DBSQLLogger.setLevel('debug')`). +//! - **JS contract:** one-way (kernel → JS); the bridge does NOT take +//! structured arguments back from JS. +//! +//! Open questions parked for Round 3: +//! - Whether to expose span enter/exit as separate JS events or to +//! flatten to (event + parent_span_id) pairs. +//! - How to surface kernel-side `field=value` structured data without +//! `serde_json::Value`-allocating on every event. diff --git a/napi/src/runtime.rs b/napi/src/runtime.rs new file mode 100644 index 00000000..3f35a4dc --- /dev/null +++ b/napi/src/runtime.rs @@ -0,0 +1,129 @@ +// Copyright (c) 2026 Databricks, Inc. +// +// Licensed 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. + +//! Captured tokio `Handle` for napi-rs's process-global runtime. +//! +//! Per the napi-rs patterns doc (pattern #2): the first time any +//! `#[napi] async fn` runs, we are guaranteed to be on napi-rs's tokio +//! runtime. We snapshot the current `Handle` then and stash a clone in +//! a process-static `OnceCell`. Every subsequent kernel construction +//! reads the captured handle and hands a clone to the kernel, so +//! Drop-time cleanup (which runs on the V8 GC thread, *outside* any +//! tokio context) can still `spawn` cleanup tasks onto the same +//! runtime napi-rs is driving. +//! +//! `Handle::current()` MUST NOT be called from a synchronous JS-thread +//! entry point or from module init — both run before napi-rs has +//! constructed its runtime and would panic. `get()` returns `None` in +//! that case so callers can surface a useful error rather than abort. + +use once_cell::sync::OnceCell; +use tokio::runtime::Handle; + +static RUNTIME_HANDLE: OnceCell = OnceCell::new(); + +/// Capture the current tokio runtime handle on first call, return a +/// reference to the captured clone on subsequent calls. +/// +/// MUST be called from inside a `#[napi] async fn` body (or any other +/// tokio runtime context); otherwise `Handle::current()` panics on the +/// very first call. Subsequent calls are infallible and lock-free. +/// +/// Round 1b has no async entry points that exercise this yet; Round 2 +/// will call it from `Database::open()` and other `#[napi] async fn`s. +/// `try_get_handle` has a test in this crate so it's reachable from +/// the test build; `get_handle()` itself cannot be tested without a +/// real tokio runtime context and is intentionally dead until Round 2, +/// so it keeps its own `allow(dead_code)`. +/// +/// # PERF NOTE — pool sizing & sharing +/// +/// The handle returned here is napi-rs's *process-global* +/// `tokio::runtime::Runtime` (created via +/// `tokio::runtime::Runtime::new()` in +/// `napi-2.16.17/src/tokio_runtime.rs:11`). Default worker-thread count +/// is `num_cpus`. **The host's `num_cpus` is the raw CPU count, not the +/// cgroup CPU quota** — containers / serverless functions with a CPU +/// limit (k8s `resources.limits.cpu`, Lambda 0.5-vCPU plans) still get +/// a pool sized for the underlying host, which over-provisions threads +/// and inflates context-switch overhead. +/// +/// Override knobs (must be in effect *before* napi-rs initializes its +/// runtime, i.e. before the first `#[napi] async fn` runs): +/// - `TOKIO_WORKER_THREADS` env var, read by `tokio::runtime::Runtime::new()`. +/// Set this in the JS-side launcher / Docker `ENV` / k8s pod spec. +/// - `napi::create_custom_tokio_runtime(rt)` from a +/// `#[napi::module_init]` block — fully programmatic, but only the +/// binding crate can call it. +/// +/// Note: this is NOT `NAPI_RS_WORKER_THREADS`; that name does not exist +/// in napi-rs 2.x. Caveat for anyone copying patterns from older +/// napi-rs docs. +/// +/// # Pool-sharing divergence from pyo3 +/// +/// pyo3 builds a tokio runtime per `Session`. This binding shares +/// **one** global pool across every `Connection` / `Statement` / +/// `ResultStream`. CloudFetch (`src/reader/cloudfetch/`) spawns N+5 +/// concurrent tasks per active statement via the captured handle — at +/// scale (many parallel statements) the shared pool contention is the +/// dominant runtime overhead, whereas pyo3's per-session isolation +/// avoids cross-statement interference. PR #25's sizing benchmarks +/// must account for this when comparing napi vs pyo3 absolute numbers. +#[allow(dead_code)] +pub(crate) fn get_handle() -> &'static Handle { + RUNTIME_HANDLE.get_or_init(Handle::current) +} + +/// Non-panicking accessor — returns `None` if `get_handle()` has not +/// been called yet. Drop impls and other GC-thread call sites use this +/// to short-circuit cleanup when no async entry point has ever run +/// (i.e. there is no kernel state that needs closing either). +/// +// TODO(PR #25 Drop impls): spawning cleanup work on the captured +// handle from a Drop impl is racy at Node-process teardown — the +// runtime may already be in shutdown when the V8 GC reaches our +// objects, and a `Handle::spawn` on a halting runtime drops the +// future silently. napi-rs exposes `napi_add_async_cleanup_hook` +// for exactly this case: it runs the hook *before* the runtime +// stops, so kernel `Session::close()` / `Statement::close()` +// futures get a chance to finish their server-side cancel RPCs. +// PR #25 introduces the first real Drop impls; this is the lock-in +// point where the choice must be made (raw spawn vs. cleanup hook). +// See napi-rs docs `napi::env::Env::add_async_cleanup_hook`. +pub(crate) fn try_get_handle() -> Option<&'static Handle> { + RUNTIME_HANDLE.get() +} + +#[cfg(test)] +mod tests { + use super::*; + + // Note: we cannot exercise `get_handle()` from the unit-test binary + // because that would require running inside a tokio runtime context + // AND would race with `try_get_handle_returns_none_before_init` + // (the OnceCell is process-static). Round 2's `Database::open()` + // integration tests will exercise the populated path end-to-end. + // + // What we CAN test in isolation: the cold-cache accessor returns + // `None` when nothing has populated the OnceCell yet. This is the + // case Drop impls rely on (GC-thread cleanup with no live async + // entry points) and is the regression-risk path. + #[test] + fn try_get_handle_returns_none_before_init() { + // `cargo test --lib` runs each test in its own process by + // default, so we can assume the OnceCell is empty here. + assert!(try_get_handle().is_none()); + } +} diff --git a/napi/src/util.rs b/napi/src/util.rs new file mode 100644 index 00000000..ccd6c5fe --- /dev/null +++ b/napi/src/util.rs @@ -0,0 +1,156 @@ +// Copyright (c) 2026 Databricks, Inc. +// +// Licensed 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. + +//! Shared helpers — one place for the `catch_unwind` wrapping that +//! every async entry point goes through (pattern #8 in the napi-rs +//! patterns doc). One helper, called once per entry point — DRY. +//! +//! Why a helper rather than a macro: helper + `async move {}` reads +//! better at call sites and keeps the stack trace shallow when a panic +//! actually fires (a macro would expand into the caller's body). + +use std::any::Any; +use std::future::Future; +use std::panic::AssertUnwindSafe; + +use futures::FutureExt; +use napi::{Error as NapiError, Result as NapiResult, Status}; + +/// Run `fut` and convert any panic the future raises into a +/// `napi::Error` so the JS caller sees a rejected promise instead of +/// the Node process aborting. +/// +/// `catch_unwind` does not catch `std::process::abort`, double-panic, +/// or allocator OOM — those still bring down the process. That's by +/// design: a corrupted process state isn't something we can pretend to +/// recover from. +pub(crate) async fn guarded(fut: F) -> NapiResult +where + F: Future>, +{ + match AssertUnwindSafe(fut).catch_unwind().await { + Ok(res) => res, + Err(panic) => Err(NapiError::new( + Status::GenericFailure, + format!("panic in native binding: {}", panic_payload_msg(panic)), + )), + } +} + +/// Best-effort downcast of a panic payload to a human-readable string. +/// `panic!("…")` produces `&'static str` or `String`; the rest fall +/// through to a generic marker so the JS caller still sees *something*. +fn panic_payload_msg(p: Box) -> String { + if let Some(s) = p.downcast_ref::<&'static str>() { + return (*s).to_string(); + } + if let Some(s) = p.downcast_ref::() { + return s.clone(); + } + "non-string panic payload".to_string() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn guarded_returns_inner_ok() { + let result: NapiResult = guarded(async { Ok(42) }).await; + assert_eq!(result.unwrap(), 42); + } + + #[tokio::test] + async fn guarded_passes_through_inner_err() { + // An `Err` returned by the future flows out unchanged — only + // panics get rewrapped. Status::Cancelled distinguishes from + // the panic path's Status::GenericFailure. + let result: NapiResult<()> = + guarded(async { Err(NapiError::new(Status::Cancelled, "inner")) }).await; + let err = result.unwrap_err(); + assert_eq!(err.status, Status::Cancelled); + assert_eq!(err.reason, "inner"); + } + + #[tokio::test] + async fn guarded_recovers_static_str_panic() { + let result: NapiResult<()> = guarded(async { + panic!("static str panic"); + }) + .await; + let err = result.unwrap_err(); + assert_eq!(err.status, Status::GenericFailure); + assert!( + err.reason.contains("static str panic"), + "expected panic message in reason, got: {}", + err.reason + ); + assert!(err.reason.starts_with("panic in native binding: ")); + } + + #[tokio::test] + async fn guarded_recovers_owned_string_panic() { + let result: NapiResult<()> = guarded(async { + let msg = format!("owned String panic at {}", 42); + panic!("{}", msg); + }) + .await; + let err = result.unwrap_err(); + assert_eq!(err.status, Status::GenericFailure); + assert!( + err.reason.contains("owned String panic at 42"), + "expected formatted panic in reason, got: {}", + err.reason + ); + } + + /// Compile-time guard: `panic = "abort"` MUST NOT be active for + /// any profile this crate builds under. `catch_unwind` (which + /// `guarded` depends on) becomes a process-aborting no-op under + /// `panic = "abort"`, turning a recoverable per-statement panic + /// into a fleet-wide Node-process exit. + /// + /// `compile_error!` inside a `#[cfg(panic = "abort")]` block fails + /// the build with a clear message rather than letting tests pass + /// against a binary that would crash production. The + /// `#[allow(unexpected_cfgs)]` is so the `cfg(panic = ...)` check + /// itself is recognised by rustc's lint as a known cfg key. + #[allow(unexpected_cfgs)] + const _: () = { + #[cfg(panic = "abort")] + compile_error!( + "panic = \"abort\" disables catch_unwind, breaking util::guarded \ + and turning recoverable per-statement panics into Node-process \ + aborts. See [profile.release] comment in napi/Cargo.toml." + ); + }; + + #[tokio::test] + async fn guarded_recovers_non_string_panic() { + // panic_any with a non-(str|String) payload — these fall + // through to the "non-string panic payload" branch. Important + // because third-party crates sometimes panic with custom types. + let result: NapiResult<()> = guarded(async { + std::panic::panic_any(42i32); + }) + .await; + let err = result.unwrap_err(); + assert_eq!(err.status, Status::GenericFailure); + assert!( + err.reason.contains("non-string panic payload"), + "expected non-string marker in reason, got: {}", + err.reason + ); + } +}