Skip to content

Commit 5c04082

Browse files
committed
sea-napi-binding: relocate Rust source to kernel workspace
Per D-006 architectural decision (Python team's workspace pattern): all language bindings (PyO3, napi-rs) now live as workspace siblings in the kernel repo at databricks-sql-kernel/{pyo3,napi}/. What this commit removes from the nodejs repo: - native/sea/Cargo.toml (path dep relocated; package now at databricks-sql-kernel/napi/Cargo.toml with path = "..") - native/sea/build.rs - native/sea/src/* (lib, runtime, database, connection, statement, result, error, logger, util — all 9 files) - native/sea/package.json (the @databricks/sea-native-linux-x64-gnu sub-package moves to the kernel workspace too) - native/sea/index.js (regenerated artifact) What stays in nodejs: - native/sea/index.d.ts — TS declarations consumed by lib/sea/ adapter - native/sea/README.md (new) — explains the move; points readers at databricks-sql-kernel/napi/ What's updated: - package.json: `build:native` and `build:native:debug` scripts now delegate to the kernel workspace via $DATABRICKS_SQL_KERNEL_REPO (defaults to ../../databricks-sql-kernel-sea-WT/napi-binding for the local dev worktree layout). Build copies index.node + index.d.ts back into native/sea/ for the loader to find. Why workspace co-location: - Arrow version pinning lockstep — no silent IPC version drift - path = ".." (clean) vs ../../../../databricks-sql-kernel-sea-WT/... - Single CI: cargo build --workspace covers kernel + pyo3 + napi - Kernel API changes that break either binding caught at PR-review time - Future cgo binding for Go SEA slots in as another workspace member This branch (sea-napi-binding) is now a thin consumer of the kernel napi crate. The actual Rust code lives at krn-napi-binding HEAD on the kernel repo (commit debe3d7).
1 parent 685098a commit 5c04082

16 files changed

Lines changed: 44 additions & 1268 deletions

native/sea/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

native/sea/Cargo.toml

Lines changed: 0 additions & 64 deletions
This file was deleted.

native/sea/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# `native/sea/` — consumer-side directory for the Rust napi binding
2+
3+
**The Rust binding source lives in the kernel repo** at
4+
`databricks-sql-kernel/napi/`, as a workspace sibling of `pyo3/`.
5+
See `databricks-sql-kernel`'s root `Cargo.toml` `[workspace] members`.
6+
7+
## Why
8+
9+
Per the architectural decision recorded in
10+
`sea-workflow/decisions.md` (D-006), every language binding (PyO3,
11+
napi-rs, future cgo) is a workspace member of the kernel crate. This
12+
keeps Arrow version pinning lockstep, the path dep clean (`path = ".."`),
13+
and CI single (`cargo build --workspace`). The pattern matches polars,
14+
ruff, arrow-rs.
15+
16+
## What lives here
17+
18+
- `index.d.ts` — generated TypeScript declarations consumed by `lib/sea/`
19+
- `index.linux-x64-gnu.node` (and other platform variants) — symlinked
20+
or copied build artifacts from the kernel workspace at run time
21+
22+
## How to build the binding for local dev
23+
24+
```bash
25+
# From the nodejs repo root:
26+
npm run build:native
27+
# which delegates to the kernel workspace:
28+
# cd $DATABRICKS_SQL_KERNEL_REPO/napi && napi build --release
29+
# and copies the artifact back here
30+
```
31+
32+
`$DATABRICKS_SQL_KERNEL_REPO` defaults to a path published with the
33+
release flow; for dev it points at a local checkout of
34+
`databricks-sql-kernel`.
35+
36+
## How to consume in production
37+
38+
At release time the kernel CI publishes `@databricks/sea-native-<triple>`
39+
npm packages with the `.node` binaries. The nodejs driver declares them
40+
as `optionalDependencies` in `package.json`; `SeaNativeLoader.ts`
41+
resolves the right one at runtime.

native/sea/build.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)