Published SDK builds currently expose local SQL computed columns and materialized-view execution that are not ready for release. Add the opt-in `experimental-functions` Cargo feature to the Rust core and forward it through the Python and Node bindings; published packages leave it disabled. Local declarations and refreshes now return `NotSupported` before mutating tables or spawning jobs, including prepared materialized-view creation. Remote Cloud/Enterprise client operations, Python UDF packaging, ordinary eager `add_columns`, and access to existing data remain available. Stored metadata and write protections stay active, and shared server commit helpers remain usable. CI covers both feature configurations. Existing local execution tests run with the feature enabled; default-build regressions cover early rejection, unchanged table versions, existing metadata protections, and normal eager transforms. API and source-build documentation explain the opt-in. Validation: Rust library tests pass with the feature disabled (1,869 tests) and enabled (1,947 tests), plus three default-build integration regressions. Python and TypeScript bindings were rebuilt and tested in both configurations, including mocked remote requests; Rust formatting, Python package lint, TypeScript lint/build, and generated docs were checked. Repository-wide Ruff still reports 48 pre-existing errors in unchanged `docs/web-tests` files.
2.3 KiB
Contributing to LanceDB Typescript
This document outlines the process for contributing to LanceDB Typescript. For general contribution guidelines, see CONTRIBUTING.md.
Project layout
The Typescript package is a wrapper around the Rust library, lancedb. We use
the napi-rs library to create the bindings between Rust and
Typescript.
src/: Rust bindings source codelancedb/: Typescript package source code__test__/: Unit testsexamples/: A pnpm package with the examples shown in the documentation
Development environment
To set up your development environment, you will need to install the following:
- Node.js 22 or later (required by pnpm 11)
- pnpm 11 or later (or run via
corepack enable, which uses thepackageManagerfield inpackage.json) - Rust's package manager, Cargo. Use rustup to install.
- protoc (Protocol Buffers compiler)
Initial setup:
pnpm install
Commit Hooks
It is highly recommended to install the pre-commit hooks to ensure that your code is formatted correctly and passes basic checks before committing:
pre-commit install
Development
Most common development commands can be run using the pnpm scripts.
Build the package
pnpm install
pnpm build
Local SQL computed columns and materialized-view creation/refresh are experimental and disabled in published packages. To opt in when building from this directory:
pnpm build:debug --features experimental-functions
pnpm tsc
pnpm test --runInBand table.test.ts materialized_view.test.ts
Rebuild without --features experimental-functions to test the default package.
The tests detect the compiled feature; remote operations, metadata protections,
and ordinary eager addColumns transforms remain available in both builds.
Lint:
pnpm lint
Format and fix lints:
pnpm lint-fix
Run tests:
pnpm test
To run a single test:
# Single file: table.test.ts
pnpm test -- table.test.ts
# Single test: 'merge insert' in table.test.ts
pnpm test -- table.test.ts --testNamePattern=merge\ insert