The Rust binding source lives in the kernel repo at
databricks-sql-kernel/napi/. Building it requires a local checkout
of that repo — see "Build for local dev" below. The published npm
package is @databricks/databricks-sql-kernel-<triple>.
The napi crate is a standalone Cargo workspace ([workspace] members = ["."] in napi/Cargo.toml), not a sibling of pyo3/
in the kernel root workspace.
The reason is Cargo feature unification. pyo3 builds the kernel with
the default tls-native feature (system OpenSSL via native-tls).
The napi crate has to opt INTO tls-rustls instead: napi modules are
loaded into Node.js processes that statically link OpenSSL 3.x, and
dynamically linking the system's OpenSSL 1.1 (which native-tls
pulls in on Linux) collides with Node's symbols at module-load time
and segfaults the process before any Rust code runs. rustls is
pure Rust + ring and avoids the conflict entirely.
If napi lived in the same workspace as pyo3, 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 same clash. Standalone-workspace is the fix.
index.d.ts— TypeScript declarations consumed bylib/sea/. Generated by napi-rs from the Rust source; checked in as the consumer-facing type contract.index.js— napi-rs's per-platform router shim. Gitignored; populated bynpm run build:nativefor local dev. In published tarballs it ships alongside the.d.tsandrequire()s the right@databricks/databricks-sql-kernel-<triple>optional dependency.index.*.node— the actual native binary, one per platform. Gitignored. In production these live in the per-triple optional dependencies (@databricks/databricks-sql-kernel-linux-x64-gnu, etc.); for local devnpm run build:nativecopies one into this directory.
# From the nodejs repo root:
export DATABRICKS_SQL_KERNEL_REPO=/path/to/your/databricks-sql-kernel
npm run build:native # release build (default)
BUILD_PROFILE= npm run build:native # debug build (empty BUILD_PROFILE drops --release)DATABRICKS_SQL_KERNEL_REPO points at the kernel repo root (the
directory containing napi/) and is required when your kernel
checkout isn't at ../../databricks-sql-kernel relative to the
nodejs repo.
At release time the kernel's CI publishes
@databricks/databricks-sql-kernel-<triple> npm packages — one per supported
platform — each containing a single .node binary. native/sea/index.js
(the napi-rs router) require()s the package matching the consumer's
process.platform / process.arch at load time.
M0 status: these per-platform packages are not yet published, so they are intentionally not declared in the driver's
optionalDependencies. (npm refuses annpm ciagainst a pinned dependency it cannot resolve from the registry, so declaring an unpublished package would break every install.) Until they ship, the binding is produced locally vianpm run build:native(which copiesindex.<triple>.nodeinto this directory). Once the packages are published, add@databricks/databricks-sql-kernel-<triple>back tooptionalDependencies— npm then installs only the matching one.
M0 targets a single triple: linux-x64-gnu (package
@databricks/databricks-sql-kernel-linux-x64-gnu, once published).
On every other platform (macOS, Windows, linux-arm64, linux-x64-musl
/ Alpine, …) the SEA binding is simply absent: SeaNativeLoader
returns undefined from tryGet() / throws a structured
MODULE_NOT_FOUND hint from get(), and the driver continues to use
the Thrift backend exclusively. This is expected, not a regression —
additional triples are added to optionalDependencies as the kernel
CI starts publishing them in later milestones.
The unpublished triple names (@databricks/databricks-sql-kernel-darwin-arm64,
…-win32-x64-msvc, etc.) referenced by the router are not
squat-able: @databricks is a Databricks-owned npm scope, and npm
only allows org members to publish under a scope it owns. A third
party therefore cannot register @databricks/databricks-sql-kernel-* and have
the router autoload it. No placeholder packages are required.