mirror of
https://github.com/lancedb/lancedb.git
synced 2026-08-27 08:28:28 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 01c6b9dcb8 | |||
| 33a13f0738 | |||
| cabc75f167 |
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"interface": {
|
|
||||||
"displayName": "LanceDB"
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"source": {
|
|
||||||
"source": "local",
|
|
||||||
"path": "./plugins/lancedb"
|
|
||||||
},
|
|
||||||
"policy": {
|
|
||||||
"installation": "AVAILABLE",
|
|
||||||
"authentication": "ON_INSTALL"
|
|
||||||
},
|
|
||||||
"category": "Developer Tools"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# Agent Skills
|
|
||||||
|
|
||||||
This directory contains repo-scoped code agent skills for the LanceDB project.
|
|
||||||
|
|
||||||
Each skill is a folder that contains a required `SKILL.md` and optional bundled resources.
|
|
||||||
|
|
||||||
Codex discovers skills from `.agents/skills` in the current working directory and parent directories.
|
|
||||||
|
|
||||||
The `lancedb` skill lives in the `plugins/lancedb` plugin (see `plugins/lancedb/skills/lancedb`)
|
|
||||||
so it can be installed via the plugin marketplaces (`.claude-plugin/marketplace.json` and
|
|
||||||
`.agents/plugins/marketplace.json`); the `lancedb` entry here is a symlink into that plugin.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../plugins/lancedb/skills/lancedb
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
---
|
|
||||||
name: lancedb-update-lance-dependency
|
|
||||||
description: Update LanceDB to a specific Lance release or tag. Use when bumping Lance dependencies in the lancedb repository, including Rust workspace Lance crates, Java lance-core, validation, branch creation, commit, push, and PR creation when requested.
|
|
||||||
---
|
|
||||||
|
|
||||||
# LanceDB Update Lance Dependency
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
Use this skill in the `lancedb/lancedb` repository when updating the Lance dependency to a specific Lance version or tag.
|
|
||||||
|
|
||||||
Inputs can be a version (`7.2.0-beta.1`), a tag (`v7.2.0-beta.1`), a tag ref (`refs/tags/v7.2.0-beta.1`), or `latest`.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. Confirm the worktree status with `git status --short`.
|
|
||||||
2. Resolve the target Lance version:
|
|
||||||
|
|
||||||
- If the input is `latest`, empty, or omitted, run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/check_lance_release.py
|
|
||||||
```
|
|
||||||
|
|
||||||
Parse the JSON output. If `needs_update` is not `true`, stop without creating a PR. Otherwise use `latest_tag`.
|
|
||||||
|
|
||||||
- If the input is explicit, use it directly.
|
|
||||||
|
|
||||||
3. Compute update metadata without changing files:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/update_lance_dependency.py "$TAG_OR_VERSION" --metadata-only
|
|
||||||
```
|
|
||||||
|
|
||||||
Before making changes, check for an existing open PR with the emitted `pr_title`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gh pr list --search "\"$PR_TITLE\" in:title" --state open --limit 1 --json number,url,title
|
|
||||||
```
|
|
||||||
|
|
||||||
If a matching open PR exists, stop and report it instead of creating a duplicate.
|
|
||||||
|
|
||||||
4. Run the deterministic update entrypoint:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/update_lance_dependency.py "$TAG_OR_VERSION"
|
|
||||||
```
|
|
||||||
|
|
||||||
This updates the Rust workspace Lance dependencies through `ci/set_lance_version.py`, updates `java/pom.xml`, refreshes Cargo metadata, and prints JSON metadata containing `branch_name`, `commit_message`, and `pr_title`.
|
|
||||||
|
|
||||||
5. Run validation:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cargo clippy --quiet --workspace --tests --all-features -- -D warnings
|
|
||||||
cargo fmt --all --quiet
|
|
||||||
```
|
|
||||||
|
|
||||||
Fix real diagnostics and rerun clippy until it succeeds. Do not skip warnings.
|
|
||||||
|
|
||||||
6. Inspect `git status --short` and `git diff` to ensure only the Lance dependency update and required compatibility fixes are present.
|
|
||||||
|
|
||||||
7. If the task only asks to prepare local changes, stop here and report the changed files and validation result.
|
|
||||||
|
|
||||||
8. If the task asks to publish the update, create a branch using the printed `branch_name`, stage all relevant files, and commit using the printed `commit_message`. Do not amend or rewrite existing commits.
|
|
||||||
|
|
||||||
9. Push to `origin`. Before creating the PR, check that the current token has push permission:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gh api repos/lancedb/lancedb --jq .permissions.push
|
|
||||||
```
|
|
||||||
|
|
||||||
If the remote branch already exists for the same generated branch name, delete the remote ref with `gh api -X DELETE repos/lancedb/lancedb/git/refs/heads/$BRANCH_NAME`, then push. Do not force-push.
|
|
||||||
|
|
||||||
10. Create a PR targeting `main` with the printed `pr_title`. If there is no PR template, keep the body to two or three concise sentences: state the Lance dependency bump, note any required compatibility fixes, and link the triggering Lance tag or release.
|
|
||||||
|
|
||||||
11. Read back the remote PR title after creation. If it is not a Conventional Commit title, fix it immediately.
|
|
||||||
|
|
||||||
12. When running in GitHub Actions after creating the LanceDB PR, trigger the Sophon dependency update:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gh workflow run codex-bump-lancedb-lance.yml \
|
|
||||||
--repo lancedb/sophon \
|
|
||||||
-f lance_ref="$LANCE_TAG" \
|
|
||||||
-f lancedb_ref="$BRANCH_NAME"
|
|
||||||
gh run list --repo lancedb/sophon --workflow codex-bump-lancedb-lance.yml --limit 1 --json databaseId,url,displayTitle
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the emitted metadata `tag` value as `LANCE_TAG`. Do this only after a new LanceDB PR has been created. If the update was skipped because no update is needed or an open PR already exists, do not trigger Sophon.
|
|
||||||
|
|
||||||
## GitHub Actions
|
|
||||||
|
|
||||||
When this skill is used from GitHub Actions, `TAG`, `GH_TOKEN`, and `GITHUB_TOKEN` may already be set. Resolve `latest` first when `TAG` is empty. Once an explicit tag or version is known, use:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 ci/update_lance_dependency.py "$TAG" --github-output "$GITHUB_OUTPUT"
|
|
||||||
```
|
|
||||||
|
|
||||||
Then use the emitted `branch_name`, `commit_message`, and `pr_title` values for branch, commit, and PR creation.
|
|
||||||
+1
-10
@@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.37.1-beta.0"
|
current_version = "0.27.0-beta.3"
|
||||||
parse = """(?x)
|
parse = """(?x)
|
||||||
(?P<major>0|[1-9]\\d*)\\.
|
(?P<major>0|[1-9]\\d*)\\.
|
||||||
(?P<minor>0|[1-9]\\d*)\\.
|
(?P<minor>0|[1-9]\\d*)\\.
|
||||||
@@ -23,8 +23,6 @@ allow_dirty = true
|
|||||||
commit = true
|
commit = true
|
||||||
message = "Bump version: {current_version} → {new_version}"
|
message = "Bump version: {current_version} → {new_version}"
|
||||||
commit_args = ""
|
commit_args = ""
|
||||||
# bump-my-version >=1.4.0 rejects pre_commit_hooks containing shell syntax unless opted in.
|
|
||||||
allow_shell_hooks = true
|
|
||||||
|
|
||||||
# Java maven files
|
# Java maven files
|
||||||
pre_commit_hooks = [
|
pre_commit_hooks = [
|
||||||
@@ -75,13 +73,6 @@ filename = "nodejs/Cargo.toml"
|
|||||||
replace = "\nversion = \"{new_version}\""
|
replace = "\nversion = \"{new_version}\""
|
||||||
search = "\nversion = \"{current_version}\""
|
search = "\nversion = \"{current_version}\""
|
||||||
|
|
||||||
# The Python package takes its version from here (pyproject.toml declares
|
|
||||||
# `dynamic = ["version"]`, so maturin reads it out of the crate manifest).
|
|
||||||
[[tool.bumpversion.files]]
|
|
||||||
filename = "python/Cargo.toml"
|
|
||||||
replace = "\nversion = \"{new_version}\""
|
|
||||||
search = "\nversion = \"{current_version}\""
|
|
||||||
|
|
||||||
# Java documentation
|
# Java documentation
|
||||||
[[tool.bumpversion.files]]
|
[[tool.bumpversion.files]]
|
||||||
filename = "docs/src/java/java.md"
|
filename = "docs/src/java/java.md"
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"owner": {
|
|
||||||
"name": "LanceDB"
|
|
||||||
},
|
|
||||||
"description": "LanceDB plugins for Claude Code.",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "lancedb",
|
|
||||||
"source": "./plugins/lancedb",
|
|
||||||
"description": "Write, review, debug, and document LanceDB pipelines in Python and TypeScript that work across local LanceDB OSS tables and remote LanceDB Enterprise/Cloud tables.",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"author": {
|
|
||||||
"name": "LanceDB"
|
|
||||||
},
|
|
||||||
"category": "development"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -18,6 +18,6 @@ body:
|
|||||||
label: Link
|
label: Link
|
||||||
description: >
|
description: >
|
||||||
Provide a link to the existing documentation, if applicable.
|
Provide a link to the existing documentation, if applicable.
|
||||||
placeholder: ex. https://docs.lancedb.com/tables/...
|
placeholder: ex. https://lancedb.com/docs/tables/...
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -27,31 +27,19 @@ runs:
|
|||||||
# Extract failed job names
|
# Extract failed job names
|
||||||
FAILED_JOBS=$(echo "$JOB_RESULTS" | jq -r 'to_entries | map(select(.value.result == "failure")) | map(.key) | join(", ")')
|
FAILED_JOBS=$(echo "$JOB_RESULTS" | jq -r 'to_entries | map(select(.value.result == "failure")) | map(.key) | join(", ")')
|
||||||
|
|
||||||
TITLE="$WORKFLOW_NAME Failed ($FAILED_JOBS)"
|
# Create issue with workflow name, failed jobs, and run URL
|
||||||
|
gh issue create \
|
||||||
# This action now also runs on nightly schedules, so a breakage that
|
--title "$WORKFLOW_NAME Failed ($FAILED_JOBS)" \
|
||||||
# persists for a few days would otherwise file one issue per night.
|
--body "The workflow **$WORKFLOW_NAME** failed during execution.
|
||||||
# Comment on the open report instead when one already exists.
|
|
||||||
EXISTING=$(gh issue list --state open --label ci --limit 100 --json number,title \
|
|
||||||
| jq -r --arg title "$TITLE" 'map(select(.title == $title)) | .[0].number // empty')
|
|
||||||
|
|
||||||
if [ -n "$EXISTING" ]; then
|
|
||||||
gh issue comment "$EXISTING" --body "Failed again: $RUN_URL"
|
|
||||||
echo "Commented on existing issue #$EXISTING"
|
|
||||||
else
|
|
||||||
gh issue create \
|
|
||||||
--title "$TITLE" \
|
|
||||||
--body "The workflow **$WORKFLOW_NAME** failed during execution.
|
|
||||||
|
|
||||||
**Failed jobs:** $FAILED_JOBS
|
**Failed jobs:** $FAILED_JOBS
|
||||||
|
|
||||||
**Run URL:** $RUN_URL
|
**Run URL:** $RUN_URL
|
||||||
|
|
||||||
Please investigate the failed jobs and address any issues." \
|
Please investigate the failed jobs and address any issues." \
|
||||||
--label "ci"
|
--label "ci"
|
||||||
|
|
||||||
echo "Issue created successfully"
|
echo "Issue created successfully"
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "No job failures detected, skipping issue creation"
|
echo "No job failures detected, skipping issue creation"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
version: 2
|
|
||||||
|
|
||||||
# Scope: the root Cargo workspace, which produces the Rust binaries we
|
|
||||||
# ship to users (the Node.js and Python native extensions). The
|
|
||||||
# `rust/lancedb` library crate shares the same lockfile; its consumers
|
|
||||||
# pick their own dependency versions, but bumping transitive deps here
|
|
||||||
# keeps the binaries we ship current.
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: cargo
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
open-pull-requests-limit: 10
|
|
||||||
# Only update Cargo.lock, never widen/raise the version requirements in
|
|
||||||
# Cargo.toml. The goal is keeping the lockfile (and the binaries we ship)
|
|
||||||
# current on security fixes, not forcing our library's consumers onto
|
|
||||||
# newer minimum versions.
|
|
||||||
versioning-strategy: lockfile-only
|
|
||||||
groups:
|
|
||||||
rust-minor-patch:
|
|
||||||
update-types:
|
|
||||||
- minor
|
|
||||||
- patch
|
|
||||||
|
|
||||||
- package-ecosystem: pip
|
|
||||||
directory: /python
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
# Only update uv.lock, never widen version requirements in pyproject.toml.
|
|
||||||
versioning-strategy: lockfile-only
|
|
||||||
groups:
|
|
||||||
python-deps:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
@@ -18,35 +18,13 @@ inputs:
|
|||||||
description: "The manylinux version to build for"
|
description: "The manylinux version to build for"
|
||||||
required: false
|
required: false
|
||||||
default: "2_17"
|
default: "2_17"
|
||||||
package-name:
|
|
||||||
description: "Override [project] name in python/pyproject.toml (e.g. 'lancedb-compat'). Default keeps 'lancedb'."
|
|
||||||
required: false
|
|
||||||
default: "lancedb"
|
|
||||||
rustflags:
|
|
||||||
description: "RUSTFLAGS for the build container, as a single whitespace-free token (e.g. '-Ctarget-cpu=x86-64-v2'). Empty leaves RUSTFLAGS unset, keeping the defaults from .cargo/config.toml."
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: CONFIRM ARM BUILD
|
- name: CONFIRM ARM BUILD
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
ARM_BUILD: ${{ inputs.arm-build }}
|
|
||||||
run: |
|
run: |
|
||||||
echo "ARM BUILD: $ARM_BUILD"
|
echo "ARM BUILD: ${{ inputs.arm-build }}"
|
||||||
- name: Patch package name for variant build
|
|
||||||
if: ${{ inputs.package-name != 'lancedb' }}
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
PACKAGE_NAME: ${{ inputs.package-name }}
|
|
||||||
run: |
|
|
||||||
# Swap the [project] name so this build produces e.g. lancedb-compat
|
|
||||||
# wheels. The package still installs files under the lancedb/
|
|
||||||
# namespace -- import lancedb still works after pip install.
|
|
||||||
sed -i.bak 's/^name = "lancedb"$/name = "'"$PACKAGE_NAME"'"/' python/pyproject.toml
|
|
||||||
rm -f python/pyproject.toml.bak
|
|
||||||
grep '^name = ' python/pyproject.toml
|
|
||||||
- name: Build x86_64 Manylinux wheel
|
- name: Build x86_64 Manylinux wheel
|
||||||
if: ${{ inputs.arm-build == 'false' }}
|
if: ${{ inputs.arm-build == 'false' }}
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
@@ -54,16 +32,15 @@ runs:
|
|||||||
maturin-version: "1.12.4"
|
maturin-version: "1.12.4"
|
||||||
command: build
|
command: build
|
||||||
working-directory: python
|
working-directory: python
|
||||||
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/' -e PROTOC=/usr/local/bin/protoc ${{ inputs.rustflags != '' && format('-e RUSTFLAGS={0}', inputs.rustflags) || '' }}"
|
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/'"
|
||||||
target: x86_64-unknown-linux-gnu
|
target: x86_64-unknown-linux-gnu
|
||||||
manylinux: ${{ inputs.manylinux }}
|
manylinux: ${{ inputs.manylinux }}
|
||||||
args: ${{ inputs.args }}
|
args: ${{ inputs.args }}
|
||||||
before-script-linux: |
|
before-script-linux: |
|
||||||
set -e
|
set -e
|
||||||
curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-x86_64.zip -o /tmp/protoc.zip
|
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-$(uname -m).zip > /tmp/protoc.zip \
|
||||||
unzip /tmp/protoc.zip -d /usr/local
|
&& unzip /tmp/protoc.zip -d /usr/local \
|
||||||
rm /tmp/protoc.zip
|
&& rm /tmp/protoc.zip
|
||||||
/usr/local/bin/protoc --version
|
|
||||||
- name: Build Arm Manylinux Wheel
|
- name: Build Arm Manylinux Wheel
|
||||||
if: ${{ inputs.arm-build == 'true' }}
|
if: ${{ inputs.arm-build == 'true' }}
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
@@ -71,14 +48,13 @@ runs:
|
|||||||
maturin-version: "1.12.4"
|
maturin-version: "1.12.4"
|
||||||
command: build
|
command: build
|
||||||
working-directory: python
|
working-directory: python
|
||||||
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/' -e PROTOC=/usr/local/bin/protoc ${{ inputs.rustflags != '' && format('-e RUSTFLAGS={0}', inputs.rustflags) || '' }}"
|
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/'"
|
||||||
target: aarch64-unknown-linux-gnu
|
target: aarch64-unknown-linux-gnu
|
||||||
manylinux: ${{ inputs.manylinux }}
|
manylinux: ${{ inputs.manylinux }}
|
||||||
args: ${{ inputs.args }}
|
args: ${{ inputs.args }}
|
||||||
before-script-linux: |
|
before-script-linux: |
|
||||||
set -e
|
set -e
|
||||||
yum install -y clang
|
yum install -y clang \
|
||||||
curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-aarch_64.zip -o /tmp/protoc.zip
|
&& curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-aarch_64.zip > /tmp/protoc.zip \
|
||||||
unzip /tmp/protoc.zip -d /usr/local
|
&& unzip /tmp/protoc.zip -d /usr/local \
|
||||||
rm /tmp/protoc.zip
|
&& rm /tmp/protoc.zip
|
||||||
/usr/local/bin/protoc --version
|
|
||||||
|
|||||||
@@ -29,3 +29,7 @@ runs:
|
|||||||
args: ${{ inputs.args }}
|
args: ${{ inputs.args }}
|
||||||
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/'"
|
docker-options: "-e PIP_EXTRA_INDEX_URL='https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/'"
|
||||||
working-directory: python
|
working-directory: python
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows-wheels
|
||||||
|
path: python\target\wheels
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ on:
|
|||||||
# We don't publish pre-releases for Rust. Crates.io is just a source
|
# We don't publish pre-releases for Rust. Crates.io is just a source
|
||||||
# distribution, so we don't need to publish pre-releases.
|
# distribution, so we don't need to publish pre-releases.
|
||||||
- "v*-beta*"
|
- "v*-beta*"
|
||||||
|
- "*-v*" # for example, python-vX.Y.Z
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# This env var is used by Swatinem/rust-cache@v2 for the cache
|
# This env var is used by Swatinem/rust-cache@v2 for the cache
|
||||||
@@ -24,7 +25,7 @@ jobs:
|
|||||||
# Only runs on tags that matches the make-release action
|
# Only runs on tags that matches the make-release action
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: rust
|
workspaces: rust
|
||||||
@@ -46,7 +47,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -36,18 +36,16 @@ jobs:
|
|||||||
echo "guidelines = ${{ inputs.guidelines }}"
|
echo "guidelines = ${{ inputs.guidelines }}"
|
||||||
|
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
# pnpm 11 (used by the nodejs install step below) requires
|
node-version: 20
|
||||||
# Node >= 22.13; use 24 since 22 hits EOL in October.
|
|
||||||
node-version: 24
|
|
||||||
|
|
||||||
- name: Install Codex CLI
|
- name: Install Codex CLI
|
||||||
run: npm install -g @openai/codex
|
run: npm install -g @openai/codex
|
||||||
@@ -81,14 +79,10 @@ jobs:
|
|||||||
java-version: '11'
|
java-version: '11'
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
- name: Setup pnpm
|
|
||||||
uses: pnpm/action-setup@v6
|
|
||||||
with:
|
|
||||||
version: 11.1.1
|
|
||||||
- name: Install Node.js dependencies for TypeScript bindings
|
- name: Install Node.js dependencies for TypeScript bindings
|
||||||
run: |
|
run: |
|
||||||
cd nodejs
|
cd nodejs
|
||||||
pnpm install --frozen-lockfile
|
npm ci
|
||||||
|
|
||||||
- name: Configure git user
|
- name: Configure git user
|
||||||
run: |
|
run: |
|
||||||
@@ -143,7 +137,7 @@ jobs:
|
|||||||
- For Rust test failures: Run the specific test with "cargo test -p <crate> <test_name>"
|
- For Rust test failures: Run the specific test with "cargo test -p <crate> <test_name>"
|
||||||
- For Python test failures: Build with "cd python && maturin develop" then run "pytest <specific_test_file>::<test_name>"
|
- For Python test failures: Build with "cd python && maturin develop" then run "pytest <specific_test_file>::<test_name>"
|
||||||
- For Java test failures: Run "cd java && mvn test -Dtest=<TestClass>#<testMethod>"
|
- For Java test failures: Run "cd java && mvn test -Dtest=<TestClass>#<testMethod>"
|
||||||
- For TypeScript test failures: Run "cd nodejs && pnpm build && pnpm test -- --testNamePattern='<test_name>'"
|
- For TypeScript test failures: Run "cd nodejs && npm run build && npm test -- --testNamePattern='<test_name>'"
|
||||||
- Do NOT run the full test suite - only run the tests that were failing
|
- Do NOT run the full test suite - only run the tests that were failing
|
||||||
|
|
||||||
7. If the additional guidelines are provided, follow them as well.
|
7. If the additional guidelines are provided, follow them as well.
|
||||||
|
|||||||
@@ -4,16 +4,14 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: "Tag name from Lance. If omitted, the skill will use the latest Lance release that needs an update."
|
description: "Tag name from Lance"
|
||||||
required: false
|
required: true
|
||||||
default: ""
|
|
||||||
type: string
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: "Tag name from Lance. Leave empty to use the latest Lance release that needs an update."
|
description: "Tag name from Lance"
|
||||||
required: false
|
required: true
|
||||||
default: ""
|
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -27,16 +25,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Show inputs
|
- name: Show inputs
|
||||||
run: |
|
run: |
|
||||||
echo "tag = ${{ inputs.tag || 'latest' }}"
|
echo "tag = ${{ inputs.tag }}"
|
||||||
|
|
||||||
- name: Checkout Repo LanceDB
|
- name: Checkout Repo LanceDB
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
@@ -73,21 +71,65 @@ jobs:
|
|||||||
OPENAI_API_KEY: ${{ secrets.CODEX_TOKEN }}
|
OPENAI_API_KEY: ${{ secrets.CODEX_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
TARGET_TAG="${TAG:-latest}"
|
VERSION="${TAG#refs/tags/}"
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
|
BRANCH_NAME="codex/update-lance-${VERSION//[^a-zA-Z0-9]/-}"
|
||||||
|
|
||||||
|
# Use "chore" for beta/rc versions, "feat" for stable releases
|
||||||
|
if [[ "${VERSION}" == *beta* ]] || [[ "${VERSION}" == *rc* ]]; then
|
||||||
|
COMMIT_TYPE="chore"
|
||||||
|
else
|
||||||
|
COMMIT_TYPE="feat"
|
||||||
|
fi
|
||||||
|
|
||||||
cat <<EOF >/tmp/codex-prompt.txt
|
cat <<EOF >/tmp/codex-prompt.txt
|
||||||
You are running inside the lancedb repository on a GitHub Actions runner.
|
You are running inside the lancedb repository on a GitHub Actions runner. Update the Lance dependency to version ${VERSION} and prepare a pull request for maintainers to review.
|
||||||
|
|
||||||
Use \$lancedb-update-lance-dependency with target "${TARGET_TAG}".
|
Follow these steps exactly:
|
||||||
|
1. Use script "ci/set_lance_version.py" to update Lance Rust dependencies. The script already refreshes Cargo metadata, so allow it to finish even if it takes time.
|
||||||
|
2. Update the Java lance-core dependency version in "java/pom.xml": change the "<lance-core.version>...</lance-core.version>" property to "${VERSION}".
|
||||||
|
3. Run "cargo clippy --workspace --tests --all-features -- -D warnings". If diagnostics appear, fix them yourself and rerun clippy until it exits cleanly. Do not skip any warnings.
|
||||||
|
4. After clippy succeeds, run "cargo fmt --all" to format the workspace.
|
||||||
|
5. Ensure the repository is clean except for intentional changes. Inspect "git status --short" and "git diff" to confirm the dependency update and any required fixes.
|
||||||
|
6. Create and switch to a new branch named "${BRANCH_NAME}" (replace any duplicated hyphens if necessary).
|
||||||
|
7. Stage all relevant files with "git add -A". Commit using the message "${COMMIT_TYPE}: update lance dependency to v${VERSION}".
|
||||||
|
8. Push the branch to origin. If the remote branch already exists, delete it first with "gh api -X DELETE repos/lancedb/lancedb/git/refs/heads/${BRANCH_NAME}" then push with "git push origin ${BRANCH_NAME}". Do NOT use "git push --force" or "git push -f".
|
||||||
|
9. env "GH_TOKEN" is available, use "gh" tools for github related operations like creating pull request.
|
||||||
|
10. Create a pull request targeting "main" with title "${COMMIT_TYPE}: update lance dependency to v${VERSION}". First, write the PR body to /tmp/pr-body.md using a heredoc (cat <<'EOF' > /tmp/pr-body.md). The body should summarize the dependency bump, clippy/fmt verification, and link the triggering tag (${TAG}). Then run "gh pr create --body-file /tmp/pr-body.md".
|
||||||
|
11. After creating the PR, display the PR URL, "git status --short", and a concise summary of the commands run and their results.
|
||||||
|
|
||||||
Constraints:
|
Constraints:
|
||||||
- Use env "GH_TOKEN" for GitHub operations.
|
- Use bash commands; avoid modifying GitHub workflow files other than through the scripted task above.
|
||||||
- Do not merge the pull request.
|
- Do not merge the PR.
|
||||||
- Do not force-push.
|
- If any command fails, diagnose and fix the issue instead of aborting.
|
||||||
- Do not create a duplicate pull request if an open PR already exists for the target Lance version.
|
|
||||||
- If any command fails, diagnose and fix the root cause instead of aborting.
|
|
||||||
- After creating the PR, display the PR URL, "git status --short", and a concise summary of the commands run and their results.
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
printenv OPENAI_API_KEY | codex login --with-api-key
|
printenv OPENAI_API_KEY | codex login --with-api-key
|
||||||
codex --config shell_environment_policy.ignore_default_excludes=true exec --dangerously-bypass-approvals-and-sandbox "$(cat /tmp/codex-prompt.txt)"
|
codex --config shell_environment_policy.ignore_default_excludes=true exec --dangerously-bypass-approvals-and-sandbox "$(cat /tmp/codex-prompt.txt)"
|
||||||
|
|
||||||
|
- name: Trigger sophon dependency update
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
VERSION="${TAG#refs/tags/}"
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
|
LANCEDB_BRANCH="codex/update-lance-${VERSION//[^a-zA-Z0-9]/-}"
|
||||||
|
|
||||||
|
echo "Triggering sophon workflow with:"
|
||||||
|
echo " lance_ref: ${TAG#refs/tags/}"
|
||||||
|
echo " lancedb_ref: ${LANCEDB_BRANCH}"
|
||||||
|
|
||||||
|
gh workflow run codex-bump-lancedb-lance.yml \
|
||||||
|
--repo lancedb/sophon \
|
||||||
|
-f lance_ref="${TAG#refs/tags/}" \
|
||||||
|
-f lancedb_ref="${LANCEDB_BRANCH}"
|
||||||
|
|
||||||
|
- name: Show latest sophon workflow run
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
echo "Latest sophon workflow run:"
|
||||||
|
gh run list --repo lancedb/sophon --workflow codex-bump-lancedb-lance.yml --limit 1 --json databaseId,url,displayTitle
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
labeler:
|
labeler:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -18,7 +15,7 @@ jobs:
|
|||||||
name: Label PR
|
name: Label PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: srvaroa/labeler@v1
|
- uses: srvaroa/labeler@master
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
commitlint:
|
commitlint:
|
||||||
@@ -27,7 +24,7 @@ jobs:
|
|||||||
name: Verify PR title / description conforms to semantic-release
|
name: Verify PR title / description conforms to semantic-release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "18"
|
node-version: "18"
|
||||||
# These rules are disabled because Github will always ensure there
|
# These rules are disabled because Github will always ensure there
|
||||||
@@ -50,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
${{ github.event.pull_request.body }}
|
${{ github.event.pull_request.body }}
|
||||||
- if: failure()
|
- if: failure()
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const message = `**ACTION NEEDED**
|
const message = `**ACTION NEEDED**
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Install dependencies needed for ubuntu
|
- name: Install dependencies needed for ubuntu
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y protobuf-compiler libssl-dev
|
sudo apt install -y protobuf-compiler libssl-dev
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .
|
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .
|
||||||
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -r ../docs/requirements.txt
|
python -m pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -r ../docs/requirements.txt
|
||||||
- name: Set up node
|
- name: Set up node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
PYTHONPATH=. mkdocs build
|
PYTHONPATH=. mkdocs build
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v5
|
uses: actions/configure-pages@v2
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
name: GitHub Release
|
|
||||||
|
|
||||||
# All SDKs share one version, so a single `vX.Y.Z` tag produces a single GitHub
|
|
||||||
# release covering all of them. The per-package publish workflows (PyPI, NPM,
|
|
||||||
# Cargo, Maven) trigger off the same tag independently.
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
gh-release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
lfs: true
|
|
||||||
- name: Extract version
|
|
||||||
id: extract_version
|
|
||||||
env:
|
|
||||||
GITHUB_REF: ${{ github.ref }}
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
echo "Extracting tag and version from $GITHUB_REF"
|
|
||||||
if [[ $GITHUB_REF =~ refs/tags/v(.*) ]]; then
|
|
||||||
VERSION=${BASH_REMATCH[1]}
|
|
||||||
TAG=v$VERSION
|
|
||||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Failed to extract version from $GITHUB_REF"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Extracted version $VERSION from $GITHUB_REF"
|
|
||||||
if [[ $VERSION =~ beta ]]; then
|
|
||||||
echo "This is a beta release"
|
|
||||||
echo "prerelease=true" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Get last release (that is not this one)
|
|
||||||
FROM_TAG=$(git tag --sort='version:refname' \
|
|
||||||
| grep ^v \
|
|
||||||
| grep -vF "$TAG" \
|
|
||||||
| python ci/semver_sort.py v \
|
|
||||||
| tail -n 1)
|
|
||||||
else
|
|
||||||
echo "This is a stable release"
|
|
||||||
echo "prerelease=false" >> $GITHUB_OUTPUT
|
|
||||||
# Get last stable tag (ignore betas)
|
|
||||||
FROM_TAG=$(git tag --sort='version:refname' \
|
|
||||||
| grep ^v \
|
|
||||||
| grep -vF "$TAG" \
|
|
||||||
| grep -v beta \
|
|
||||||
| python ci/semver_sort.py v \
|
|
||||||
| tail -n 1)
|
|
||||||
fi
|
|
||||||
echo "Found from tag $FROM_TAG"
|
|
||||||
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
|
||||||
- name: Create Release Notes
|
|
||||||
id: release_notes
|
|
||||||
uses: mikepenz/release-changelog-builder-action@v4
|
|
||||||
with:
|
|
||||||
configuration: .github/release_notes.json
|
|
||||||
toTag: ${{ steps.extract_version.outputs.tag }}
|
|
||||||
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Create GH release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
# Marking betas as pre-releases keeps them from taking the "Latest"
|
|
||||||
# badge on the releases page.
|
|
||||||
prerelease: ${{ steps.extract_version.outputs.prerelease }}
|
|
||||||
make_latest: ${{ steps.extract_version.outputs.prerelease == 'false' }}
|
|
||||||
tag_name: ${{ steps.extract_version.outputs.tag }}
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
generate_release_notes: false
|
|
||||||
name: LanceDB v${{ steps.extract_version.outputs.version }}
|
|
||||||
body: ${{ steps.release_notes.outputs.changelog }}
|
|
||||||
@@ -19,9 +19,6 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- .github/workflows/java-publish.yml
|
- .github/workflows/java-publish.yml
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
name: Build and Publish
|
name: Build and Publish
|
||||||
@@ -32,7 +29,7 @@ jobs:
|
|||||||
working-directory: ./java
|
working-directory: ./java
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Set up Java 8
|
- name: Set up Java 8
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
@@ -43,7 +40,7 @@ jobs:
|
|||||||
server-username: SONATYPE_USER
|
server-username: SONATYPE_USER
|
||||||
server-password: SONATYPE_TOKEN
|
server-password: SONATYPE_TOKEN
|
||||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
gpg-passphrase: MAVEN_GPG_PASSPHRASE
|
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
- name: Set git config
|
- name: Set git config
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "dev+gha@lancedb.com"
|
git config --global user.email "dev+gha@lancedb.com"
|
||||||
@@ -58,11 +55,10 @@ jobs:
|
|||||||
echo "use-agent" >> ~/.gnupg/gpg.conf
|
echo "use-agent" >> ~/.gnupg/gpg.conf
|
||||||
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
|
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
|
||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
./mvnw --batch-mode -DskipTests -DpushChanges=false deploy -pl lancedb-core -am -P deploy-to-ossrh
|
./mvnw --batch-mode -DskipTests -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy -pl lancedb-core -am -P deploy-to-ossrh
|
||||||
env:
|
env:
|
||||||
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
|
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
|
||||||
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
|
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
|
||||||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
|
||||||
|
|
||||||
report-failure:
|
report-failure:
|
||||||
name: Report Workflow Failure
|
name: Report Workflow Failure
|
||||||
@@ -73,7 +69,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ on:
|
|||||||
- java/**
|
- java/**
|
||||||
- .github/workflows/java.yml
|
- .github/workflows/java.yml
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-java:
|
build-java:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -36,7 +33,7 @@ jobs:
|
|||||||
working-directory: ./java
|
working-directory: ./java
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Set up Java 17
|
- name: Set up Java 17
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
name: Lance Release Timer
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "*/10 * * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: lance-release-timer
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trigger-update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for new Lance tag
|
||||||
|
id: check
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
python3 ci/check_lance_release.py --github-output "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Look for existing PR
|
||||||
|
if: steps.check.outputs.needs_update == 'true'
|
||||||
|
id: pr
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TITLE="chore: update lance dependency to v${{ steps.check.outputs.latest_version }}"
|
||||||
|
COUNT=$(gh pr list --search "\"$TITLE\" in:title" --state open --limit 1 --json number --jq 'length')
|
||||||
|
if [ "$COUNT" -gt 0 ]; then
|
||||||
|
echo "Open PR already exists for $TITLE"
|
||||||
|
echo "pr_exists=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "No existing PR for $TITLE"
|
||||||
|
echo "pr_exists=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Trigger codex update workflow
|
||||||
|
if: steps.check.outputs.needs_update == 'true' && steps.pr.outputs.pr_exists != 'true'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TAG=${{ steps.check.outputs.latest_tag }}
|
||||||
|
gh workflow run codex-update-lance-dependency.yml -f tag=refs/tags/$TAG
|
||||||
|
|
||||||
|
- name: Show latest codex workflow run
|
||||||
|
if: steps.check.outputs.needs_update == 'true' && steps.pr.outputs.pr_exists != 'true'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ROBOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
gh run list --workflow codex-update-lance-dependency.yml --limit 1 --json databaseId,url,displayTitle
|
||||||
@@ -10,16 +10,12 @@ on:
|
|||||||
- nodejs/**
|
- nodejs/**
|
||||||
- java/**
|
- java/**
|
||||||
- .github/workflows/license-header-check.yml
|
- .github/workflows/license-header-check.yml
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-licenses:
|
check-licenses:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Install license-header-checker
|
- name: Install license-header-checker
|
||||||
working-directory: /tmp
|
working-directory: /tmp
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
name: Create release commit
|
name: Create release commit
|
||||||
|
|
||||||
# This workflow increments the version, tags it, and pushes it. All SDKs share
|
# This workflow increments versions, tags the version, and pushes it.
|
||||||
# a single version, so one tag releases all of them.
|
|
||||||
# When a tag is pushed, another workflow is triggered that creates a GH release
|
# When a tag is pushed, another workflow is triggered that creates a GH release
|
||||||
# and uploads the binaries. This workflow is only for creating the tag.
|
# and uploads the binaries. This workflow is only for creating the tag.
|
||||||
|
|
||||||
# This script will enforce that a minor version is incremented if there are any
|
# This script will enforce that a minor version is incremented if there are any
|
||||||
# breaking changes since the last minor increment. A breaking change in any SDK
|
# breaking changes since the last minor increment. However, it isn't able to
|
||||||
# bumps the minor version for all of them. If you wish to bypass this check, you
|
# differentiate between breaking changes in Node versus Python. If you wish to
|
||||||
# can manually increment the version and push the tag.
|
# bypass this check, you can manually increment the version and push the tag.
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -25,6 +24,16 @@ on:
|
|||||||
options:
|
options:
|
||||||
- preview
|
- preview
|
||||||
- stable
|
- stable
|
||||||
|
python:
|
||||||
|
description: 'Make a Python release'
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
other:
|
||||||
|
description: 'Make a Node/Rust/Java release'
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
bump-minor:
|
bump-minor:
|
||||||
description: 'Bump minor version'
|
description: 'Bump minor version'
|
||||||
required: true
|
required: true
|
||||||
@@ -40,7 +49,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Output Inputs
|
- name: Output Inputs
|
||||||
run: echo "${{ toJSON(github.event.inputs) }}"
|
run: echo "${{ toJSON(github.event.inputs) }}"
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -56,16 +65,29 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name 'Lance Release'
|
git config user.name 'Lance Release'
|
||||||
git config user.email 'lance-dev@lancedb.com'
|
git config user.email 'lance-dev@lancedb.com'
|
||||||
- name: Bump version
|
- name: Bump Python version
|
||||||
|
if: ${{ inputs.python }}
|
||||||
|
working-directory: python
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Need to get the commit before bumping the version, so we can
|
||||||
|
# determine if there are breaking changes in the next step as well.
|
||||||
|
echo "COMMIT_BEFORE_BUMP=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
pip install bump-my-version PyGithub packaging
|
||||||
|
bash ../ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }} python-v
|
||||||
|
- name: Bump Node/Rust version
|
||||||
|
if: ${{ inputs.other }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
pip install bump-my-version PyGithub packaging
|
pip install bump-my-version PyGithub packaging
|
||||||
bash ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }}
|
bash ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }} v $COMMIT_BEFORE_BUMP
|
||||||
bash ci/update_lockfiles.sh --amend
|
bash ci/update_lockfiles.sh --amend
|
||||||
- name: Push new version tag
|
- name: Push new version tag
|
||||||
if: ${{ !inputs.dry_run }}
|
if: ${{ !inputs.dry_run }}
|
||||||
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
# Need to use PAT here too to trigger next workflow. See comment above.
|
# Need to use PAT here too to trigger next workflow. See comment above.
|
||||||
github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }}
|
github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }}
|
||||||
|
|||||||
@@ -7,17 +7,12 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- Cargo.toml
|
- Cargo.toml
|
||||||
- Cargo.lock
|
|
||||||
- rust-toolchain.toml
|
|
||||||
- nodejs/**
|
- nodejs/**
|
||||||
- rust/**
|
- rust/**
|
||||||
- docs/src/js/**
|
- docs/src/js/**
|
||||||
- .github/workflows/nodejs.yml
|
- .github/workflows/nodejs.yml
|
||||||
- docker-compose.yml
|
- docker-compose.yml
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -38,21 +33,15 @@ jobs:
|
|||||||
CC: gcc-12
|
CC: gcc-12
|
||||||
CXX: g++-12
|
CXX: g++-12
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
node-version: 20
|
||||||
- uses: actions/setup-node@v6
|
cache: 'npm'
|
||||||
with:
|
cache-dependency-path: nodejs/package-lock.json
|
||||||
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
|
||||||
# in October. The library itself still supports Node >= 18
|
|
||||||
# (see test matrix below).
|
|
||||||
node-version: 24
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
@@ -61,24 +50,17 @@ jobs:
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y protobuf-compiler libssl-dev
|
sudo apt install -y protobuf-compiler libssl-dev
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Format Rust
|
- name: Format Rust
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
- name: Lint Rust
|
- name: Lint Rust
|
||||||
run: cargo clippy --profile ci --all --all-features -- -D warnings
|
run: cargo clippy --profile ci --all --all-features -- -D warnings
|
||||||
- name: Lint Typescript
|
- name: Lint Typescript
|
||||||
run: |
|
run: |
|
||||||
pnpm install --frozen-lockfile
|
npm ci
|
||||||
pnpm lint-ci
|
npm run lint-ci
|
||||||
- name: Lint examples
|
- name: Lint examples
|
||||||
working-directory: nodejs/examples
|
working-directory: nodejs/examples
|
||||||
# The `@lancedb/lancedb` dep points at file:../dist; pnpm errors if
|
run: npm ci && npm run lint-ci
|
||||||
# that dir is missing, so create an empty one for lint-only runs.
|
|
||||||
run: mkdir -p ../dist && pnpm install --frozen-lockfile && pnpm lint-ci
|
|
||||||
linux:
|
linux:
|
||||||
name: Linux (NodeJS ${{ matrix.node-version }})
|
name: Linux (NodeJS ${{ matrix.node-version }})
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
@@ -91,122 +73,90 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: actions/setup-node@v3
|
||||||
|
name: Setup Node.js 20 for build
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
# @napi-rs/cli v3 requires Node >= 20.12 (via @inquirer/prompts@8).
|
||||||
- uses: actions/setup-node@v6
|
# Build always on Node 20; tests run on the matrix version below.
|
||||||
name: Setup Node.js 24 for build
|
node-version: 20
|
||||||
with:
|
cache: 'npm'
|
||||||
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
cache-dependency-path: nodejs/package-lock.json
|
||||||
# in October. Build/install runs on Node 24; tests run on the
|
|
||||||
# matrix version below using direct jest invocation.
|
|
||||||
node-version: 24
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y protobuf-compiler libssl-dev
|
sudo apt install -y protobuf-compiler libssl-dev
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
pnpm install --frozen-lockfile
|
npm ci --include=optional
|
||||||
# No `--` separator: pnpm forwards it literally, which would
|
npm run build:debug -- --profile ci
|
||||||
# make napi-rs treat `--profile ci` as a cargo passthrough arg.
|
- uses: actions/setup-node@v3
|
||||||
pnpm build:debug --profile ci
|
|
||||||
pnpm tsc
|
|
||||||
- name: Setup examples
|
|
||||||
working-directory: nodejs/examples
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
- name: Check docs
|
|
||||||
run: |
|
|
||||||
# We run this as part of the job because the binary needs to be built
|
|
||||||
# first to export the types of the native code.
|
|
||||||
set -e
|
|
||||||
# `pnpm docs` would invoke pnpm's built-in `docs` command, not
|
|
||||||
# the script — use `pnpm run docs`.
|
|
||||||
pnpm run docs
|
|
||||||
if ! git diff --exit-code -- ../ ':(exclude)Cargo.lock'; then
|
|
||||||
echo "Docs need to be updated"
|
|
||||||
echo "Run 'pnpm run docs', fix any warnings, and commit the changes."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- uses: actions/setup-node@v6
|
|
||||||
name: Setup Node.js ${{ matrix.node-version }} for test
|
name: Setup Node.js ${{ matrix.node-version }} for test
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- name: Compile TypeScript
|
||||||
|
run: npm run tsc
|
||||||
- name: Setup localstack
|
- name: Setup localstack
|
||||||
working-directory: .
|
working-directory: .
|
||||||
run: docker compose up --detach --wait
|
run: docker compose up --detach --wait
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
S3_TEST: "1"
|
S3_TEST: "1"
|
||||||
# Newer @smithy/core uses dynamic ESM imports.
|
run: npm run test
|
||||||
NODE_OPTIONS: "--experimental-vm-modules"
|
- name: Setup examples
|
||||||
# Invoke jest directly because pnpm 11 itself requires Node 22+
|
working-directory: nodejs/examples
|
||||||
# while the matrix tests on older Node versions.
|
run: npm ci
|
||||||
run: npx jest --verbose
|
|
||||||
- name: Test examples
|
- name: Test examples
|
||||||
working-directory: ./
|
working-directory: ./
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: test
|
OPENAI_API_KEY: test
|
||||||
OPENAI_BASE_URL: http://0.0.0.0:8000
|
OPENAI_BASE_URL: http://0.0.0.0:8000
|
||||||
NODE_OPTIONS: "--experimental-vm-modules"
|
|
||||||
run: |
|
run: |
|
||||||
python ci/mock_openai.py &
|
python ci/mock_openai.py &
|
||||||
cd nodejs/examples
|
cd nodejs/examples
|
||||||
npx jest --testEnvironment jest-environment-node-single-context --verbose
|
npm test
|
||||||
|
- name: Check docs
|
||||||
|
run: |
|
||||||
|
# We run this as part of the job because the binary needs to be built
|
||||||
|
# first to export the types of the native code.
|
||||||
|
set -e
|
||||||
|
npm ci
|
||||||
|
npm run docs
|
||||||
|
if ! git diff --exit-code -- ../ ':(exclude)Cargo.lock'; then
|
||||||
|
echo "Docs need to be updated"
|
||||||
|
echo "Run 'npm run docs', fix any warnings, and commit the changes."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
macos:
|
macos:
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
# macos-15 ships a newer linker; the older macos-14 linker fails to insert
|
runs-on: "macos-14"
|
||||||
# branch islands when the debug cdylib's __text section exceeds the 128 MB
|
|
||||||
# AArch64 B/BL branch range.
|
|
||||||
runs-on: "macos-15"
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
version: 11.1.1
|
node-version: 20
|
||||||
- uses: actions/setup-node@v6
|
cache: 'npm'
|
||||||
with:
|
cache-dependency-path: nodejs/package-lock.json
|
||||||
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
|
||||||
# in October.
|
|
||||||
node-version: 24
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install protobuf
|
brew install protobuf
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
pnpm install --frozen-lockfile
|
npm ci --include=optional
|
||||||
# No `--` separator: pnpm forwards it literally, which would
|
npm run build:debug -- --profile ci
|
||||||
# make napi-rs treat `--profile ci` as a cargo passthrough arg.
|
npm run tsc
|
||||||
pnpm build:debug --profile ci
|
|
||||||
pnpm tsc
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
pnpm test
|
npm run test
|
||||||
|
|||||||
+118
-161
@@ -10,28 +10,88 @@ permissions:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
# The cross-compiled targets (musl especially) break from toolchain and
|
|
||||||
# dependency changes that nothing else in CI catches, and discovering that
|
|
||||||
# mid-release is expensive. A nightly run keeps that signal while dropping
|
|
||||||
# the full 8-target release matrix from all ~90 pushes to main each month.
|
|
||||||
# `report-failure` files an issue when a nightly breaks.
|
|
||||||
schedule:
|
|
||||||
- cron: "0 8 * * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
pull_request:
|
||||||
# This should trigger a dry run (we skip the final publish step)
|
# This should trigger a dry run (we skip the final publish step)
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/npm-publish.yml
|
- .github/workflows/npm-publish.yml
|
||||||
- Cargo.toml # Change in dependency frequently breaks builds
|
- Cargo.toml # Change in dependency frequently breaks builds
|
||||||
- Cargo.lock
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
gh-release:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: true
|
||||||
|
- name: Extract version
|
||||||
|
id: extract_version
|
||||||
|
env:
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
echo "Extracting tag and version from $GITHUB_REF"
|
||||||
|
if [[ $GITHUB_REF =~ refs/tags/v(.*) ]]; then
|
||||||
|
VERSION=${BASH_REMATCH[1]}
|
||||||
|
TAG=v$VERSION
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Failed to extract version from $GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Extracted version $VERSION from $GITHUB_REF"
|
||||||
|
if [[ $VERSION =~ beta ]]; then
|
||||||
|
echo "This is a beta release"
|
||||||
|
|
||||||
|
# Get last release (that is not this one)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| python ci/semver_sort.py v \
|
||||||
|
| tail -n 1)
|
||||||
|
else
|
||||||
|
echo "This is a stable release"
|
||||||
|
# Get last stable tag (ignore betas)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| grep -v beta \
|
||||||
|
| python ci/semver_sort.py v \
|
||||||
|
| tail -n 1)
|
||||||
|
fi
|
||||||
|
echo "Found from tag $FROM_TAG"
|
||||||
|
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
||||||
|
- name: Create Release Notes
|
||||||
|
id: release_notes
|
||||||
|
uses: mikepenz/release-changelog-builder-action@v4
|
||||||
|
with:
|
||||||
|
configuration: .github/release_notes.json
|
||||||
|
toTag: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Create GH release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
prerelease: ${{ contains('beta', github.ref) }}
|
||||||
|
tag_name: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
generate_release_notes: false
|
||||||
|
name: Node/Rust LanceDB v${{ steps.extract_version.outputs.version }}
|
||||||
|
body: ${{ steps.release_notes.outputs.changelog }}
|
||||||
|
|
||||||
build-lancedb:
|
build-lancedb:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -40,18 +100,9 @@ jobs:
|
|||||||
- target: aarch64-apple-darwin
|
- target: aarch64-apple-darwin
|
||||||
host: macos-latest
|
host: macos-latest
|
||||||
features: fp16kernels
|
features: fp16kernels
|
||||||
pre_build: |-
|
pre_build: brew install protobuf
|
||||||
brew install protobuf
|
|
||||||
# Fat LTO (the workspace default in .cargo/config.toml) is
|
|
||||||
# single-threaded and is the peak-memory step of the build. On
|
|
||||||
# this runner it accounted for ~111 of the job's ~113 minutes,
|
|
||||||
# making it the critical path of the entire publish pipeline.
|
|
||||||
# ThinLTO parallelizes it across the runner's cores, for a few
|
|
||||||
# percent of runtime performance.
|
|
||||||
export CARGO_PROFILE_RELEASE_LTO=thin
|
|
||||||
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
|
|
||||||
- target: x86_64-pc-windows-msvc
|
- target: x86_64-pc-windows-msvc
|
||||||
host: windows-2025
|
host: windows-latest
|
||||||
features: ","
|
features: ","
|
||||||
pre_build: |-
|
pre_build: |-
|
||||||
choco install --no-progress protoc ninja nasm
|
choco install --no-progress protoc ninja nasm
|
||||||
@@ -59,21 +110,12 @@ jobs:
|
|||||||
# There is an issue where choco doesn't add nasm to the path
|
# There is an issue where choco doesn't add nasm to the path
|
||||||
export PATH="$PATH:/c/Program Files/NASM"
|
export PATH="$PATH:/c/Program Files/NASM"
|
||||||
nasm -v
|
nasm -v
|
||||||
# See the ThinLTO note on aarch64-apple-darwin above. Keeping
|
|
||||||
# peak memory down is also what lets this run on the standard
|
|
||||||
# 4-core runner: the 8-core larger runner was only needed to
|
|
||||||
# stop fat LTO from OOMing rustc-LLVM.
|
|
||||||
export CARGO_PROFILE_RELEASE_LTO=thin
|
|
||||||
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
|
|
||||||
- target: aarch64-pc-windows-msvc
|
- target: aarch64-pc-windows-msvc
|
||||||
host: windows-2025
|
host: windows-latest
|
||||||
features: ","
|
features: ","
|
||||||
pre_build: |-
|
pre_build: |-
|
||||||
choco install --no-progress protoc
|
choco install --no-progress protoc
|
||||||
rustup target add aarch64-pc-windows-msvc
|
rustup target add aarch64-pc-windows-msvc
|
||||||
# See the ThinLTO note on aarch64-apple-darwin above.
|
|
||||||
export CARGO_PROFILE_RELEASE_LTO=thin
|
|
||||||
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
|
|
||||||
- target: x86_64-unknown-linux-gnu
|
- target: x86_64-unknown-linux-gnu
|
||||||
host: ubuntu-latest
|
host: ubuntu-latest
|
||||||
features: fp16kernels
|
features: fp16kernels
|
||||||
@@ -82,12 +124,7 @@ jobs:
|
|||||||
pre_build: |-
|
pre_build: |-
|
||||||
set -e &&
|
set -e &&
|
||||||
apt-get update &&
|
apt-get update &&
|
||||||
apt-get install -y protobuf-compiler pkg-config &&
|
apt-get install -y protobuf-compiler pkg-config
|
||||||
# The base image (manylinux2014-cross) sets TARGET_CC to the old
|
|
||||||
# GCC 4.8 cross-compiler. aws-lc-sys checks TARGET_CC before CC,
|
|
||||||
# so it picks up GCC even though the napi-rs image sets CC=clang.
|
|
||||||
# Override to use the image's clang-18 which supports -fuse-ld=lld.
|
|
||||||
export TARGET_CC=clang TARGET_CXX=clang++
|
|
||||||
- target: x86_64-unknown-linux-musl
|
- target: x86_64-unknown-linux-musl
|
||||||
# This one seems to need some extra memory
|
# This one seems to need some extra memory
|
||||||
host: ubuntu-2404-8x-x64
|
host: ubuntu-2404-8x-x64
|
||||||
@@ -107,10 +144,9 @@ jobs:
|
|||||||
set -e &&
|
set -e &&
|
||||||
apt-get update &&
|
apt-get update &&
|
||||||
apt-get install -y protobuf-compiler pkg-config &&
|
apt-get install -y protobuf-compiler pkg-config &&
|
||||||
export TARGET_CC=clang TARGET_CXX=clang++ &&
|
# https://github.com/aws/aws-lc-rs/issues/737#issuecomment-2725918627
|
||||||
# The manylinux2014 sysroot has glibc 2.17 headers which lack
|
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/4.8.5/crtbeginS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtbeginS.o &&
|
||||||
# AT_HWCAP2 (added in Linux 3.17). Define it for aws-lc-sys.
|
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/gcc &&
|
||||||
export CFLAGS="$CFLAGS -DAT_HWCAP2=26" &&
|
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
rustup target add aarch64-unknown-linux-gnu
|
||||||
- target: aarch64-unknown-linux-musl
|
- target: aarch64-unknown-linux-musl
|
||||||
host: ubuntu-2404-8x-x64
|
host: ubuntu-2404-8x-x64
|
||||||
@@ -127,70 +163,32 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Setup pnpm
|
|
||||||
uses: pnpm/action-setup@v6
|
|
||||||
with:
|
|
||||||
version: 11.1.1
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
|
if: ${{ !matrix.settings.docker }}
|
||||||
with:
|
with:
|
||||||
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
node-version: 20
|
||||||
# in October.
|
cache: npm
|
||||||
node-version: 24
|
cache-dependency-path: nodejs/package-lock.json
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
|
||||||
- name: Install
|
- name: Install
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
if: ${{ !matrix.settings.docker }}
|
if: ${{ !matrix.settings.docker }}
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
targets: ${{ matrix.settings.target }}
|
targets: ${{ matrix.settings.target }}
|
||||||
# These builds were entirely uncached: the old key was static, so
|
- name: Cache cargo
|
||||||
# `actions/cache` (which only writes on a miss) could never refresh it,
|
uses: actions/cache@v4
|
||||||
# and the multi-GB whole-`target/` copy it tried to store never fit the
|
|
||||||
# repo's cache budget, so no entry was ever saved. rust-cache prunes
|
|
||||||
# `target/` to dependency artifacts and keys on Cargo.lock plus the rustc
|
|
||||||
# version, which both fixes the key and keeps entries a sane size.
|
|
||||||
#
|
|
||||||
# This caches dependency *compilation* only. The LTO link of the cdylib
|
|
||||||
# re-runs regardless, since the local crate changes every time, so the
|
|
||||||
# win is larger on the non-LTO jobs than here.
|
|
||||||
- name: Cache cargo (native builds)
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
if: ${{ !matrix.settings.docker }}
|
|
||||||
with:
|
with:
|
||||||
# The release profile and per-target dirs differ from what the test
|
path: |
|
||||||
# workflows cache, so these need to be separate entries.
|
~/.cargo/registry/index/
|
||||||
key: release-${{ matrix.settings.target }}
|
~/.cargo/registry/cache/
|
||||||
# Only the nightly run on main writes, so tag and PR runs restore a
|
~/.cargo/git/db/
|
||||||
# warm entry without every dependabot PR writing its own (which would
|
.cargo-cache
|
||||||
# be unreadable elsewhere anyway, since GitHub scopes caches to the
|
target/
|
||||||
# creating ref). The nightly cadence also keeps entries inside
|
key: nodejs-${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
|
||||||
# GitHub's 7-day eviction window, which a tag-only trigger would not.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
# Docker builds can use rust-cache too. `target/` already lives on the
|
|
||||||
# host because the whole workspace is bind-mounted into the container, and
|
|
||||||
# rust-cache's prune and save run host-side, so they can manage it -- which
|
|
||||||
# is what keeps the entry to dependency artifacts rather than a multi-GB
|
|
||||||
# copy of everything.
|
|
||||||
#
|
|
||||||
# Two differences from the native builds. The container's CARGO_HOME is
|
|
||||||
# bind-mounted from `.cargo-cache` rather than the host's ~/.cargo, so that
|
|
||||||
# has to be cached explicitly. And the key is derived from the *host* rustc
|
|
||||||
# version, which is not the compiler that produced these artifacts; that is
|
|
||||||
# safe because cargo fingerprints the real compiler and rebuilds on a
|
|
||||||
# mismatch, it just means a base-image toolchain bump costs one cold build
|
|
||||||
# instead of invalidating the key.
|
|
||||||
- name: Cache cargo (docker builds)
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
if: ${{ matrix.settings.docker }}
|
|
||||||
with:
|
|
||||||
key: docker-${{ matrix.settings.target }}
|
|
||||||
cache-directories: .cargo-cache
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: npm ci
|
||||||
- name: Install Zig
|
- name: Install Zig
|
||||||
uses: mlugg/setup-zig@v2
|
uses: mlugg/setup-zig@v2
|
||||||
if: ${{ contains(matrix.settings.target, 'musl') }}
|
if: ${{ contains(matrix.settings.target, 'musl') }}
|
||||||
@@ -206,13 +204,9 @@ jobs:
|
|||||||
if: ${{ matrix.settings.docker }}
|
if: ${{ matrix.settings.docker }}
|
||||||
with:
|
with:
|
||||||
image: ${{ matrix.settings.docker }}
|
image: ${{ matrix.settings.docker }}
|
||||||
# All three mounts must live under `.cargo-cache`, which is what the
|
|
||||||
# cache step above saves. Previously the registry mounts pointed at
|
|
||||||
# `.cargo/...`, a path nothing cached, so the container re-downloaded
|
|
||||||
# the whole crate registry on every run.
|
|
||||||
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db \
|
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db \
|
||||||
-v ${{ github.workspace }}/.cargo-cache/registry/cache:/usr/local/cargo/registry/cache \
|
-v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache \
|
||||||
-v ${{ github.workspace }}/.cargo-cache/registry/index:/usr/local/cargo/registry/index \
|
-v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index \
|
||||||
-v ${{ github.workspace }}:/build -w /build/nodejs"
|
-v ${{ github.workspace }}:/build -w /build/nodejs"
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
@@ -224,16 +218,6 @@ jobs:
|
|||||||
--js ../lancedb/native.js \
|
--js ../lancedb/native.js \
|
||||||
--strip \
|
--strip \
|
||||||
--output-dir dist/
|
--output-dir dist/
|
||||||
# The container runs as root (`--user 0:0`), so everything it wrote to the
|
|
||||||
# mounted cache dirs is root-owned. rust-cache's post step runs as the
|
|
||||||
# runner user and has to both read these and delete from them while
|
|
||||||
# pruning, so hand them back before it runs.
|
|
||||||
- name: Take ownership of docker build output
|
|
||||||
if: ${{ matrix.settings.docker }}
|
|
||||||
run: |
|
|
||||||
sudo chown -R "$(id -u):$(id -g)" \
|
|
||||||
"${{ github.workspace }}/.cargo-cache" \
|
|
||||||
"${{ github.workspace }}/target"
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.settings.pre_build }}
|
${{ matrix.settings.pre_build }}
|
||||||
@@ -247,17 +231,8 @@ jobs:
|
|||||||
--output-dir dist/
|
--output-dir dist/
|
||||||
if: ${{ !matrix.settings.docker }}
|
if: ${{ !matrix.settings.docker }}
|
||||||
shell: bash
|
shell: bash
|
||||||
# The standard Windows runners have ~14 GB free, and a release `target/`
|
|
||||||
# for this workspace is a large fraction of that. Report the remaining
|
|
||||||
# headroom so a build that only just fits is visible before a dependency
|
|
||||||
# bump turns it into a failed release. `always()` so the numbers are
|
|
||||||
# still there when the build is what ran out of space.
|
|
||||||
- name: Report disk headroom
|
|
||||||
if: always()
|
|
||||||
run: df -h
|
|
||||||
shell: bash
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lancedb-${{ matrix.settings.target }}
|
name: lancedb-${{ matrix.settings.target }}
|
||||||
path: nodejs/dist/*.node
|
path: nodejs/dist/*.node
|
||||||
@@ -266,10 +241,10 @@ jobs:
|
|||||||
# one to do the upload.
|
# one to do the upload.
|
||||||
- name: Make generic artifacts
|
- name: Make generic artifacts
|
||||||
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' }}
|
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' }}
|
||||||
run: pnpm tsc
|
run: npm run tsc
|
||||||
- name: Upload Generic Artifacts
|
- name: Upload Generic Artifacts
|
||||||
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' }}
|
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' }}
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nodejs-dist
|
name: nodejs-dist
|
||||||
path: |
|
path: |
|
||||||
@@ -291,7 +266,7 @@ jobs:
|
|||||||
- target: x86_64-unknown-linux-gnu
|
- target: x86_64-unknown-linux-gnu
|
||||||
host: ubuntu-latest
|
host: ubuntu-latest
|
||||||
- target: aarch64-unknown-linux-gnu
|
- target: aarch64-unknown-linux-gnu
|
||||||
host: ubuntu-2404-8x-arm64
|
host: buildjet-16vcpu-ubuntu-2204-arm
|
||||||
node:
|
node:
|
||||||
- '20'
|
- '20'
|
||||||
runs-on: ${{ matrix.settings.host }}
|
runs-on: ${{ matrix.settings.host }}
|
||||||
@@ -300,34 +275,24 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: nodejs
|
working-directory: nodejs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Setup pnpm
|
- name: Setup node
|
||||||
uses: pnpm/action-setup@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
|
||||||
version: 11.1.1
|
|
||||||
- name: Setup Node.js 24 for install
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
# pnpm 11 requires Node >= 22.13; use 24 since 22 hits EOL
|
|
||||||
# in October.
|
|
||||||
node-version: 24
|
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
- name: Setup Node.js ${{ matrix.node }} for test
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: nodejs/package-lock.json
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lancedb-${{ matrix.settings.target }}
|
name: lancedb-${{ matrix.settings.target }}
|
||||||
path: nodejs/dist/
|
path: nodejs/dist/
|
||||||
# For testing purposes:
|
# For testing purposes:
|
||||||
# run-id: 13982782871
|
# run-id: 13982782871
|
||||||
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nodejs-dist
|
name: nodejs-dist
|
||||||
path: nodejs/dist
|
path: nodejs/dist
|
||||||
@@ -339,9 +304,7 @@ jobs:
|
|||||||
- name: Move built files
|
- name: Move built files
|
||||||
run: cp dist/native.d.ts dist/native.js dist/*.node lancedb/
|
run: cp dist/native.d.ts dist/native.js dist/*.node lancedb/
|
||||||
- name: Test bindings
|
- name: Test bindings
|
||||||
# Invoke jest directly because pnpm 11 itself requires Node 22+
|
run: npm test
|
||||||
# while the matrix tests on older Node versions.
|
|
||||||
run: npx jest --verbose
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -352,28 +315,24 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- test-lancedb
|
- test-lancedb
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Setup pnpm
|
|
||||||
uses: pnpm/action-setup@v6
|
|
||||||
with:
|
|
||||||
version: 11.1.1
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
cache: pnpm
|
cache: npm
|
||||||
cache-dependency-path: nodejs/pnpm-lock.yaml
|
cache-dependency-path: nodejs/package-lock.json
|
||||||
registry-url: "https://registry.npmjs.org"
|
registry-url: "https://registry.npmjs.org"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: npm ci
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nodejs-dist
|
name: nodejs-dist
|
||||||
path: nodejs/dist
|
path: nodejs/dist
|
||||||
# For testing purposes:
|
# For testing purposes:
|
||||||
# run-id: 13982782871
|
# run-id: 13982782871
|
||||||
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
# github-token: ${{ secrets.GITHUB_TOKEN }} # token with actions:read permissions on target repo
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@v4
|
||||||
name: Download arch-specific binaries
|
name: Download arch-specific binaries
|
||||||
with:
|
with:
|
||||||
pattern: lancedb-*
|
pattern: lancedb-*
|
||||||
@@ -385,7 +344,7 @@ jobs:
|
|||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: find dist && find nodejs-artifacts
|
run: find dist && find nodejs-artifacts
|
||||||
- name: Move artifacts
|
- name: Move artifacts
|
||||||
run: pnpm exec napi artifacts -d nodejs-artifacts
|
run: npx napi artifacts -d nodejs-artifacts
|
||||||
- name: List packages
|
- name: List packages
|
||||||
run: find npm
|
run: find npm
|
||||||
- name: Publish
|
- name: Publish
|
||||||
@@ -406,14 +365,12 @@ jobs:
|
|||||||
name: Report Workflow Failure
|
name: Report Workflow Failure
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-lancedb, test-lancedb, publish]
|
needs: [build-lancedb, test-lancedb, publish]
|
||||||
# Nightly runs are the only thing watching the cross-compiled targets now,
|
if: always() && failure() && startsWith(github.ref, 'refs/tags/v')
|
||||||
# so they have to report failures too or the signal is silently lost.
|
|
||||||
if: always() && failure() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'schedule')
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -3,65 +3,43 @@ name: PyPI Publish
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'python-v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
# This should trigger a dry run (we skip the final publish step)
|
# This should trigger a dry run (we skip the final publish step)
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/pypi-publish.yml
|
- .github/workflows/pypi-publish.yml
|
||||||
- .github/workflows/build_linux_wheel/action.yml
|
|
||||||
- .github/workflows/build_mac_wheel/action.yml
|
|
||||||
- .github/workflows/build_windows_wheel/action.yml
|
|
||||||
- Cargo.toml # Change in dependency frequently breaks builds
|
- Cargo.toml # Change in dependency frequently breaks builds
|
||||||
- Cargo.lock
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PIP_EXTRA_INDEX_URL: "https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/"
|
PIP_EXTRA_INDEX_URL: "https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/"
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
# Without this, a force-push to a PR leaves the previous run going -- including
|
|
||||||
# a ~74 minute Windows job and a billed arm64 wheel build.
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
linux:
|
||||||
name: Python ${{ matrix.config.package_name }} ${{ matrix.config.platform }} manylinux${{ matrix.config.manylinux }}
|
name: Python ${{ matrix.config.platform }} manylinux${{ matrix.config.manylinux }}
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
|
- platform: x86_64
|
||||||
|
manylinux: "2_17"
|
||||||
|
extra_args: ""
|
||||||
|
runner: ubuntu-22.04
|
||||||
- platform: x86_64
|
- platform: x86_64
|
||||||
manylinux: "2_28"
|
manylinux: "2_28"
|
||||||
extra_args: "--features fp16kernels"
|
extra_args: "--features fp16kernels"
|
||||||
runner: ubuntu-22.04
|
runner: ubuntu-22.04
|
||||||
package_name: "lancedb"
|
- platform: aarch64
|
||||||
rustflags: ""
|
manylinux: "2_17"
|
||||||
# For successful fat LTO builds, we need a large runner to avoid OOM errors.
|
extra_args: ""
|
||||||
|
# For successful fat LTO builds, we need a large runner to avoid OOM errors.
|
||||||
|
runner: ubuntu-2404-8x-arm64
|
||||||
- platform: aarch64
|
- platform: aarch64
|
||||||
manylinux: "2_28"
|
manylinux: "2_28"
|
||||||
extra_args: "--features fp16kernels"
|
extra_args: "--features fp16kernels"
|
||||||
runner: ubuntu-2404-8x-arm64
|
runner: ubuntu-2404-8x-arm64
|
||||||
package_name: "lancedb"
|
|
||||||
rustflags: ""
|
|
||||||
# `lancedb-compat`: pre-Haswell-friendly variant for x86_64 hosts
|
|
||||||
# without AVX2 (Sandy Bridge / Ivy Bridge / Westmere on Intel,
|
|
||||||
# Bulldozer / Piledriver / Steamroller on AMD). Compiled at the
|
|
||||||
# `x86-64-v2` baseline; runtime SIMD dispatch in lance-linalg
|
|
||||||
# picks the appropriate tier (scalar / AVX / AVX+FMA / AVX2+FMA
|
|
||||||
# / AVX-512) at load time. Same import as `lancedb` -- conflicts
|
|
||||||
# at install time, so users pick one.
|
|
||||||
- platform: x86_64
|
|
||||||
manylinux: "2_28"
|
|
||||||
extra_args: ""
|
|
||||||
runner: ubuntu-22.04
|
|
||||||
package_name: "lancedb-compat"
|
|
||||||
rustflags: "-Ctarget-cpu=x86-64-v2"
|
|
||||||
runs-on: ${{ matrix.config.runner }}
|
runs-on: ${{ matrix.config.runner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -75,14 +53,11 @@ jobs:
|
|||||||
args: "--release --strip ${{ matrix.config.extra_args }}"
|
args: "--release --strip ${{ matrix.config.extra_args }}"
|
||||||
arm-build: ${{ matrix.config.platform == 'aarch64' }}
|
arm-build: ${{ matrix.config.platform == 'aarch64' }}
|
||||||
manylinux: ${{ matrix.config.manylinux }}
|
manylinux: ${{ matrix.config.manylinux }}
|
||||||
package-name: ${{ matrix.config.package_name }}
|
- uses: ./.github/workflows/upload_wheel
|
||||||
rustflags: ${{ matrix.config.rustflags }}
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
- uses: actions/upload-artifact@v7
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
with:
|
with:
|
||||||
name: wheels-linux-${{ matrix.config.package_name }}-${{ matrix.config.platform }}-${{ matrix.config.manylinux }}
|
pypi_token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }}
|
||||||
path: target/wheels/*.whl
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
||||||
if-no-files-found: error
|
|
||||||
mac:
|
mac:
|
||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
runs-on: ${{ matrix.config.runner }}
|
runs-on: ${{ matrix.config.runner }}
|
||||||
@@ -94,7 +69,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.15
|
MACOSX_DEPLOYMENT_TARGET: 10.15
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -106,21 +81,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-minor-version: 10
|
python-minor-version: 10
|
||||||
args: "--release --strip --target ${{ matrix.config.target }} --features fp16kernels"
|
args: "--release --strip --target ${{ matrix.config.target }} --features fp16kernels"
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: ./.github/workflows/upload_wheel
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
with:
|
with:
|
||||||
name: wheels-mac-${{ matrix.config.target }}
|
pypi_token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }}
|
||||||
path: target/wheels/lancedb-*.whl
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
||||||
if-no-files-found: error
|
|
||||||
windows:
|
windows:
|
||||||
timeout-minutes: 90
|
timeout-minutes: 60
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
env:
|
|
||||||
# link.exe is single-threaded and the long pole on Windows builds. Use
|
|
||||||
# rustc's bundled lld-link instead.
|
|
||||||
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -128,84 +98,92 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
# NOTE: caching cargo here would be a no-op. This workflow only runs on
|
|
||||||
# tags and PRs, and GitHub only lets a run restore caches from its own ref
|
|
||||||
# or the default branch -- so with no run on main there is nothing that
|
|
||||||
# can populate an entry the release build would be allowed to read. Fixing
|
|
||||||
# this needs a main/nightly trigger (which would also catch wheel-build
|
|
||||||
# breakage before a release); the ~74 minutes here is otherwise dominated
|
|
||||||
# by the fat-LTO link, which no cache avoids.
|
|
||||||
- uses: ./.github/workflows/build_windows_wheel
|
- uses: ./.github/workflows/build_windows_wheel
|
||||||
with:
|
with:
|
||||||
python-minor-version: 10
|
python-minor-version: 10
|
||||||
args: "--release --strip"
|
args: "--release --strip"
|
||||||
- uses: actions/upload-artifact@v7
|
vcpkg_token: ${{ secrets.VCPKG_GITHUB_PACKAGES }}
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
- uses: ./.github/workflows/upload_wheel
|
||||||
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
with:
|
with:
|
||||||
name: wheels-windows
|
pypi_token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }}
|
||||||
path: target/wheels/lancedb-*.whl
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
||||||
if-no-files-found: error
|
gh-release:
|
||||||
publish:
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
||||||
name: Publish wheels
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
needs: [linux, mac, windows]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
contents: write
|
||||||
contents: read
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Download wheel artifacts
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
with:
|
||||||
pattern: wheels-*
|
fetch-depth: 0
|
||||||
path: target/wheels
|
lfs: true
|
||||||
merge-multiple: true
|
- name: Extract version
|
||||||
- name: List wheels
|
id: extract_version
|
||||||
run: ls -la target/wheels
|
|
||||||
- name: Choose repo
|
|
||||||
id: choose_repo
|
|
||||||
run: |
|
|
||||||
if [[ ${{ github.ref }} == *beta* ]]; then
|
|
||||||
echo "repo=fury" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "repo=pypi" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
- name: Publish to Fury
|
|
||||||
if: steps.choose_repo.outputs.repo == 'fury'
|
|
||||||
env:
|
env:
|
||||||
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
|
GITHUB_REF: ${{ github.ref }}
|
||||||
run: |
|
run: |
|
||||||
shopt -s nullglob
|
set -e
|
||||||
WHEELS=(target/wheels/*.whl)
|
echo "Extracting tag and version from $GITHUB_REF"
|
||||||
if [[ ${#WHEELS[@]} -eq 0 ]]; then
|
if [[ $GITHUB_REF =~ refs/tags/python-v(.*) ]]; then
|
||||||
echo "No wheels found in target/wheels/" >&2
|
VERSION=${BASH_REMATCH[1]}
|
||||||
|
TAG=python-v$VERSION
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Failed to extract version from $GITHUB_REF"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
for WHEEL in "${WHEELS[@]}"; do
|
echo "Extracted version $VERSION from $GITHUB_REF"
|
||||||
echo "Uploading $WHEEL to Fury"
|
if [[ $VERSION =~ beta ]]; then
|
||||||
curl -f -F package=@"$WHEEL" "https://$FURY_TOKEN@push.fury.io/lancedb/"
|
echo "This is a beta release"
|
||||||
done
|
|
||||||
# NOTE: pypa/gh-action-pypi-publish must be invoked directly from a
|
# Get last release (that is not this one)
|
||||||
# workflow file, not from inside a composite action. When called from a
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
# composite, `github.action_repository` is empty (actions/runner#2473)
|
| grep ^python-v \
|
||||||
# and the action falls back to `github.repository`, producing a bogus
|
| grep -vF "$TAG" \
|
||||||
# `docker://ghcr.io/<repo>:<ref>` image reference that GHA tries to pull.
|
| python ci/semver_sort.py python-v \
|
||||||
- name: Publish to PyPI
|
| tail -n 1)
|
||||||
if: steps.choose_repo.outputs.repo == 'pypi'
|
else
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
echo "This is a stable release"
|
||||||
|
# Get last stable tag (ignore betas)
|
||||||
|
FROM_TAG=$(git tag --sort='version:refname' \
|
||||||
|
| grep ^python-v \
|
||||||
|
| grep -vF "$TAG" \
|
||||||
|
| grep -v beta \
|
||||||
|
| python ci/semver_sort.py python-v \
|
||||||
|
| tail -n 1)
|
||||||
|
fi
|
||||||
|
echo "Found from tag $FROM_TAG"
|
||||||
|
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
||||||
|
- name: Create Python Release Notes
|
||||||
|
id: python_release_notes
|
||||||
|
uses: mikepenz/release-changelog-builder-action@v4
|
||||||
with:
|
with:
|
||||||
packages-dir: target/wheels/
|
configuration: .github/release_notes.json
|
||||||
|
toTag: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Create Python GH release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
prerelease: ${{ contains('beta', github.ref) }}
|
||||||
|
tag_name: ${{ steps.extract_version.outputs.tag }}
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
generate_release_notes: false
|
||||||
|
name: Python LanceDB v${{ steps.extract_version.outputs.version }}
|
||||||
|
body: ${{ steps.python_release_notes.outputs.changelog }}
|
||||||
report-failure:
|
report-failure:
|
||||||
name: Report Workflow Failure
|
name: Report Workflow Failure
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [linux, mac, windows, publish]
|
needs: [linux, mac, windows]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
if: always() && failure() && startsWith(github.ref, 'refs/tags/v')
|
if: always() && failure() && startsWith(github.ref, 'refs/tags/python-v')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/create-failure-issue
|
- uses: ./.github/actions/create-failure-issue
|
||||||
with:
|
with:
|
||||||
job-results: ${{ toJSON(needs) }}
|
job-results: ${{ toJSON(needs) }}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- Cargo.toml
|
- Cargo.toml
|
||||||
- Cargo.lock
|
|
||||||
- rust-toolchain.toml
|
|
||||||
- python/**
|
- python/**
|
||||||
- rust/**
|
- rust/**
|
||||||
- .github/workflows/python.yml
|
- .github/workflows/python.yml
|
||||||
@@ -17,9 +15,6 @@ on:
|
|||||||
- .github/workflows/build_windows_wheel/**
|
- .github/workflows/build_windows_wheel/**
|
||||||
- .github/workflows/run_tests/**
|
- .github/workflows/run_tests/**
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -41,7 +36,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -66,7 +61,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -95,7 +90,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -108,18 +103,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y protobuf-compiler
|
sudo apt install -y protobuf-compiler
|
||||||
# `pip install -e .` builds the extension with maturin, which is most of
|
|
||||||
# this job's ~33 minutes. It had no Rust cache, so every dependency was
|
|
||||||
# recompiled from scratch on every run.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests,dev,embeddings]
|
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests,dev,embeddings]
|
||||||
|
pip install tantivy
|
||||||
pip install mlx
|
pip install mlx
|
||||||
- name: Doctest
|
- name: Doctest
|
||||||
run: pytest --doctest-modules python/lancedb
|
run: pytest --doctest-modules python/lancedb
|
||||||
@@ -135,7 +122,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -169,7 +156,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -177,14 +164,6 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
# maturin runs cargo natively on macOS (docker is Linux-only), so the host
|
|
||||||
# target dir is cacheable. This job had no Rust cache.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- uses: ./.github/workflows/build_mac_wheel
|
- uses: ./.github/workflows/build_mac_wheel
|
||||||
with:
|
with:
|
||||||
args: --profile ci
|
args: --profile ci
|
||||||
@@ -206,7 +185,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -214,14 +193,6 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
# maturin runs cargo natively on Windows (docker is Linux-only), so the
|
|
||||||
# host target dir is cacheable. This job had no Rust cache at all and so
|
|
||||||
# rebuilt every dependency from scratch on every run.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. The repo sits at
|
|
||||||
# GitHub's cache cap, so per-PR saves just evict main's entries.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- uses: ./.github/workflows/build_windows_wheel
|
- uses: ./.github/workflows/build_windows_wheel
|
||||||
with:
|
with:
|
||||||
args: --profile ci
|
args: --profile ci
|
||||||
@@ -230,14 +201,14 @@ jobs:
|
|||||||
- name: Delete wheels
|
- name: Delete wheels
|
||||||
run: rm -rf target/wheels
|
run: rm -rf target/wheels
|
||||||
pydantic1x:
|
pydantic1x:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 30
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-24.04"
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: python
|
working-directory: python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -249,18 +220,11 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
# As with Doctest, `pip install -e .` compiles the extension and this job
|
|
||||||
# had no Rust cache, which is most of its ~37 minutes.
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install lancedb
|
- name: Install lancedb
|
||||||
run: |
|
run: |
|
||||||
pip install "pydantic<2"
|
pip install "pydantic<2"
|
||||||
pip install pyarrow==16
|
pip install pyarrow==16
|
||||||
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests]
|
pip install --extra-index-url https://pypi.fury.io/lance-format/ --extra-index-url https://pypi.fury.io/lancedb/ -e .[tests]
|
||||||
|
pip install tantivy
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pytest -m "not slow and not s3_test" -x -v --durations=30 python/tests
|
run: pytest -m "not slow and not s3_test" -x -v --durations=30 python/tests
|
||||||
|
|||||||
+27
-120
@@ -7,17 +7,9 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- Cargo.toml
|
- Cargo.toml
|
||||||
- Cargo.lock
|
|
||||||
- rust-toolchain.toml
|
|
||||||
- deny.toml
|
|
||||||
- rust/**
|
- rust/**
|
||||||
- nodejs/Cargo.toml
|
|
||||||
- python/Cargo.toml
|
|
||||||
- .github/workflows/rust.yml
|
- .github/workflows/rust.yml
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -40,7 +32,7 @@ jobs:
|
|||||||
CC: clang-18
|
CC: clang-18
|
||||||
CXX: clang++-18
|
CXX: clang++-18
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
@@ -48,11 +40,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -64,17 +51,6 @@ jobs:
|
|||||||
- name: Run clippy (without remote feature)
|
- name: Run clippy (without remote feature)
|
||||||
run: cargo clippy --profile ci --workspace --tests -- -D warnings
|
run: cargo clippy --profile ci --workspace --tests -- -D warnings
|
||||||
|
|
||||||
deny:
|
|
||||||
# Supply-chain checks: advisories, licenses, banned crates, and source
|
|
||||||
# restrictions. Configuration lives in `deny.toml` at the workspace root.
|
|
||||||
timeout-minutes: 10
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: EmbarkStudios/cargo-deny-action@v2
|
|
||||||
with:
|
|
||||||
command: check advisories bans licenses sources
|
|
||||||
|
|
||||||
build-no-lock:
|
build-no-lock:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
@@ -83,7 +59,7 @@ jobs:
|
|||||||
CC: clang
|
CC: clang
|
||||||
CXX: clang++
|
CXX: clang++
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
# Building without a lock file often requires the latest Rust version since downstream
|
# Building without a lock file often requires the latest Rust version since downstream
|
||||||
# dependencies may have updated their minimum Rust version.
|
# dependencies may have updated their minimum Rust version.
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
@@ -94,11 +70,6 @@ jobs:
|
|||||||
run: rm -f Cargo.lock
|
run: rm -f Cargo.lock
|
||||||
- uses: rui314/setup-mold@v1
|
- uses: rui314/setup-mold@v1
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -108,7 +79,7 @@ jobs:
|
|||||||
cargo build --profile ci --benches --all-features --tests
|
cargo build --profile ci --benches --all-features --tests
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 30
|
||||||
# To build all features, we need more disk space than is available
|
# To build all features, we need more disk space than is available
|
||||||
# on the free OSS github runner. This is mostly due to the the
|
# on the free OSS github runner. This is mostly due to the the
|
||||||
# sentence-transformers feature.
|
# sentence-transformers feature.
|
||||||
@@ -123,16 +94,11 @@ jobs:
|
|||||||
CXX: clang++-18
|
CXX: clang++-18
|
||||||
GH_TOKEN: ${{ secrets.SOPHON_READ_TOKEN }}
|
GH_TOKEN: ${{ secrets.SOPHON_READ_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -140,26 +106,10 @@ jobs:
|
|||||||
- uses: rui314/setup-mold@v1
|
- uses: rui314/setup-mold@v1
|
||||||
- name: Make Swap
|
- name: Make Swap
|
||||||
run: |
|
run: |
|
||||||
swapfile=/swapfile
|
sudo fallocate -l 16G /swapfile
|
||||||
min_swap_bytes=$((15 * 1024 * 1024 * 1024))
|
sudo chmod 600 /swapfile
|
||||||
active_swap_bytes="$(sudo swapon --show=NAME,SIZE --bytes --noheadings | awk '$1 == "/swapfile" { print $2 }')"
|
sudo mkswap /swapfile
|
||||||
if [ -n "$active_swap_bytes" ]; then
|
sudo swapon /swapfile
|
||||||
if [ "$active_swap_bytes" -ge "$min_swap_bytes" ]; then
|
|
||||||
echo "/swapfile is already active with enough space; skipping swap creation"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "/swapfile is already active but smaller than 16G; using /mnt/lancedb-swapfile"
|
|
||||||
swapfile=/mnt/lancedb-swapfile
|
|
||||||
fi
|
|
||||||
if sudo swapon --show=NAME --noheadings | grep -Fxq "$swapfile"; then
|
|
||||||
echo "$swapfile is already active; skipping swap creation"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
sudo rm -f "$swapfile"
|
|
||||||
sudo fallocate -l 16G "$swapfile"
|
|
||||||
sudo chmod 600 "$swapfile"
|
|
||||||
sudo mkswap "$swapfile"
|
|
||||||
sudo swapon "$swapfile"
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --profile ci --all-features --tests --locked --examples
|
run: cargo build --profile ci --all-features --tests --locked --examples
|
||||||
- name: Run feature tests
|
- name: Run feature tests
|
||||||
@@ -173,7 +123,7 @@ jobs:
|
|||||||
run: CARGO_ARGS="--profile ci" make -C ./lancedb remote-tests
|
run: CARGO_ARGS="--profile ci" make -C ./lancedb remote-tests
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
mac-runner: ["macos-14", "macos-15"]
|
mac-runner: ["macos-14", "macos-15"]
|
||||||
@@ -183,18 +133,13 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: rust
|
working-directory: rust
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- name: CPU features
|
- name: CPU features
|
||||||
run: sysctl -a | grep cpu
|
run: sysctl -a | grep cpu
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: brew install protobuf
|
run: brew install protobuf
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
@@ -207,32 +152,20 @@ jobs:
|
|||||||
cargo test --profile ci --features $ALL_FEATURES --locked
|
cargo test --profile ci --features $ALL_FEATURES --locked
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
|
runs-on: windows-2022
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
target:
|
||||||
- target: x86_64-pc-windows-msvc
|
- x86_64-pc-windows-msvc
|
||||||
runner: windows-2022
|
- aarch64-pc-windows-msvc
|
||||||
# windows-11-arm is a standard runner, so it is free on public repos.
|
|
||||||
# Running natively lets the aarch64 tests actually execute -- this
|
|
||||||
# job used to cross-compile them and then skip the test step, paying
|
|
||||||
# full codegen and link cost for a compile check.
|
|
||||||
- target: aarch64-pc-windows-msvc
|
|
||||||
runner: windows-11-arm
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: rust/lancedb
|
working-directory: rust/lancedb
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- name: Set target
|
- name: Set target
|
||||||
run: rustup target add ${{ matrix.target }}
|
run: rustup target add ${{ matrix.target }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Install Protoc v21.12
|
- name: Install Protoc v21.12
|
||||||
run: choco install --no-progress protoc
|
run: choco install --no-progress protoc
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -240,12 +173,11 @@ jobs:
|
|||||||
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
||||||
cargo build --profile ci --features aws,remote --tests --locked --target ${{ matrix.target }}
|
cargo build --profile ci --features aws,remote --tests --locked --target ${{ matrix.target }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
# Can only run tests when target matches host
|
||||||
|
if: ${{ matrix.target == 'x86_64-pc-windows-msvc' }}
|
||||||
run: |
|
run: |
|
||||||
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
$env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
|
||||||
# `--target` has to match the build step above. Without it cargo uses
|
cargo test --profile ci --features aws,remote --locked
|
||||||
# target/ci/ rather than target/<triple>/ci/ and rebuilds the entire
|
|
||||||
# dependency graph a second time.
|
|
||||||
cargo test --profile ci --features aws,remote --locked --target ${{ matrix.target }}
|
|
||||||
|
|
||||||
msrv:
|
msrv:
|
||||||
# Check the minimum supported Rust version
|
# Check the minimum supported Rust version
|
||||||
@@ -259,7 +191,7 @@ jobs:
|
|||||||
CC: clang-18
|
CC: clang-18
|
||||||
CXX: clang++-18
|
CXX: clang++-18
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -271,42 +203,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.msrv }}
|
toolchain: ${{ matrix.msrv }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
|
||||||
# Restore everywhere, but only save from main. Per-PR saves are
|
|
||||||
# unreadable outside their own branch anyway, since GitHub scopes
|
|
||||||
# caches to the creating ref.
|
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
- name: Downgrade dependencies
|
- name: Downgrade dependencies
|
||||||
# These packages have newer requirements for MSRV
|
# These packages have newer requirements for MSRV
|
||||||
run: |
|
run: |
|
||||||
cargo update -p aws-sdk-bedrockruntime --precise 1.77.0
|
cargo update -p aws-sdk-bedrockruntime --precise 1.64.0
|
||||||
cargo update -p aws-sdk-dynamodb --precise 1.68.0
|
cargo update -p aws-sdk-dynamodb --precise 1.55.0
|
||||||
cargo update -p aws-config --precise 1.6.0
|
cargo update -p aws-config --precise 1.5.10
|
||||||
cargo update -p aws-sdk-kms --precise 1.63.0
|
cargo update -p aws-sdk-kms --precise 1.51.0
|
||||||
cargo update -p aws-sdk-s3 --precise 1.79.0
|
cargo update -p aws-sdk-s3 --precise 1.65.0
|
||||||
cargo update -p aws-sdk-sso --precise 1.62.0
|
cargo update -p aws-sdk-sso --precise 1.50.0
|
||||||
cargo update -p aws-sdk-ssooidc --precise 1.63.0
|
cargo update -p aws-sdk-ssooidc --precise 1.51.0
|
||||||
cargo update -p aws-sdk-sts --precise 1.63.0
|
cargo update -p aws-sdk-sts --precise 1.51.0
|
||||||
# aws-runtime/sigv4/credential-types/types and the aws-smithy-*
|
|
||||||
# crates bumped their MSRV to 1.91.1 in late 2026; pin to the last
|
|
||||||
# 1.91.0-compatible versions. The order matters — each downgrade
|
|
||||||
# only succeeds once everything that still pins it at a higher
|
|
||||||
# version has itself been downgraded.
|
|
||||||
cargo update -p aws-runtime --precise 1.5.12
|
|
||||||
cargo update -p aws-types --precise 1.3.9
|
|
||||||
cargo update -p aws-sigv4 --precise 1.3.5
|
|
||||||
cargo update -p aws-credential-types --precise 1.2.8
|
|
||||||
cargo update -p aws-smithy-checksums --precise 0.63.9
|
|
||||||
cargo update -p aws-smithy-runtime --precise 1.9.3
|
|
||||||
cargo update -p aws-smithy-http --precise 0.62.4
|
|
||||||
cargo update -p aws-smithy-eventstream --precise 0.60.12
|
|
||||||
cargo update -p aws-smithy-http-client --precise 1.1.3
|
|
||||||
cargo update -p aws-smithy-observability --precise 0.1.4
|
|
||||||
cargo update -p aws-smithy-query --precise 0.60.8
|
|
||||||
cargo update -p aws-smithy-runtime-api --precise 1.9.1
|
|
||||||
cargo update -p aws-smithy-async --precise 1.2.6
|
|
||||||
cargo update -p aws-smithy-types --precise 1.3.5
|
|
||||||
cargo update -p aws-smithy-xml --precise 0.60.11
|
|
||||||
cargo update -p home --precise 0.5.9
|
cargo update -p home --precise 0.5.9
|
||||||
- name: cargo +${{ matrix.msrv }} check
|
- name: cargo +${{ matrix.msrv }} check
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -3,15 +3,12 @@ name: Update package-lock.json
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|||||||
@@ -3,15 +3,12 @@ name: Update NodeJs package-lock.json
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: upload-wheel
|
||||||
|
|
||||||
|
description: "Upload wheels to Pypi"
|
||||||
|
inputs:
|
||||||
|
pypi_token:
|
||||||
|
required: true
|
||||||
|
description: "release token for the repo"
|
||||||
|
fury_token:
|
||||||
|
required: true
|
||||||
|
description: "release token for the fury repo"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install twine
|
||||||
|
python3 -m pip install --upgrade pkginfo
|
||||||
|
- name: Choose repo
|
||||||
|
shell: bash
|
||||||
|
id: choose_repo
|
||||||
|
run: |
|
||||||
|
if [[ ${{ github.ref }} == *beta* ]]; then
|
||||||
|
echo "repo=fury" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "repo=pypi" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
- name: Publish to PyPI
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
FURY_TOKEN: ${{ inputs.fury_token }}
|
||||||
|
PYPI_TOKEN: ${{ inputs.pypi_token }}
|
||||||
|
run: |
|
||||||
|
if [[ ${{ steps.choose_repo.outputs.repo }} == fury ]]; then
|
||||||
|
WHEEL=$(ls target/wheels/lancedb-*.whl 2> /dev/null | head -n 1)
|
||||||
|
echo "Uploading $WHEEL to Fury"
|
||||||
|
curl -f -F package=@$WHEEL https://$FURY_TOKEN@push.fury.io/lancedb/
|
||||||
|
else
|
||||||
|
twine upload --repository ${{ steps.choose_repo.outputs.repo }} \
|
||||||
|
--username __token__ \
|
||||||
|
--password $PYPI_TOKEN \
|
||||||
|
target/wheels/lancedb-*.whl
|
||||||
|
fi
|
||||||
@@ -27,7 +27,6 @@ python/dist
|
|||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
*.dll
|
*.dll
|
||||||
*.pdb
|
|
||||||
|
|
||||||
## Javascript
|
## Javascript
|
||||||
*.node
|
*.node
|
||||||
|
|||||||
@@ -17,33 +17,9 @@ Common commands:
|
|||||||
* Run tests: `cargo test --quiet --features remote --tests`
|
* Run tests: `cargo test --quiet --features remote --tests`
|
||||||
* Run specific test: `cargo test --quiet --features remote -p <package_name> --test <test_name>`
|
* Run specific test: `cargo test --quiet --features remote -p <package_name> --test <test_name>`
|
||||||
* Lint: `cargo clippy --quiet --features remote --tests --examples`
|
* Lint: `cargo clippy --quiet --features remote --tests --examples`
|
||||||
* Format Rust: `cargo fmt --all`
|
* Format: `cargo fmt --all`
|
||||||
* Format Python: `ruff format .`
|
|
||||||
* Lint Python: `ruff check .`
|
|
||||||
* Bootstrap Python dev env: `cd python && uv run --extra tests --extra dev maturin develop --extras tests,dev`
|
|
||||||
* Run Python tests: `cd python && uv run --extra tests pytest python/tests -vv --durations=10 -m "not slow and not s3_test"`
|
|
||||||
* Run specific Python test: `cd python && uv run --extra tests pytest python/tests/<test_file>.py::<test_name> -q`
|
|
||||||
|
|
||||||
For Python validation, prefer the uv-managed environment declared by `python/uv.lock`.
|
Before committing changes, run formatting.
|
||||||
Do not treat system `python`, global `pytest`, or missing editable-install errors as
|
|
||||||
final blockers; bootstrap or enter the uv environment instead. If `lancedb._lancedb`
|
|
||||||
is missing or stale, or if Rust/PyO3 binding code changed, rebuild the Python
|
|
||||||
extension with the bootstrap command above before running tests.
|
|
||||||
|
|
||||||
Before committing changes, run formatting for every language you touched. At minimum:
|
|
||||||
|
|
||||||
* Rust changes: run `cargo fmt --all`.
|
|
||||||
* Python changes: run `ruff format .` and `ruff check .` from the repository root,
|
|
||||||
and run targeted tests through `cd python && uv run ...`.
|
|
||||||
* TypeScript changes: run the relevant `npm`/`pnpm` lint, format, build, and docs commands in `nodejs`.
|
|
||||||
|
|
||||||
Before creating a PR, the exact value passed to `gh pr create --title` must follow
|
|
||||||
Conventional Commits, such as `fix: support nested field paths in native index creation`
|
|
||||||
or `feat(python): add dataset multiprocessing support`. Do not use a plain natural
|
|
||||||
language summary like `Support nested field paths in native index creation` as the PR
|
|
||||||
title. The semantic-release check uses the PR title and body as the merge commit message,
|
|
||||||
so a non-conventional PR title will fail CI. After creating a PR, read the remote PR title
|
|
||||||
back and fix it immediately if it is not conventional.
|
|
||||||
|
|
||||||
## Coding tips
|
## Coding tips
|
||||||
|
|
||||||
@@ -92,8 +68,6 @@ Python bindings changes:
|
|||||||
* Should use `LOOP.run()` to call the corresponding `AsyncTable` method.
|
* Should use `LOOP.run()` to call the corresponding `AsyncTable` method.
|
||||||
6. Add concrete sync method to `RemoteTable` class in `python/python/lancedb/remote/table.py`.
|
6. Add concrete sync method to `RemoteTable` class in `python/python/lancedb/remote/table.py`.
|
||||||
7. Add unit test in `python/tests/test_table.py`.
|
7. Add unit test in `python/tests/test_table.py`.
|
||||||
8. If you added a new public class or module-level function (not just a method on an
|
|
||||||
existing class), expose it in the API reference. See "Python API reference" below.
|
|
||||||
|
|
||||||
TypeScript bindings changes:
|
TypeScript bindings changes:
|
||||||
|
|
||||||
@@ -105,33 +79,6 @@ TypeScript bindings changes:
|
|||||||
5. Add test in `nodejs/__test__/table.test.ts`.
|
5. Add test in `nodejs/__test__/table.test.ts`.
|
||||||
6. Run `npm run docs` to generate TypeScript documentation.
|
6. Run `npm run docs` to generate TypeScript documentation.
|
||||||
|
|
||||||
## Python API reference
|
|
||||||
|
|
||||||
`docs/src/python/python.md` is the entire Python API reference. It is maintained by
|
|
||||||
hand, and anything not listed there is not rendered at all, so new public classes and
|
|
||||||
module-level functions have to be added explicitly. How depends on the module:
|
|
||||||
|
|
||||||
* `lancedb.index`, `lancedb.embeddings`, `lancedb.remote`, and `lancedb.rerankers` are
|
|
||||||
rendered by a single directive each, driven by the module's `__all__`. Add the new
|
|
||||||
name to `__all__` and it appears; forget, and it is silently omitted.
|
|
||||||
* Everything else (`lancedb`, `lancedb.table`, `lancedb.query`, `lancedb.db`, ...) is
|
|
||||||
listed symbol by symbol. Add a `::: lancedb.<module>.<Name>` line to the matching
|
|
||||||
section, and remember that the page separates synchronous and asynchronous APIs.
|
|
||||||
|
|
||||||
Deliberately undocumented: concrete implementations reached through an abstract base
|
|
||||||
(`LanceTable`, `LanceDBConnection`, `RemoteDBConnection`), query base classes already
|
|
||||||
covered by `inherited_members`, and internal helpers.
|
|
||||||
|
|
||||||
Cross-references in docstrings use mkdocstrings syntax, `[text][lancedb.table.Table]`.
|
|
||||||
Plain relative links such as `[Table](Table)` do not resolve. To check your work:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pip install -r docs/requirements.txt
|
|
||||||
cd docs && PYTHONPATH=. mkdocs build
|
|
||||||
```
|
|
||||||
|
|
||||||
The docs site only builds on pushes to `main`, so this is not covered by PR CI.
|
|
||||||
|
|
||||||
## Review Guidelines
|
## Review Guidelines
|
||||||
|
|
||||||
Please consider the following when reviewing code contributions.
|
Please consider the following when reviewing code contributions.
|
||||||
|
|||||||
Generated
+1941
-3637
File diff suppressed because it is too large
Load Diff
+35
-35
@@ -1,5 +1,7 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = ["rust/lancedb", "nodejs", "python"]
|
members = ["rust/lancedb", "nodejs", "python"]
|
||||||
|
# Python package needs to be built by maturin.
|
||||||
|
exclude = ["python"]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
@@ -13,57 +15,55 @@ categories = ["database-implementations"]
|
|||||||
rust-version = "1.91.0"
|
rust-version = "1.91.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
lance = { "version" = "=10.0.0-beta.5", default-features = false, "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance = { "version" = "=3.0.0-rc.3", default-features = false, "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-core = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-core = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-datagen = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-datagen = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-file = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-file = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-io = { "version" = "=10.0.0-beta.5", default-features = false, "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-io = { "version" = "=3.0.0-rc.3", default-features = false, "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-index = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-index = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-linalg = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-linalg = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-namespace = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-namespace = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-namespace-impls = { "version" = "=10.0.0-beta.5", default-features = false, "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-namespace-impls = { "version" = "=3.0.0-rc.3", default-features = false, "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-table = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-table = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-testing = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-testing = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-datafusion = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-datafusion = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-encoding = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-encoding = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
lance-arrow = { "version" = "=10.0.0-beta.5", "tag" = "v10.0.0-beta.5", "git" = "https://github.com/lance-format/lance.git" }
|
lance-arrow = { "version" = "=3.0.0-rc.3", "tag" = "v3.0.0-rc.3", "git" = "https://github.com/lance-format/lance.git" }
|
||||||
ahash = "0.8"
|
ahash = "0.8"
|
||||||
# Note that this one does not include pyarrow
|
# Note that this one does not include pyarrow
|
||||||
arrow = { version = "58.0.0", optional = false }
|
arrow = { version = "57.2", optional = false }
|
||||||
arrow-array = "58.0.0"
|
arrow-array = "57.2"
|
||||||
arrow-buffer = "58.0.0"
|
arrow-data = "57.2"
|
||||||
arrow-data = "58.0.0"
|
arrow-ipc = "57.2"
|
||||||
arrow-ipc = "58.0.0"
|
arrow-ord = "57.2"
|
||||||
arrow-ord = "58.0.0"
|
arrow-schema = "57.2"
|
||||||
arrow-schema = "58.0.0"
|
arrow-select = "57.2"
|
||||||
arrow-select = "58.0.0"
|
arrow-cast = "57.2"
|
||||||
arrow-cast = "58.0.0"
|
|
||||||
async-trait = "0"
|
async-trait = "0"
|
||||||
datafusion = { version = "54.0.0", default-features = false }
|
datafusion = { version = "52.1", default-features = false }
|
||||||
datafusion-catalog = "54.0.0"
|
datafusion-catalog = "52.1"
|
||||||
datafusion-common = { version = "54.0.0", default-features = false }
|
datafusion-common = { version = "52.1", default-features = false }
|
||||||
datafusion-execution = "54.0.0"
|
datafusion-execution = "52.1"
|
||||||
datafusion-expr = "54.0.0"
|
datafusion-expr = "52.1"
|
||||||
datafusion-functions = "54.0.0"
|
datafusion-functions = "52.1"
|
||||||
datafusion-physical-plan = "54.0.0"
|
datafusion-physical-plan = "52.1"
|
||||||
datafusion-physical-expr = "54.0.0"
|
datafusion-physical-expr = "52.1"
|
||||||
datafusion-sql = "54.0.0"
|
datafusion-sql = "52.1"
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
half = { "version" = "2.7.1", default-features = false, features = [
|
half = { "version" = "2.7.1", default-features = false, features = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
] }
|
] }
|
||||||
futures = "0"
|
futures = "0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
metrics = "0.24"
|
|
||||||
metrics-util = "0.19"
|
|
||||||
moka = { version = "0.12", features = ["future"] }
|
moka = { version = "0.12", features = ["future"] }
|
||||||
object_store = "0.13.2"
|
object_store = "0.12.0"
|
||||||
pin-project = "1.0.7"
|
pin-project = "1.0.7"
|
||||||
rand = "0.9"
|
rand = "0.9"
|
||||||
snafu = "0.8"
|
snafu = "0.8"
|
||||||
url = "2"
|
url = "2"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
regex = "1.10"
|
regex = "1.10"
|
||||||
|
lazy_static = "1"
|
||||||
semver = "1.0.25"
|
semver = "1.0.25"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
# **The Multimodal AI Lakehouse**
|
# **The Multimodal AI Lakehouse**
|
||||||
|
|
||||||
[**How to Install** ](#how-to-install) ✦ [**Detailed Documentation**](https://docs.lancedb.com) ✦ [**Tutorials and Recipes**](https://github.com/lancedb/vectordb-recipes/tree/main) ✦ [**Contributors**](#contributors)
|
[**How to Install** ](#how-to-install) ✦ [**Detailed Documentation**](https://lancedb.com/docs) ✦ [**Tutorials and Recipes**](https://github.com/lancedb/vectordb-recipes/tree/main) ✦ [**Contributors**](#contributors)
|
||||||
|
|
||||||
**The ultimate multimodal data platform for AI/ML applications.**
|
**The ultimate multimodal data platform for AI/ML applications.**
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ LanceDB is a central location where developers can build, train and analyze thei
|
|||||||
|
|
||||||
## **How to Install**:
|
## **How to Install**:
|
||||||
|
|
||||||
Follow the [Quickstart](https://docs.lancedb.com/quickstart) doc to set up LanceDB locally.
|
Follow the [Quickstart](https://lancedb.com/docs/quickstart/) doc to set up LanceDB locally.
|
||||||
|
|
||||||
**API & SDK:** We also support Python, Typescript and Rust SDKs
|
**API & SDK:** We also support Python, Typescript and Rust SDKs
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
# Code review guidelines
|
|
||||||
|
|
||||||
Repo-specific guidance for automated PR reviews.
|
|
||||||
|
|
||||||
## Cross-SDK parity
|
|
||||||
|
|
||||||
LanceDB exposes the same core (`rust/lancedb`) through Python, TypeScript (`nodejs`),
|
|
||||||
and Java bindings. Behavioral drift between SDKs is a recurring problem, so watch for
|
|
||||||
parity gaps when reviewing — but only flag real ones:
|
|
||||||
|
|
||||||
* If the change adds or modifies user-facing API or behavior in the shared core
|
|
||||||
(`rust/lancedb`), check whether each binding that should expose it (`python`,
|
|
||||||
`nodejs`) does. A core change with no corresponding binding update is worth a note.
|
|
||||||
* If the change adds or modifies a public API in one SDK but not the other, open the
|
|
||||||
sibling SDK's corresponding module and state whether an equivalent exists. If not,
|
|
||||||
note it as a possible parity gap and suggest a follow-up issue.
|
|
||||||
* For bug fixes, first read the sibling SDK's analogous code path to check whether the
|
|
||||||
same bug exists there. Only raise parity if it actually does. Do not ask to "port" a
|
|
||||||
fix for a bug that only ever existed in one binding.
|
|
||||||
* Stay silent on internal-only refactors, tests, docs, and changes with no cross-SDK
|
|
||||||
surface.
|
|
||||||
* Parity expectations apply to the Python and TypeScript (`nodejs`) SDKs. Java currently
|
|
||||||
implements only the remote table, not the local/embedded backend, so it is expected to
|
|
||||||
be partial — do not flag Java for missing local-only functionality.
|
|
||||||
* Keep parity feedback to a short, clearly-labeled note (e.g. "Possible SDK parity
|
|
||||||
gap: …"). It is advisory, not a merge blocker.
|
|
||||||
+3
-3
@@ -2,9 +2,9 @@ set -e
|
|||||||
|
|
||||||
RELEASE_TYPE=${1:-"stable"}
|
RELEASE_TYPE=${1:-"stable"}
|
||||||
BUMP_MINOR=${2:-false}
|
BUMP_MINOR=${2:-false}
|
||||||
HEAD_SHA=$(git rev-parse HEAD)
|
TAG_PREFIX=${3:-"v"} # Such as "python-v"
|
||||||
|
HEAD_SHA=${4:-$(git rev-parse HEAD)}
|
||||||
|
|
||||||
readonly TAG_PREFIX="v"
|
|
||||||
readonly SELF_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
readonly SELF_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|
||||||
PREV_TAG=$(git tag --sort='version:refname' | grep ^$TAG_PREFIX | python $SELF_DIR/semver_sort.py $TAG_PREFIX | tail -n 1)
|
PREV_TAG=$(git tag --sort='version:refname' | grep ^$TAG_PREFIX | python $SELF_DIR/semver_sort.py $TAG_PREFIX | tail -n 1)
|
||||||
@@ -12,7 +12,7 @@ echo "Found previous tag $PREV_TAG"
|
|||||||
|
|
||||||
# Initially, we don't want to tag if we are doing stable, because we will bump
|
# Initially, we don't want to tag if we are doing stable, because we will bump
|
||||||
# again later. See comment at end for why.
|
# again later. See comment at end for why.
|
||||||
if [[ "$RELEASE_TYPE" == 'stable' ]]; then
|
if [[ "$RELEASE_TYPE" == 'stable' ]]; then
|
||||||
BUMP_ARGS="--no-tag"
|
BUMP_ARGS="--no-tag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import functools
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@@ -27,7 +26,6 @@ SEMVER_RE = re.compile(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@functools.total_ordering
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class SemVer:
|
class SemVer:
|
||||||
major: int
|
major: int
|
||||||
@@ -112,25 +110,25 @@ def fetch_remote_tags() -> List[TagInfo]:
|
|||||||
"api",
|
"api",
|
||||||
"-X",
|
"-X",
|
||||||
"GET",
|
"GET",
|
||||||
f"repos/{LANCE_REPO}/releases",
|
f"repos/{LANCE_REPO}/git/refs/tags",
|
||||||
|
"--paginate",
|
||||||
"--jq",
|
"--jq",
|
||||||
".[].tag_name",
|
".[].ref",
|
||||||
"-F",
|
|
||||||
"per_page=20",
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
tags: List[TagInfo] = []
|
tags: List[TagInfo] = []
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
tag = line.strip()
|
ref = line.strip()
|
||||||
if not tag.startswith("v"):
|
if not ref.startswith("refs/tags/v"):
|
||||||
continue
|
continue
|
||||||
|
tag = ref.split("refs/tags/")[-1]
|
||||||
version = tag.lstrip("v")
|
version = tag.lstrip("v")
|
||||||
try:
|
try:
|
||||||
tags.append(TagInfo(tag=tag, version=version, semver=parse_semver(version)))
|
tags.append(TagInfo(tag=tag, version=version, semver=parse_semver(version)))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
if not tags:
|
if not tags:
|
||||||
raise RuntimeError("No Lance releases could be parsed from GitHub API output")
|
raise RuntimeError("No Lance tags could be parsed from GitHub API output")
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
|
|
||||||
@@ -158,9 +156,7 @@ def read_current_version(repo_root: Path) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def determine_latest_tag(tags: Iterable[TagInfo]) -> TagInfo:
|
def determine_latest_tag(tags: Iterable[TagInfo]) -> TagInfo:
|
||||||
# Stable releases (no prerelease) are always preferred over pre-releases.
|
return max(tags, key=lambda tag: tag.semver)
|
||||||
# Within each group, standard semver ordering applies.
|
|
||||||
return max(tags, key=lambda tag: (not tag.semver.prerelease, tag.semver))
|
|
||||||
|
|
||||||
|
|
||||||
def write_outputs(args: argparse.Namespace, payload: dict) -> None:
|
def write_outputs(args: argparse.Namespace, payload: dict) -> None:
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""Prepare a Lance dependency update for LanceDB."""
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import json
|
|
||||||
import re
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
try:
|
|
||||||
from check_lance_release import parse_semver
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
# Supports importing as ci.update_lance_dependency from tests or ad hoc checks.
|
|
||||||
from ci.check_lance_release import parse_semver # type: ignore
|
|
||||||
|
|
||||||
|
|
||||||
def normalize_version(raw: str) -> str:
|
|
||||||
value = raw.strip()
|
|
||||||
value = value.removeprefix("refs/tags/")
|
|
||||||
value = value.removeprefix("v")
|
|
||||||
try:
|
|
||||||
parse_semver(value)
|
|
||||||
except ValueError:
|
|
||||||
raise ValueError(f"Unsupported Lance version or tag: {raw}")
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def normalized_tag(version: str) -> str:
|
|
||||||
return f"v{version}"
|
|
||||||
|
|
||||||
|
|
||||||
def branch_name(version: str) -> str:
|
|
||||||
suffix = re.sub(r"[^a-zA-Z0-9]+", "-", version).strip("-")
|
|
||||||
suffix = re.sub(r"-+", "-", suffix)
|
|
||||||
return f"codex/update-lance-{suffix}"
|
|
||||||
|
|
||||||
|
|
||||||
def commit_type(version: str) -> str:
|
|
||||||
prerelease = version.split("-", maxsplit=1)[1] if "-" in version else ""
|
|
||||||
return "chore" if "beta" in prerelease or "rc" in prerelease else "feat"
|
|
||||||
|
|
||||||
|
|
||||||
def metadata_for(version: str) -> dict[str, str]:
|
|
||||||
kind = commit_type(version)
|
|
||||||
message = f"{kind}: update lance dependency to v{version}"
|
|
||||||
return {
|
|
||||||
"version": version,
|
|
||||||
"tag": normalized_tag(version),
|
|
||||||
"branch_name": branch_name(version),
|
|
||||||
"commit_type": kind,
|
|
||||||
"commit_message": message,
|
|
||||||
"pr_title": message,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def run_command(cmd: Sequence[str], *, cwd: Path) -> None:
|
|
||||||
subprocess.run(cmd, cwd=cwd, check=True)
|
|
||||||
|
|
||||||
|
|
||||||
def update_java_lance_core_version(repo_root: Path, version: str) -> None:
|
|
||||||
pom_path = repo_root / "java" / "pom.xml"
|
|
||||||
contents = pom_path.read_text(encoding="utf-8")
|
|
||||||
updated, count = re.subn(
|
|
||||||
r"(<lance-core\.version>)[^<]+(</lance-core\.version>)",
|
|
||||||
rf"\g<1>{version}\g<2>",
|
|
||||||
contents,
|
|
||||||
count=1,
|
|
||||||
)
|
|
||||||
if count != 1:
|
|
||||||
raise RuntimeError(
|
|
||||||
"Expected exactly one <lance-core.version> entry in java/pom.xml"
|
|
||||||
)
|
|
||||||
pom_path.write_text(updated, encoding="utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
def write_github_outputs(path: str | None, payload: dict[str, str]) -> None:
|
|
||||||
if not path:
|
|
||||||
return
|
|
||||||
with open(path, "a", encoding="utf-8") as output:
|
|
||||||
for key, value in payload.items():
|
|
||||||
output.write(f"{key}={value}\n")
|
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
|
||||||
parser.add_argument(
|
|
||||||
"tag_or_version",
|
|
||||||
help="Lance tag or version, for example refs/tags/v7.2.0-beta.1 or 7.2.0",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--repo-root",
|
|
||||||
type=Path,
|
|
||||||
default=Path(__file__).resolve().parents[1],
|
|
||||||
help="Path to the lancedb repository root",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--github-output",
|
|
||||||
default=None,
|
|
||||||
help="Optional GitHub Actions output file to receive metadata fields",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--metadata-only",
|
|
||||||
action="store_true",
|
|
||||||
help="Only print derived metadata; do not modify dependency files",
|
|
||||||
)
|
|
||||||
args = parser.parse_args(argv)
|
|
||||||
|
|
||||||
repo_root = args.repo_root.resolve()
|
|
||||||
version = normalize_version(args.tag_or_version)
|
|
||||||
payload = metadata_for(version)
|
|
||||||
|
|
||||||
if not args.metadata_only:
|
|
||||||
run_command([sys.executable, "ci/set_lance_version.py", version], cwd=repo_root)
|
|
||||||
update_java_lance_core_version(repo_root, version)
|
|
||||||
|
|
||||||
write_github_outputs(args.github_output, payload)
|
|
||||||
print(json.dumps(payload, sort_keys=True))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
sys.exit(main())
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
# cargo-deny configuration for LanceDB.
|
|
||||||
#
|
|
||||||
# Run locally with `cargo deny check`. See
|
|
||||||
# https://embarkstudios.github.io/cargo-deny/ for the full reference.
|
|
||||||
|
|
||||||
# The set of target triples we care about. cargo-deny will only consider
|
|
||||||
# dependencies that are used on at least one of these targets. Keeping this
|
|
||||||
# explicit avoids noise from platform-specific crates (e.g. wasm, android,
|
|
||||||
# ios) that we never actually ship.
|
|
||||||
[graph]
|
|
||||||
targets = [
|
|
||||||
"x86_64-unknown-linux-gnu",
|
|
||||||
"aarch64-unknown-linux-gnu",
|
|
||||||
"x86_64-apple-darwin",
|
|
||||||
"aarch64-apple-darwin",
|
|
||||||
"x86_64-pc-windows-msvc",
|
|
||||||
"aarch64-pc-windows-msvc",
|
|
||||||
]
|
|
||||||
all-features = true
|
|
||||||
|
|
||||||
[output]
|
|
||||||
feature-depth = 1
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Advisories: security vulnerabilities and yanked crates.
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
[advisories]
|
|
||||||
version = 2
|
|
||||||
# Fail the check if any crate in the lockfile has been yanked from crates.io.
|
|
||||||
# Yanked crates are a signal the author retracted the release (often due to
|
|
||||||
# bugs or security issues) and should not be depended on.
|
|
||||||
yanked = "deny"
|
|
||||||
# Advisory IDs we have explicitly reviewed and chosen to accept. Every
|
|
||||||
# entry must include a rationale and, where possible, an upstream issue
|
|
||||||
# pointing to a fix. Revisit this list whenever dependencies are updated.
|
|
||||||
ignore = [
|
|
||||||
# rsa: Marvin Attack timing side-channel in PKCS#1 v1.5 decryption.
|
|
||||||
# Reached only through opendal → reqsign → rsa. We do not use RSA
|
|
||||||
# decryption in LanceDB ourselves; this is dormant in the signing path.
|
|
||||||
# No fixed release exists upstream as of this writing.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2023-0071
|
|
||||||
{ id = "RUSTSEC-2023-0071", reason = "rsa crate via opendal/reqsign; no fixed upstream release" },
|
|
||||||
|
|
||||||
# instant: unmaintained. Pulled in via backoff → instant. Upstream
|
|
||||||
# recommends switching to `web-time`; fix has to come from backoff.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2024-0384
|
|
||||||
{ id = "RUSTSEC-2024-0384", reason = "transitive via backoff; waiting on backoff replacement" },
|
|
||||||
|
|
||||||
# paste: unmaintained (author archived the repo). Used transitively by
|
|
||||||
# datafusion and the arrow ecosystem; widespread, no drop-in replacement.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2024-0436
|
|
||||||
{ id = "RUSTSEC-2024-0436", reason = "transitive via datafusion; awaiting ecosystem migration" },
|
|
||||||
|
|
||||||
# tantivy: segfault on malformed input due to missing bounds check.
|
|
||||||
# Pulled in via lance for full-text search. We only feed tantivy
|
|
||||||
# documents we construct ourselves, not attacker-controlled bytes.
|
|
||||||
# Tracked for a lance dependency bump.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2025-0003
|
|
||||||
{ id = "RUSTSEC-2025-0003", reason = "tantivy via lance; inputs are internally produced, not user-supplied bytes" },
|
|
||||||
|
|
||||||
# backoff: unmaintained. Reached only via async-openai. Replacement
|
|
||||||
# requires async-openai to migrate (or us to drop async-openai).
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2025-0012
|
|
||||||
{ id = "RUSTSEC-2025-0012", reason = "transitive via async-openai; waiting on upstream migration" },
|
|
||||||
|
|
||||||
# number_prefix: unmaintained. Transitive via indicatif → hf-hub.
|
|
||||||
# No security impact, just maintenance status.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2025-0119
|
|
||||||
{ id = "RUSTSEC-2025-0119", reason = "transitive via hf-hub/indicatif; cosmetic formatting crate" },
|
|
||||||
|
|
||||||
# rustls-webpki 0.101.7 (old major line): name-constraint checks for
|
|
||||||
# URI / wildcard names. Pulled in only via the legacy rustls 0.21 chain
|
|
||||||
# from aws-smithy-http-client. The 0.103 line we actively use is patched.
|
|
||||||
# Clearing the 0.101 copy requires the aws-sdk chain to migrate off
|
|
||||||
# rustls 0.21.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0098
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0099
|
|
||||||
{ id = "RUSTSEC-2026-0098", reason = "only affects rustls-webpki 0.101 from legacy aws-smithy/rustls 0.21 chain" },
|
|
||||||
{ id = "RUSTSEC-2026-0099", reason = "only affects rustls-webpki 0.101 from legacy aws-smithy/rustls 0.21 chain" },
|
|
||||||
|
|
||||||
# rustls-webpki 0.101.7: reachable panic in CRL parsing. Same legacy
|
|
||||||
# rustls 0.21 chain from aws-smithy-http-client as above. The 0.103 line
|
|
||||||
# we actively use is upgraded to 0.103.13 which contains the fix.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0104
|
|
||||||
{ id = "RUSTSEC-2026-0104", reason = "only affects rustls-webpki 0.101 from legacy aws-smithy/rustls 0.21 chain" },
|
|
||||||
|
|
||||||
# pyo3 advisories in the Python bindings; tracked pending a patched pyo3 release.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0176
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0177
|
|
||||||
{ id = "RUSTSEC-2026-0176", reason = "pyo3 in Python bindings; awaiting patched pyo3 release" },
|
|
||||||
{ id = "RUSTSEC-2026-0177", reason = "pyo3 in Python bindings; awaiting patched pyo3 release" },
|
|
||||||
|
|
||||||
# quick-xml < 0.41.0: quadratic runtime on duplicate attribute names (DoS).
|
|
||||||
# quick-xml < 0.41.0: unbounded namespace-declaration allocation in NsReader (DoS).
|
|
||||||
# Pulled in transitively by inferno (dev-only flame-graph dep), lance-namespace-impls
|
|
||||||
# (git dep from lance), and opendal/reqsign (cloud storage XML parsing). The XML
|
|
||||||
# parsed by opendal/reqsign comes from trusted cloud-storage endpoints (S3, GCS,
|
|
||||||
# Azure), not attacker-controlled input. Clearing requires upstream crates to migrate
|
|
||||||
# to quick-xml >= 0.41.0.
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0194
|
|
||||||
# https://rustsec.org/advisories/RUSTSEC-2026-0195
|
|
||||||
{ id = "RUSTSEC-2026-0194", reason = "transitive via inferno/lance/opendal; XML from trusted cloud endpoints, not attacker-controlled" },
|
|
||||||
{ id = "RUSTSEC-2026-0195", reason = "transitive via inferno/lance/opendal; XML from trusted cloud endpoints, not attacker-controlled" },
|
|
||||||
]
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Licenses: only allow licenses we've reviewed as compatible with Apache-2.0.
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
[licenses]
|
|
||||||
version = 2
|
|
||||||
# SPDX identifiers for licenses that are compatible with our Apache-2.0
|
|
||||||
# distribution. Additions require legal review.
|
|
||||||
allow = [
|
|
||||||
"Apache-2.0",
|
|
||||||
"Apache-2.0 WITH LLVM-exception",
|
|
||||||
"MIT",
|
|
||||||
"BSD-2-Clause",
|
|
||||||
"BSD-3-Clause",
|
|
||||||
"ISC",
|
|
||||||
"Unicode-3.0",
|
|
||||||
"Unicode-DFS-2016",
|
|
||||||
"Zlib",
|
|
||||||
"CC0-1.0",
|
|
||||||
"MPL-2.0",
|
|
||||||
"BSL-1.0",
|
|
||||||
"OpenSSL",
|
|
||||||
# 0BSD ("BSD Zero Clause") is effectively public domain — no attribution
|
|
||||||
# required. Pulled in by `mock_instant`.
|
|
||||||
"0BSD",
|
|
||||||
# bzip2-1.0.6 is the permissive upstream bzip2 license (BSD-like). Pulled
|
|
||||||
# in by `libbz2-rs-sys`, the pure-Rust bzip2 implementation.
|
|
||||||
"bzip2-1.0.6",
|
|
||||||
# CDLA-Permissive-2.0 is a permissive data license used by `webpki-roots`
|
|
||||||
# for the Mozilla CA root bundle. Data-only, distribution-compatible.
|
|
||||||
"CDLA-Permissive-2.0",
|
|
||||||
]
|
|
||||||
confidence-threshold = 0.8
|
|
||||||
# Per-crate license exceptions: allow a license for a specific crate only,
|
|
||||||
# rather than globally via the `allow` list above.
|
|
||||||
exceptions = [
|
|
||||||
# CDDL-1.0 (copyleft) is pulled in only as a dev/profiling dependency via
|
|
||||||
# `inferno` -> `pprof` -> `lance-testing`; it is a test dependency that we
|
|
||||||
# do not distribute, so scope the allowance to `inferno` alone.
|
|
||||||
{ allow = ["CDDL-1.0"], crate = "inferno" },
|
|
||||||
]
|
|
||||||
# Crates whose license cannot be determined from Cargo metadata but whose
|
|
||||||
# license we've manually confirmed from upstream. Keep this list minimal.
|
|
||||||
[[licenses.clarify]]
|
|
||||||
# polars-arrow-format omits the `license` field in its Cargo.toml, but the
|
|
||||||
# upstream repo (pola-rs/polars-arrow-format) is dual-licensed Apache-2.0 OR
|
|
||||||
# MIT. See https://github.com/pola-rs/polars-arrow-format/blob/main/LICENSE
|
|
||||||
crate = "polars-arrow-format"
|
|
||||||
expression = "Apache-2.0 OR MIT"
|
|
||||||
license-files = []
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Bans: disallow specific crates and flag dependency hygiene issues.
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
[bans]
|
|
||||||
# Warn (not deny) on duplicate versions of the same crate. In a large
|
|
||||||
# workspace like this one, duplicates are common and often unavoidable
|
|
||||||
# transitively. We surface them to discourage growth, but don't fail CI.
|
|
||||||
multiple-versions = "warn"
|
|
||||||
# Wildcard version requirements (`foo = "*"`) are a footgun — they let any
|
|
||||||
# future release in without review. Ban them outright.
|
|
||||||
wildcards = "deny"
|
|
||||||
# Internal workspace crates reference each other via `path = "..."`, which
|
|
||||||
# cargo-deny sees as a wildcard version. That's fine for private workspace
|
|
||||||
# members (not published to crates.io), so allow it specifically for paths.
|
|
||||||
allow-wildcard-paths = true
|
|
||||||
# Features that, if enabled, should cause the check to fail.
|
|
||||||
deny = []
|
|
||||||
# Crates to skip when checking for duplicate versions.
|
|
||||||
skip = []
|
|
||||||
# Similar to `skip`, but also skips the entire transitive subtree.
|
|
||||||
skip-tree = []
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Sources: restrict where crates can come from.
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
[sources]
|
|
||||||
# Deny any registry other than the ones explicitly listed below.
|
|
||||||
unknown-registry = "deny"
|
|
||||||
# Deny any git dependency whose host isn't in the allow-list below. This
|
|
||||||
# prevents accidental pulls from arbitrary forks.
|
|
||||||
unknown-git = "deny"
|
|
||||||
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
|
|
||||||
# Lance is developed in a sibling repo and pulled as a git dependency until
|
|
||||||
# releases are cut to crates.io. Allow that specific host.
|
|
||||||
allow-git = [
|
|
||||||
"https://github.com/lance-format/lance",
|
|
||||||
]
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
services:
|
services:
|
||||||
localstack:
|
localstack:
|
||||||
image: localstack/localstack:4.0
|
image: localstack/localstack:3.3
|
||||||
ports:
|
ports:
|
||||||
- 4566:4566
|
- 4566:4566
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
+17
-17
@@ -1,27 +1,27 @@
|
|||||||
# Simple base dockerfile that supports basic dependencies required to run lance with FTS and Hybrid Search
|
#Simple base dockerfile that supports basic dependencies required to run lance with FTS and Hybrid Search
|
||||||
# Usage: docker build -t lancedb:latest -f Dockerfile .
|
#Usage docker build -t lancedb:latest -f Dockerfile .
|
||||||
FROM python:3.12-slim-bookworm
|
FROM python:3.10-slim-buster
|
||||||
|
|
||||||
# Install build dependencies in a single layer
|
# Install Rust
|
||||||
RUN apt-get update && \
|
RUN apt-get update && apt-get install -y curl build-essential && \
|
||||||
apt-get install -y --no-install-recommends \
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
curl \
|
|
||||||
build-essential \
|
|
||||||
protobuf-compiler \
|
|
||||||
git \
|
|
||||||
ca-certificates && \
|
|
||||||
apt-get clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install Rust (pinned installer, non-interactive)
|
|
||||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
|
||||||
|
|
||||||
# Set the environment variable for Rust
|
# Set the environment variable for Rust
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
# Install protobuf compiler
|
||||||
|
RUN apt-get install -y protobuf-compiler && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-get -y update &&\
|
||||||
|
apt-get -y upgrade && \
|
||||||
|
apt-get -y install git
|
||||||
|
|
||||||
|
|
||||||
# Verify installations
|
# Verify installations
|
||||||
RUN python --version && \
|
RUN python --version && \
|
||||||
rustc --version && \
|
rustc --version && \
|
||||||
protoc --version
|
protoc --version
|
||||||
|
|
||||||
RUN pip install --no-cache-dir lancedb
|
RUN pip install tantivy lancedb
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# LanceDB Documentation
|
# LanceDB Documentation
|
||||||
|
|
||||||
LanceDB docs are available at [docs.lancedb.com](https://docs.lancedb.com).
|
LanceDB docs are available at [lancedb.com/docs](https://lancedb.com/docs).
|
||||||
|
|
||||||
The SDK docs are built and deployed automatically by [Github Actions](../.github/workflows/docs.yml)
|
The SDK docs are built and deployed automatically by [Github Actions](../.github/workflows/docs.yml)
|
||||||
whenever a commit is pushed to the `main` branch. So it is possible for the docs to show
|
whenever a commit is pushed to the `main` branch. So it is possible for the docs to show
|
||||||
|
|||||||
+3
-15
@@ -51,27 +51,15 @@ plugins:
|
|||||||
paths: [../python/python]
|
paths: [../python/python]
|
||||||
options:
|
options:
|
||||||
docstring_style: numpy
|
docstring_style: numpy
|
||||||
docstring_options:
|
|
||||||
# Attributes documented in a `Parameters` section, and pydantic
|
|
||||||
# dataclasses whose `__init__` griffe cannot see statically, both
|
|
||||||
# trip this check. It reports nothing actionable here.
|
|
||||||
warn_unknown_params: false
|
|
||||||
heading_level: 3
|
heading_level: 3
|
||||||
|
show_source: true
|
||||||
|
show_symbol_type_in_heading: true
|
||||||
show_signature_annotations: true
|
show_signature_annotations: true
|
||||||
show_root_heading: true
|
show_root_heading: true
|
||||||
show_docstring_examples: true
|
|
||||||
show_docstring_attributes: false
|
|
||||||
show_docstring_other_parameters: true
|
|
||||||
show_symbol_type_heading: true
|
|
||||||
show_labels: false
|
|
||||||
show_if_no_docstring: true
|
|
||||||
show_source: false
|
|
||||||
members_order: source
|
members_order: source
|
||||||
docstring_section_style: list
|
docstring_section_style: list
|
||||||
signature_crossrefs: true
|
signature_crossrefs: true
|
||||||
separate_signature: true
|
separate_signature: true
|
||||||
filters:
|
|
||||||
- "!^_"
|
|
||||||
import:
|
import:
|
||||||
# for cross references
|
# for cross references
|
||||||
- https://arrow.apache.org/docs/objects.inv
|
- https://arrow.apache.org/docs/objects.inv
|
||||||
@@ -125,7 +113,7 @@ markdown_extensions:
|
|||||||
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
||||||
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
||||||
- markdown.extensions.toc:
|
- markdown.extensions.toc:
|
||||||
toc_depth: 4
|
toc_depth: 3
|
||||||
permalink: true
|
permalink: true
|
||||||
permalink_title: Anchor link to this section
|
permalink_title: Anchor link to this section
|
||||||
|
|
||||||
|
|||||||
+1
-11
@@ -453,16 +453,6 @@ paths:
|
|||||||
The metric type to use for the index. l2, Cosine, Dot are supported.
|
The metric type to use for the index. l2, Cosine, Dot are supported.
|
||||||
index_type:
|
index_type:
|
||||||
type: string
|
type: string
|
||||||
custom_stop_words:
|
|
||||||
type: [array, "null"]
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
description: |
|
|
||||||
The custom stop-word list for an FTS index. A non-null
|
|
||||||
array replaces the language's built-in stop-word list and is only
|
|
||||||
applied when remove_stop_words is enabled. Null uses the built-in
|
|
||||||
language list, while an empty array explicitly replaces it with no
|
|
||||||
stop words.
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Index successfully created
|
description: Index successfully created
|
||||||
@@ -520,4 +510,4 @@ paths:
|
|||||||
"401":
|
"401":
|
||||||
$ref: "#/components/responses/unauthorized"
|
$ref: "#/components/responses/unauthorized"
|
||||||
"404":
|
"404":
|
||||||
$ref: "#/components/responses/not_found"
|
$ref: "#/components/responses/not_found"
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
mkdocs==1.6.1
|
mkdocs==1.5.3
|
||||||
mkdocs-jupyter==0.24.1
|
mkdocs-jupyter==0.24.1
|
||||||
mkdocs-material==9.6.23
|
mkdocs-material==9.5.3
|
||||||
mkdocs-autorefs>=0.5,<=1.0
|
mkdocs-autorefs<=1.0
|
||||||
mkdocstrings[python]>=0.24,<1.0
|
mkdocstrings[python]==0.25.2
|
||||||
griffe>=0.40,<1.0
|
griffe
|
||||||
mkdocs-render-swagger-plugin>=0.1.0
|
mkdocs-render-swagger-plugin
|
||||||
pydantic>=2.0,<3.0
|
pydantic
|
||||||
mkdocs-redirects>=1.2.0
|
mkdocs-redirects
|
||||||
+44
-179
@@ -14,7 +14,7 @@ Add the following dependency to your `pom.xml`:
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lancedb</groupId>
|
<groupId>com.lancedb</groupId>
|
||||||
<artifactId>lancedb-core</artifactId>
|
<artifactId>lancedb-core</artifactId>
|
||||||
<version>0.37.1-beta.0</version>
|
<version>0.27.0-beta.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -57,32 +57,32 @@ LanceNamespace namespaceClient = LanceDbNamespaceClientBuilder.newBuilder()
|
|||||||
|
|
||||||
## Metadata Operations
|
## Metadata Operations
|
||||||
|
|
||||||
### Creating a Namespace Path
|
### Creating a Namespace
|
||||||
|
|
||||||
Namespace paths organize tables hierarchically. Create the desired namespace path before creating tables within it:
|
Namespaces organize tables hierarchically. Create a namespace before creating tables within it:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.lance.namespace.model.CreateNamespaceRequest;
|
import org.lance.namespace.model.CreateNamespaceRequest;
|
||||||
import org.lance.namespace.model.CreateNamespaceResponse;
|
import org.lance.namespace.model.CreateNamespaceResponse;
|
||||||
|
|
||||||
// Create a child namespace path
|
// Create a child namespace
|
||||||
CreateNamespaceRequest request = new CreateNamespaceRequest();
|
CreateNamespaceRequest request = new CreateNamespaceRequest();
|
||||||
request.setId(Arrays.asList("my_namespace"));
|
request.setId(Arrays.asList("my_namespace"));
|
||||||
|
|
||||||
CreateNamespaceResponse response = namespaceClient.createNamespace(request);
|
CreateNamespaceResponse response = namespaceClient.createNamespace(request);
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also create nested namespace paths:
|
You can also create nested namespaces:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
// Create a nested namespace path: parent/child
|
// Create a nested namespace: parent/child
|
||||||
CreateNamespaceRequest request = new CreateNamespaceRequest();
|
CreateNamespaceRequest request = new CreateNamespaceRequest();
|
||||||
request.setId(Arrays.asList("parent_namespace", "child_namespace"));
|
request.setId(Arrays.asList("parent_namespace", "child_namespace"));
|
||||||
|
|
||||||
CreateNamespaceResponse response = namespaceClient.createNamespace(request);
|
CreateNamespaceResponse response = namespaceClient.createNamespace(request);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Describing a Namespace Path
|
### Describing a Namespace
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.lance.namespace.model.DescribeNamespaceRequest;
|
import org.lance.namespace.model.DescribeNamespaceRequest;
|
||||||
@@ -95,22 +95,22 @@ DescribeNamespaceResponse response = namespaceClient.describeNamespace(request);
|
|||||||
System.out.println("Namespace properties: " + response.getProperties());
|
System.out.println("Namespace properties: " + response.getProperties());
|
||||||
```
|
```
|
||||||
|
|
||||||
### Listing Namespace Paths
|
### Listing Namespaces
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.lance.namespace.model.ListNamespacesRequest;
|
import org.lance.namespace.model.ListNamespacesRequest;
|
||||||
import org.lance.namespace.model.ListNamespacesResponse;
|
import org.lance.namespace.model.ListNamespacesResponse;
|
||||||
|
|
||||||
// List all namespace paths at the root level
|
// List all namespaces at root level
|
||||||
ListNamespacesRequest request = new ListNamespacesRequest();
|
ListNamespacesRequest request = new ListNamespacesRequest();
|
||||||
request.setId(Arrays.asList()); // Empty for root
|
request.setId(Arrays.asList()); // Empty for root
|
||||||
|
|
||||||
ListNamespacesResponse response = namespaceClient.listNamespaces(request);
|
ListNamespacesResponse response = namespaceClient.listNamespaces(request);
|
||||||
for (String ns : response.getNamespaces()) {
|
for (String ns : response.getNamespaces()) {
|
||||||
System.out.println("Namespace path: " + ns);
|
System.out.println("Namespace: " + ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
// List child namespace paths under a parent path
|
// List child namespaces under a parent
|
||||||
ListNamespacesRequest childRequest = new ListNamespacesRequest();
|
ListNamespacesRequest childRequest = new ListNamespacesRequest();
|
||||||
childRequest.setId(Arrays.asList("parent_namespace"));
|
childRequest.setId(Arrays.asList("parent_namespace"));
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ ListNamespacesResponse childResponse = namespaceClient.listNamespaces(childReque
|
|||||||
import org.lance.namespace.model.ListTablesRequest;
|
import org.lance.namespace.model.ListTablesRequest;
|
||||||
import org.lance.namespace.model.ListTablesResponse;
|
import org.lance.namespace.model.ListTablesResponse;
|
||||||
|
|
||||||
// List tables in a namespace path
|
// List tables in a namespace
|
||||||
ListTablesRequest request = new ListTablesRequest();
|
ListTablesRequest request = new ListTablesRequest();
|
||||||
request.setId(Arrays.asList("my_namespace"));
|
request.setId(Arrays.asList("my_namespace"));
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ for (String table : response.getTables()) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dropping a Namespace Path
|
### Dropping a Namespace
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.lance.namespace.model.DropNamespaceRequest;
|
import org.lance.namespace.model.DropNamespaceRequest;
|
||||||
@@ -175,7 +175,7 @@ DropTableResponse response = namespaceClient.dropTable(request);
|
|||||||
|
|
||||||
### Creating a Table
|
### Creating a Table
|
||||||
|
|
||||||
Tables are created within a namespace path by providing data in Apache Arrow IPC format:
|
Tables are created within a namespace by providing data in Apache Arrow IPC format:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.lance.namespace.LanceNamespace;
|
import org.lance.namespace.LanceNamespace;
|
||||||
@@ -242,64 +242,13 @@ try (BufferAllocator allocator = new RootAllocator();
|
|||||||
}
|
}
|
||||||
byte[] tableData = out.toByteArray();
|
byte[] tableData = out.toByteArray();
|
||||||
|
|
||||||
// Create a table in a namespace path
|
// Create table in a namespace
|
||||||
CreateTableRequest request = new CreateTableRequest();
|
CreateTableRequest request = new CreateTableRequest();
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
request.setId(Arrays.asList("my_namespace", "my_table"));
|
||||||
CreateTableResponse response = namespaceClient.createTable(request, tableData);
|
CreateTableResponse response = namespaceClient.createTable(request, tableData);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Creating an Empty Table
|
|
||||||
|
|
||||||
To create an empty table, send an Arrow IPC stream that contains the table schema and no record batches.
|
|
||||||
The schema in the IPC stream becomes the table schema, and rows can be inserted later.
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableResponse;
|
|
||||||
import org.apache.arrow.memory.BufferAllocator;
|
|
||||||
import org.apache.arrow.memory.RootAllocator;
|
|
||||||
import org.apache.arrow.vector.VectorSchemaRoot;
|
|
||||||
import org.apache.arrow.vector.ipc.ArrowStreamWriter;
|
|
||||||
import org.apache.arrow.vector.types.FloatingPointPrecision;
|
|
||||||
import org.apache.arrow.vector.types.pojo.ArrowType;
|
|
||||||
import org.apache.arrow.vector.types.pojo.Field;
|
|
||||||
import org.apache.arrow.vector.types.pojo.FieldType;
|
|
||||||
import org.apache.arrow.vector.types.pojo.Schema;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.nio.channels.Channels;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
Schema schema = new Schema(Arrays.asList(
|
|
||||||
new Field("id", FieldType.nullable(new ArrowType.Int(32, true)), null),
|
|
||||||
new Field("name", FieldType.nullable(new ArrowType.Utf8()), null),
|
|
||||||
new Field("embedding",
|
|
||||||
FieldType.nullable(new ArrowType.FixedSizeList(128)),
|
|
||||||
Arrays.asList(new Field("item",
|
|
||||||
FieldType.nullable(new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)),
|
|
||||||
null)))
|
|
||||||
));
|
|
||||||
|
|
||||||
byte[] emptyTableData;
|
|
||||||
try (BufferAllocator allocator = new RootAllocator();
|
|
||||||
VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator)) {
|
|
||||||
root.setRowCount(0);
|
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
try (ArrowStreamWriter writer = new ArrowStreamWriter(root, null, Channels.newChannel(out))) {
|
|
||||||
writer.start();
|
|
||||||
writer.end();
|
|
||||||
}
|
|
||||||
emptyTableData = out.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateTableRequest request = new CreateTableRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "empty_table"));
|
|
||||||
|
|
||||||
CreateTableResponse response = namespaceClient.createTable(request, emptyTableData);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Insert
|
### Insert
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@@ -482,88 +431,9 @@ query.setVector(vector);
|
|||||||
byte[] result = namespaceClient.queryTable(query);
|
byte[] result = namespaceClient.queryTable(query);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Indexing
|
### Reading Query Results
|
||||||
|
|
||||||
The Java SDK exposes the REST namespace index operations through the same `LanceNamespace` client.
|
Query results are returned in Apache Arrow IPC file format. Here's how to read them:
|
||||||
Index creation runs asynchronously, so use `listTableIndices` or `describeTableIndexStats` to check progress.
|
|
||||||
|
|
||||||
### Creating a Vector Index
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableIndexRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableIndexResponse;
|
|
||||||
|
|
||||||
CreateTableIndexRequest request = new CreateTableIndexRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
request.setColumn("embedding");
|
|
||||||
request.setIndexType("IVF_PQ");
|
|
||||||
request.setDistanceType("cosine");
|
|
||||||
request.setName("embedding_idx");
|
|
||||||
|
|
||||||
CreateTableIndexResponse response = namespaceClient.createTableIndex(request);
|
|
||||||
System.out.println("Index transaction: " + response.getTransactionId());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Creating a Scalar Index
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableIndexRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableScalarIndexResponse;
|
|
||||||
|
|
||||||
CreateTableIndexRequest request = new CreateTableIndexRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
request.setColumn("category");
|
|
||||||
request.setIndexType("BTREE");
|
|
||||||
request.setName("category_idx");
|
|
||||||
|
|
||||||
CreateTableScalarIndexResponse response = namespaceClient.createTableScalarIndex(request);
|
|
||||||
System.out.println("Index transaction: " + response.getTransactionId());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Creating a Full Text Search Index
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.CreateTableIndexRequest;
|
|
||||||
import org.lance.namespace.model.CreateTableScalarIndexResponse;
|
|
||||||
|
|
||||||
CreateTableIndexRequest request = new CreateTableIndexRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
request.setColumn("text_column");
|
|
||||||
request.setIndexType("FTS");
|
|
||||||
request.setName("text_idx");
|
|
||||||
request.setBaseTokenizer("simple");
|
|
||||||
request.setLowerCase(true);
|
|
||||||
request.setWithPosition(true);
|
|
||||||
|
|
||||||
CreateTableScalarIndexResponse response = namespaceClient.createTableScalarIndex(request);
|
|
||||||
System.out.println("Index transaction: " + response.getTransactionId());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Listing Indexes
|
|
||||||
|
|
||||||
```java
|
|
||||||
import org.lance.namespace.model.IndexContent;
|
|
||||||
import org.lance.namespace.model.ListTableIndicesRequest;
|
|
||||||
import org.lance.namespace.model.ListTableIndicesResponse;
|
|
||||||
|
|
||||||
ListTableIndicesRequest request = new ListTableIndicesRequest();
|
|
||||||
request.setId(Arrays.asList("my_namespace", "my_table"));
|
|
||||||
|
|
||||||
ListTableIndicesResponse response = namespaceClient.listTableIndices(request);
|
|
||||||
for (IndexContent index : response.getIndexes()) {
|
|
||||||
System.out.println(index.getIndexName() + ": " + index.getStatus());
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! note
|
|
||||||
The current Java namespace API exposes index type, index name, distance type, and full text search tokenizer options.
|
|
||||||
IVF training parameters such as `num_partitions` are not exposed by `CreateTableIndexRequest` yet.
|
|
||||||
To make those configurable from Java, the namespace API must add those fields first.
|
|
||||||
|
|
||||||
## Reading Query Results
|
|
||||||
|
|
||||||
Query results are returned as bytes in Apache Arrow IPC file format. Put the byte-channel
|
|
||||||
adapter behind a small helper so query code can work with `ArrowFileReader` directly:
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import org.apache.arrow.vector.ipc.ArrowFileReader;
|
import org.apache.arrow.vector.ipc.ArrowFileReader;
|
||||||
@@ -571,50 +441,45 @@ import org.apache.arrow.vector.VectorSchemaRoot;
|
|||||||
import org.apache.arrow.memory.BufferAllocator;
|
import org.apache.arrow.memory.BufferAllocator;
|
||||||
import org.apache.arrow.memory.RootAllocator;
|
import org.apache.arrow.memory.RootAllocator;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.SeekableByteChannel;
|
import java.nio.channels.SeekableByteChannel;
|
||||||
|
|
||||||
final class ArrowIpc {
|
// Helper class to read Arrow data from byte array
|
||||||
static ArrowFileReader openFileReader(byte[] data, BufferAllocator allocator) throws IOException {
|
class ByteArraySeekableByteChannel implements SeekableByteChannel {
|
||||||
return new ArrowFileReader(new ByteArraySeekableByteChannel(data), allocator);
|
private final byte[] data;
|
||||||
|
private long position = 0;
|
||||||
|
private boolean isOpen = true;
|
||||||
|
|
||||||
|
public ByteArraySeekableByteChannel(byte[] data) {
|
||||||
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class ByteArraySeekableByteChannel implements SeekableByteChannel {
|
@Override
|
||||||
private final byte[] data;
|
public int read(ByteBuffer dst) {
|
||||||
private long position = 0;
|
int remaining = dst.remaining();
|
||||||
private boolean isOpen = true;
|
int available = (int) (data.length - position);
|
||||||
|
if (available <= 0) return -1;
|
||||||
private ByteArraySeekableByteChannel(byte[] data) {
|
int toRead = Math.min(remaining, available);
|
||||||
this.data = data;
|
dst.put(data, (int) position, toRead);
|
||||||
}
|
position += toRead;
|
||||||
|
return toRead;
|
||||||
@Override
|
|
||||||
public int read(ByteBuffer dst) {
|
|
||||||
int remaining = dst.remaining();
|
|
||||||
int available = (int) (data.length - position);
|
|
||||||
if (available <= 0) return -1;
|
|
||||||
int toRead = Math.min(remaining, available);
|
|
||||||
dst.put(data, (int) position, toRead);
|
|
||||||
position += toRead;
|
|
||||||
return toRead;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public long position() { return position; }
|
|
||||||
@Override public SeekableByteChannel position(long newPosition) { position = newPosition; return this; }
|
|
||||||
@Override public long size() { return data.length; }
|
|
||||||
@Override public boolean isOpen() { return isOpen; }
|
|
||||||
@Override public void close() { isOpen = false; }
|
|
||||||
@Override public int write(ByteBuffer src) { throw new UnsupportedOperationException(); }
|
|
||||||
@Override public SeekableByteChannel truncate(long size) { throw new UnsupportedOperationException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public long position() { return position; }
|
||||||
|
@Override public SeekableByteChannel position(long newPosition) { position = newPosition; return this; }
|
||||||
|
@Override public long size() { return data.length; }
|
||||||
|
@Override public boolean isOpen() { return isOpen; }
|
||||||
|
@Override public void close() { isOpen = false; }
|
||||||
|
@Override public int write(ByteBuffer src) { throw new UnsupportedOperationException(); }
|
||||||
|
@Override public SeekableByteChannel truncate(long size) { throw new UnsupportedOperationException(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read query results
|
// Read query results
|
||||||
byte[] queryResult = namespaceClient.queryTable(query);
|
byte[] queryResult = namespaceClient.queryTable(query);
|
||||||
|
|
||||||
try (BufferAllocator allocator = new RootAllocator();
|
try (BufferAllocator allocator = new RootAllocator();
|
||||||
ArrowFileReader reader = ArrowIpc.openFileReader(queryResult, allocator)) {
|
ArrowFileReader reader = new ArrowFileReader(
|
||||||
|
new ByteArraySeekableByteChannel(queryResult), allocator)) {
|
||||||
|
|
||||||
for (int i = 0; i < reader.getRecordBlocks().size(); i++) {
|
for (int i = 0; i < reader.getRecordBlocks().size(); i++) {
|
||||||
reader.loadRecordBatch(reader.getRecordBlocks().get(i));
|
reader.loadRecordBatch(reader.getRecordBlocks().get(i));
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const results = await table.vectorSearch([0.1, 0.3]).limit(20).toArray();
|
|||||||
console.log(results);
|
console.log(results);
|
||||||
```
|
```
|
||||||
|
|
||||||
The [quickstart](https://docs.lancedb.com/quickstart/) contains more complete examples.
|
The [quickstart](https://lancedb.com/docs/quickstart/basic-usage/) contains more complete examples.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Contributing to LanceDB Typescript
|
# Contributing to LanceDB Typescript
|
||||||
|
|
||||||
This document outlines the process for contributing to LanceDB Typescript.
|
This document outlines the process for contributing to LanceDB Typescript.
|
||||||
For general contribution guidelines, see [CONTRIBUTING.md](https://github.com/lancedb/lancedb/blob/main/CONTRIBUTING.md).
|
For general contribution guidelines, see [CONTRIBUTING.md](../CONTRIBUTING.md).
|
||||||
|
|
||||||
## Project layout
|
## Project layout
|
||||||
|
|
||||||
@@ -12,22 +12,20 @@ Typescript.
|
|||||||
* `src/`: Rust bindings source code
|
* `src/`: Rust bindings source code
|
||||||
* `lancedb/`: Typescript package source code
|
* `lancedb/`: Typescript package source code
|
||||||
* `__test__/`: Unit tests
|
* `__test__/`: Unit tests
|
||||||
* `examples/`: A pnpm package with the examples shown in the documentation
|
* `examples/`: An npm package with the examples shown in the documentation
|
||||||
|
|
||||||
## Development environment
|
## Development environment
|
||||||
|
|
||||||
To set up your development environment, you will need to install the following:
|
To set up your development environment, you will need to install the following:
|
||||||
|
|
||||||
1. Node.js 22 or later (required by pnpm 11)
|
1. Node.js 14 or later
|
||||||
2. [pnpm](https://pnpm.io/installation) 11 or later (or run via `corepack enable`,
|
2. Rust's package manager, Cargo. Use [rustup](https://rustup.rs/) to install.
|
||||||
which uses the `packageManager` field in `package.json`)
|
3. [protoc](https://grpc.io/docs/protoc-installation/) (Protocol Buffers compiler)
|
||||||
3. Rust's package manager, Cargo. Use [rustup](https://rustup.rs/) to install.
|
|
||||||
4. [protoc](https://grpc.io/docs/protoc-installation/) (Protocol Buffers compiler)
|
|
||||||
|
|
||||||
Initial setup:
|
Initial setup:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Commit Hooks
|
### Commit Hooks
|
||||||
@@ -41,38 +39,38 @@ pre-commit install
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Most common development commands can be run using the pnpm scripts.
|
Most common development commands can be run using the npm scripts.
|
||||||
|
|
||||||
Build the package
|
Build the package
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install
|
npm install
|
||||||
pnpm build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Lint:
|
Lint:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm lint
|
npm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
Format and fix lints:
|
Format and fix lints:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm lint-fix
|
npm run lint-fix
|
||||||
```
|
```
|
||||||
|
|
||||||
Run tests:
|
Run tests:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm test
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
To run a single test:
|
To run a single test:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Single file: table.test.ts
|
# Single file: table.test.ts
|
||||||
pnpm test -- table.test.ts
|
npm test -- table.test.ts
|
||||||
# Single test: 'merge insert' in table.test.ts
|
# Single test: 'merge insert' in table.test.ts
|
||||||
pnpm test -- table.test.ts --testNamePattern=merge\ insert
|
npm test -- table.test.ts --testNamePattern=merge\ insert
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchContents
|
|
||||||
|
|
||||||
# Class: BranchContents
|
|
||||||
|
|
||||||
## Constructors
|
|
||||||
|
|
||||||
### new BranchContents()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
new BranchContents(): BranchContents
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`BranchContents`](BranchContents.md)
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### manifestSize
|
|
||||||
|
|
||||||
```ts
|
|
||||||
manifestSize: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### parentBranch?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional parentBranch: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### parentVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
parentVersion: number;
|
|
||||||
```
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / Branches
|
|
||||||
|
|
||||||
# Class: Branches
|
|
||||||
|
|
||||||
Branch manager for a [Table](Table.md).
|
|
||||||
|
|
||||||
Unlike tags, `create` and `checkout` return a new [Table](Table.md) handle scoped
|
|
||||||
to the branch; writes on it do not affect `main`.
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### checkout()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
checkout(name, version?): Promise<Table>
|
|
||||||
```
|
|
||||||
|
|
||||||
Check out an existing branch and return a handle scoped to it.
|
|
||||||
|
|
||||||
With `version` set, the returned handle is pinned to that version of the
|
|
||||||
branch (a read-only, detached view); otherwise it tracks the branch's
|
|
||||||
latest and stays writable.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
* **version?**: `number`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Table`](Table.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### create()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
create(
|
|
||||||
name,
|
|
||||||
fromRef?,
|
|
||||||
fromVersion?): Promise<Table>
|
|
||||||
```
|
|
||||||
|
|
||||||
Create a branch and return a handle scoped to it.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
Name of the new branch.
|
|
||||||
|
|
||||||
* **fromRef?**: `string`
|
|
||||||
Source branch to fork from. Defaults to `main`.
|
|
||||||
|
|
||||||
* **fromVersion?**: `number`
|
|
||||||
A specific version on `fromRef`. Defaults to latest.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Table`](Table.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### delete()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
delete(name): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Delete a branch.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **name**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### diff()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
diff(fromBranch): Promise<BranchDiff>
|
|
||||||
```
|
|
||||||
|
|
||||||
Compare a branch against main without modifying either branch.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **fromBranch**: `string`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`BranchDiff`](../interfaces/BranchDiff.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### list()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
list(): Promise<Record<string, BranchContents>>
|
|
||||||
```
|
|
||||||
|
|
||||||
List all branches, mapping name to branch metadata.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`Record`<`string`, [`BranchContents`](BranchContents.md)>>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### merge()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
merge(fromBranch, dryRun): Promise<MergeBranchResult>
|
|
||||||
```
|
|
||||||
|
|
||||||
Merge a branch into main.
|
|
||||||
|
|
||||||
Set `dryRun` to `true` to preview the merge. A rejected merge resolves
|
|
||||||
with `status: "rejected"` instead of throwing.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **fromBranch**: `string`
|
|
||||||
Branch to merge from.
|
|
||||||
|
|
||||||
* **dryRun**: `boolean` = `false`
|
|
||||||
When true, only preview the merge. Defaults to false.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`MergeBranchResult`](../interfaces/MergeBranchResult.md)>
|
|
||||||
@@ -61,8 +61,8 @@ sharing the same data, deletion, and index files.
|
|||||||
* **options.sourceVersion?**: `number`
|
* **options.sourceVersion?**: `number`
|
||||||
The version of the source table to clone.
|
The version of the source table to clone.
|
||||||
|
|
||||||
* **options.targetNamespacePath?**: `string`[]
|
* **options.targetNamespace?**: `string`[]
|
||||||
The namespace path for the target table (defaults to root namespace).
|
The namespace for the target table (defaults to root namespace).
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -116,13 +116,13 @@ Creates a new empty Table
|
|||||||
|
|
||||||
`Promise`<[`Table`](Table.md)>
|
`Promise`<[`Table`](Table.md)>
|
||||||
|
|
||||||
#### createEmptyTable(name, schema, namespacePath, options)
|
#### createEmptyTable(name, schema, namespace, options)
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract createEmptyTable(
|
abstract createEmptyTable(
|
||||||
name,
|
name,
|
||||||
schema,
|
schema,
|
||||||
namespacePath?,
|
namespace?,
|
||||||
options?): Promise<Table>
|
options?): Promise<Table>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -136,8 +136,8 @@ Creates a new empty Table
|
|||||||
* **schema**: [`SchemaLike`](../type-aliases/SchemaLike.md)
|
* **schema**: [`SchemaLike`](../type-aliases/SchemaLike.md)
|
||||||
The schema of the table
|
The schema of the table
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path to create the table in (defaults to root namespace)
|
The namespace to create the table in (defaults to root namespace)
|
||||||
|
|
||||||
* **options?**: `Partial`<[`CreateTableOptions`](../interfaces/CreateTableOptions.md)>
|
* **options?**: `Partial`<[`CreateTableOptions`](../interfaces/CreateTableOptions.md)>
|
||||||
Additional options
|
Additional options
|
||||||
@@ -148,39 +148,12 @@ Creates a new empty Table
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### createNamespace()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract createNamespace(namespacePath, options?): Promise<CreateNamespaceResponse>
|
|
||||||
```
|
|
||||||
|
|
||||||
Create a new namespace at the given path.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **namespacePath**: `string`[]
|
|
||||||
The namespace path to create.
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`CreateNamespaceOptions`](../interfaces/CreateNamespaceOptions.md)>
|
|
||||||
Creation `mode`
|
|
||||||
("create" | "exist_ok" | "overwrite") and optional `properties`
|
|
||||||
to attach to the namespace.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`CreateNamespaceResponse`](../interfaces/CreateNamespaceResponse.md)>
|
|
||||||
|
|
||||||
The properties of the
|
|
||||||
created namespace and an optional transaction id.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### createTable()
|
### createTable()
|
||||||
|
|
||||||
#### createTable(options, namespacePath)
|
#### createTable(options, namespace)
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract createTable(options, namespacePath?): Promise<Table>
|
abstract createTable(options, namespace?): Promise<Table>
|
||||||
```
|
```
|
||||||
|
|
||||||
Creates a new Table and initialize it with new data.
|
Creates a new Table and initialize it with new data.
|
||||||
@@ -190,8 +163,8 @@ Creates a new Table and initialize it with new data.
|
|||||||
* **options**: `object` & `Partial`<[`CreateTableOptions`](../interfaces/CreateTableOptions.md)>
|
* **options**: `object` & `Partial`<[`CreateTableOptions`](../interfaces/CreateTableOptions.md)>
|
||||||
The options object.
|
The options object.
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path to create the table in (defaults to root namespace)
|
The namespace to create the table in (defaults to root namespace)
|
||||||
|
|
||||||
##### Returns
|
##### Returns
|
||||||
|
|
||||||
@@ -224,13 +197,13 @@ Creates a new Table and initialize it with new data.
|
|||||||
|
|
||||||
`Promise`<[`Table`](Table.md)>
|
`Promise`<[`Table`](Table.md)>
|
||||||
|
|
||||||
#### createTable(name, data, namespacePath, options)
|
#### createTable(name, data, namespace, options)
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract createTable(
|
abstract createTable(
|
||||||
name,
|
name,
|
||||||
data,
|
data,
|
||||||
namespacePath?,
|
namespace?,
|
||||||
options?): Promise<Table>
|
options?): Promise<Table>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -245,8 +218,8 @@ Creates a new Table and initialize it with new data.
|
|||||||
Non-empty Array of Records
|
Non-empty Array of Records
|
||||||
to be inserted into the table
|
to be inserted into the table
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path to create the table in (defaults to root namespace)
|
The namespace to create the table in (defaults to root namespace)
|
||||||
|
|
||||||
* **options?**: `Partial`<[`CreateTableOptions`](../interfaces/CreateTableOptions.md)>
|
* **options?**: `Partial`<[`CreateTableOptions`](../interfaces/CreateTableOptions.md)>
|
||||||
Additional options
|
Additional options
|
||||||
@@ -257,29 +230,6 @@ Creates a new Table and initialize it with new data.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### describeNamespace()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract describeNamespace(namespacePath): Promise<DescribeNamespaceResponse>
|
|
||||||
```
|
|
||||||
|
|
||||||
Describe a namespace, returning its properties.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **namespacePath**: `string`[]
|
|
||||||
The namespace path to describe, in
|
|
||||||
parent → child order, e.g. `["analytics", "sales"]`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`DescribeNamespaceResponse`](../interfaces/DescribeNamespaceResponse.md)>
|
|
||||||
|
|
||||||
The namespace's properties
|
|
||||||
(may be undefined if the namespace has none).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### display()
|
### display()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -297,15 +247,15 @@ Return a brief description of the connection
|
|||||||
### dropAllTables()
|
### dropAllTables()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract dropAllTables(namespacePath?): Promise<void>
|
abstract dropAllTables(namespace?): Promise<void>
|
||||||
```
|
```
|
||||||
|
|
||||||
Drop all tables in the database.
|
Drop all tables in the database.
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path to drop tables from (defaults to root namespace).
|
The namespace to drop tables from (defaults to root namespace).
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -313,40 +263,10 @@ Drop all tables in the database.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### dropNamespace()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract dropNamespace(namespacePath, options?): Promise<DropNamespaceResponse>
|
|
||||||
```
|
|
||||||
|
|
||||||
Drop a namespace.
|
|
||||||
|
|
||||||
Use `behavior: "cascade"` to also drop everything contained in the
|
|
||||||
namespace (sub-namespaces and tables). The default `"restrict"`
|
|
||||||
behavior refuses to drop a non-empty namespace.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **namespacePath**: `string`[]
|
|
||||||
The namespace path to drop.
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`DropNamespaceOptions`](../interfaces/DropNamespaceOptions.md)>
|
|
||||||
`mode` ("skip" | "fail"
|
|
||||||
for missing-namespace handling) and `behavior` ("restrict" | "cascade").
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`DropNamespaceResponse`](../interfaces/DropNamespaceResponse.md)>
|
|
||||||
|
|
||||||
Any properties returned by
|
|
||||||
the server and an optional transaction id.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### dropTable()
|
### dropTable()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract dropTable(name, namespacePath?): Promise<void>
|
abstract dropTable(name, namespace?): Promise<void>
|
||||||
```
|
```
|
||||||
|
|
||||||
Drop an existing table.
|
Drop an existing table.
|
||||||
@@ -356,8 +276,8 @@ Drop an existing table.
|
|||||||
* **name**: `string`
|
* **name**: `string`
|
||||||
The name of the table to drop.
|
The name of the table to drop.
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path of the table (defaults to root namespace).
|
The namespace of the table (defaults to root namespace).
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -379,42 +299,12 @@ Return true if the connection has not been closed
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### listNamespaces()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract listNamespaces(namespacePath?, options?): Promise<ListNamespacesResponse>
|
|
||||||
```
|
|
||||||
|
|
||||||
List the immediate child namespaces under the given parent.
|
|
||||||
|
|
||||||
Results may be paginated. To retrieve subsequent pages, pass the
|
|
||||||
`pageToken` returned by a previous call.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
|
||||||
The parent namespace path. Defaults
|
|
||||||
to the root namespace if omitted.
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`ListNamespacesOptions`](../interfaces/ListNamespacesOptions.md)>
|
|
||||||
Pagination options
|
|
||||||
(`pageToken`, `limit`).
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`ListNamespacesResponse`](../interfaces/ListNamespacesResponse.md)>
|
|
||||||
|
|
||||||
Child namespace names and
|
|
||||||
an optional token for fetching the next page.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### openTable()
|
### openTable()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract openTable(
|
abstract openTable(
|
||||||
name,
|
name,
|
||||||
namespacePath?,
|
namespace?,
|
||||||
options?): Promise<Table>
|
options?): Promise<Table>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -425,8 +315,8 @@ Open a table in the database.
|
|||||||
* **name**: `string`
|
* **name**: `string`
|
||||||
The name of the table
|
The name of the table
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path of the table (defaults to root namespace)
|
The namespace of the table (defaults to root namespace)
|
||||||
|
|
||||||
* **options?**: `Partial`<[`OpenTableOptions`](../interfaces/OpenTableOptions.md)>
|
* **options?**: `Partial`<[`OpenTableOptions`](../interfaces/OpenTableOptions.md)>
|
||||||
Additional options
|
Additional options
|
||||||
@@ -437,39 +327,6 @@ Open a table in the database.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### renameTable()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract renameTable(
|
|
||||||
currentName,
|
|
||||||
newName,
|
|
||||||
options?): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Rename a table.
|
|
||||||
|
|
||||||
Currently only supported by LanceDB Cloud. Local OSS connections and
|
|
||||||
namespace-backed connections (via [connectNamespace](../functions/connectNamespace.md)) reject with
|
|
||||||
a "not supported" error.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **currentName**: `string`
|
|
||||||
The current name of the table.
|
|
||||||
|
|
||||||
* **newName**: `string`
|
|
||||||
The new name for the table.
|
|
||||||
|
|
||||||
* **options?**: [`RenameTableOptions`](../interfaces/RenameTableOptions.md)
|
|
||||||
Optional namespace paths. When
|
|
||||||
`newNamespacePath` is omitted the table stays in `namespacePath`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### tableNames()
|
### tableNames()
|
||||||
|
|
||||||
#### tableNames(options)
|
#### tableNames(options)
|
||||||
@@ -492,10 +349,10 @@ Tables will be returned in lexicographical order.
|
|||||||
|
|
||||||
`Promise`<`string`[]>
|
`Promise`<`string`[]>
|
||||||
|
|
||||||
#### tableNames(namespacePath, options)
|
#### tableNames(namespace, options)
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
abstract tableNames(namespacePath?, options?): Promise<string[]>
|
abstract tableNames(namespace?, options?): Promise<string[]>
|
||||||
```
|
```
|
||||||
|
|
||||||
List all the table names in this database.
|
List all the table names in this database.
|
||||||
@@ -504,8 +361,8 @@ Tables will be returned in lexicographical order.
|
|||||||
|
|
||||||
##### Parameters
|
##### Parameters
|
||||||
|
|
||||||
* **namespacePath?**: `string`[]
|
* **namespace?**: `string`[]
|
||||||
The namespace path to list tables from (defaults to root namespace)
|
The namespace to list tables from (defaults to root namespace)
|
||||||
|
|
||||||
* **options?**: `Partial`<[`TableNamesOptions`](../interfaces/TableNamesOptions.md)>
|
* **options?**: `Partial`<[`TableNamesOptions`](../interfaces/TableNamesOptions.md)>
|
||||||
options to control the
|
options to control the
|
||||||
|
|||||||
@@ -57,24 +57,6 @@ block size may be added in the future.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### fm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
static fm(): Index
|
|
||||||
```
|
|
||||||
|
|
||||||
Create an FM-Index.
|
|
||||||
|
|
||||||
An FM-Index is a scalar index on string or binary columns that accelerates
|
|
||||||
substring search, i.e. `contains(col, 'needle')`. Unlike the tokenized
|
|
||||||
full-text-search index, it matches arbitrary substrings of the raw bytes.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`Index`](Index.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fts()
|
### fts()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -76,56 +76,6 @@ the query optimizer chooses a suboptimal path.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): MergeInsertBuilder
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL routing for this merge.
|
|
||||||
|
|
||||||
By default (unset), a `mergeInsert` on a table with an LSM write spec is
|
|
||||||
routed through Lance's MemWAL shard writer, and a table without one uses the
|
|
||||||
standard path.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces MemWAL routing and errors if the table has no
|
|
||||||
LSM write spec. `false` forces the standard write path even when a spec is set.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`MergeInsertBuilder`](MergeInsertBuilder.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### validateSingleShard()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
validateSingleShard(validateSingleShard): MergeInsertBuilder
|
|
||||||
```
|
|
||||||
|
|
||||||
Controls how an LSM merge checks that its input targets a single shard.
|
|
||||||
|
|
||||||
When a table has an LSM write spec, every row in a `mergeInsert` call must
|
|
||||||
route to the same shard. When `true` (the default), every row is inspected
|
|
||||||
to verify this. When `false`, only the first row is inspected and the
|
|
||||||
shard it routes to is used for the whole input — a faster path for callers
|
|
||||||
that have already pre-sharded their input. Has no effect on tables without
|
|
||||||
an LSM write spec.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **validateSingleShard**: `boolean`
|
|
||||||
Whether to check every row routes to one shard. Defaults to `true`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
[`MergeInsertBuilder`](MergeInsertBuilder.md)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### whenMatchedUpdateAll()
|
### whenMatchedUpdateAll()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ protected inner: Query | Promise<Query>;
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -41,12 +41,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
@@ -349,30 +343,6 @@ This is useful for pagination.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### orderBy()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
orderBy(ordering): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Sort the results by the specified column(s).
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **ordering**: [`ColumnOrdering`](../interfaces/ColumnOrdering.md) \| [`ColumnOrdering`](../interfaces/ColumnOrdering.md)[]
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
This query builder.
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.orderBy`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### outputSchema()
|
### outputSchema()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -497,42 +467,6 @@ ArrowTable.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this query.
|
|
||||||
|
|
||||||
By default (unset), when the table carries a MemWAL write spec (see
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec)), reads are routed through the LSM scanner so
|
|
||||||
they also return data written via the `mergeInsert` LSM path that has not yet
|
|
||||||
been compacted into the base table (the active/frozen in-memory memtables and
|
|
||||||
the flushed generations), deduplicated by primary key; a table without a spec
|
|
||||||
reads the base table.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces the LSM scanner and errors if the table has no
|
|
||||||
MemWAL write spec. `false` bypasses the MemWAL and reads the base table only,
|
|
||||||
even when a spec is present.
|
|
||||||
Note: the LSM scanner does not support every query shape (e.g. reranking,
|
|
||||||
hybrid search, `orderBy`). On a MemWAL table those shapes error unless
|
|
||||||
`useLsm(false)` is set, because a base-only read would silently exclude
|
|
||||||
un-compacted MemWAL data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.useLsm`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### where()
|
### where()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -560,9 +494,6 @@ x > 5 OR y = 'test'
|
|||||||
|
|
||||||
Filtering performance can often be improved by creating a scalar index
|
Filtering performance can often be improved by creating a scalar index
|
||||||
on the filter column(s).
|
on the filter column(s).
|
||||||
|
|
||||||
Calling this multiple times combines the filters with a logical AND rather
|
|
||||||
than replacing the previous filter.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Inherited from
|
#### Inherited from
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ protected inner: NativeQueryType | Promise<NativeQueryType>;
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -46,12 +46,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
|
|||||||
@@ -1,173 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / Scannable
|
|
||||||
|
|
||||||
# Class: Scannable
|
|
||||||
|
|
||||||
A data source that can be scanned as a stream of Arrow `RecordBatch`es.
|
|
||||||
|
|
||||||
`Scannable` wraps the schema + optional row count + rescannable flag and
|
|
||||||
a callback that yields batches one at a time. It is passed to consumers
|
|
||||||
(e.g. `Table.add`, `createTable`, `mergeInsert` — follow-up work) that
|
|
||||||
need to pull data without materializing the full dataset in JS memory.
|
|
||||||
|
|
||||||
Batches cross the JS↔Rust boundary as Arrow IPC Stream messages; a fresh
|
|
||||||
writer serializes each batch, and the Rust side decodes it with
|
|
||||||
`arrow_ipc::reader::StreamReader`. One batch is in flight at a time.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### numRows
|
|
||||||
|
|
||||||
```ts
|
|
||||||
readonly numRows: null | number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rescannable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
readonly rescannable: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### schema
|
|
||||||
|
|
||||||
```ts
|
|
||||||
readonly schema: Schema<any>;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### fromFactory()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
static fromFactory(
|
|
||||||
schema,
|
|
||||||
factory,
|
|
||||||
opts): Promise<Scannable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Build a Scannable from an explicit schema and a factory that returns a
|
|
||||||
fresh batch iterator on each call.
|
|
||||||
|
|
||||||
The factory is invoked once per scan. Each iterator yields
|
|
||||||
`RecordBatch`es matching the declared schema. Use this when you need
|
|
||||||
direct control over the pull loop — for example, to wrap a streaming
|
|
||||||
source whose batches are produced lazily.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **schema**: `Schema`<`any`>
|
|
||||||
The Arrow schema of the produced batches.
|
|
||||||
|
|
||||||
* **factory**
|
|
||||||
Called at the start of each scan to produce a batch
|
|
||||||
iterator. Must be idempotent when `rescannable` is true.
|
|
||||||
|
|
||||||
* **opts**: [`ScannableOptions`](../interfaces/ScannableOptions.md) = `{}`
|
|
||||||
Optional hints. `rescannable` defaults to `true`; set to
|
|
||||||
`false` if calling `factory()` twice would not reproduce the same data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Scannable`](Scannable.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fromIterable()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
static fromIterable(
|
|
||||||
schema,
|
|
||||||
iter,
|
|
||||||
opts): Promise<Scannable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Build a Scannable from an iterable of `RecordBatch`es. `rescannable`
|
|
||||||
defaults to `false`. Pass an explicit schema so the consumer can
|
|
||||||
validate before any batch is pulled.
|
|
||||||
|
|
||||||
`opts.rescannable: true` is honest for replayable iterables (Arrays,
|
|
||||||
Sets, or custom iterables whose `[Symbol.iterator]()` returns a fresh
|
|
||||||
iterator each call). It is rejected for one-shot iterables (generators,
|
|
||||||
async generators, or already-an-iterator inputs) because their
|
|
||||||
`[Symbol.iterator]()` returns the same exhausted object on the second
|
|
||||||
scan. For replayable sources outside this shape, use
|
|
||||||
`fromFactory(schema, () => createIter(), { rescannable: true })`.
|
|
||||||
|
|
||||||
Note: when `opts.rescannable` is `true`, the constructor calls
|
|
||||||
`[Symbol.iterator]()` once on the input to perform the structural check.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **schema**: `Schema`<`any`>
|
|
||||||
|
|
||||||
* **iter**: `Iterable`<`RecordBatch`<`any`>> \| `AsyncIterable`<`RecordBatch`<`any`>>
|
|
||||||
|
|
||||||
* **opts**: [`ScannableOptions`](../interfaces/ScannableOptions.md) = `{}`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Scannable`](Scannable.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fromRecordBatchReader()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
static fromRecordBatchReader(reader, opts): Promise<Scannable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Build a Scannable from an Arrow `RecordBatchReader`. A reader can only
|
|
||||||
be consumed once; `rescannable` defaults to `false`.
|
|
||||||
|
|
||||||
The reader must already be opened (via `.open()`) so its `.schema` is
|
|
||||||
populated. `RecordBatchReader.from(...)` returns an unopened reader.
|
|
||||||
|
|
||||||
`opts.rescannable: true` is rejected because `RecordBatchReader` is a
|
|
||||||
self-iterator (its `[Symbol.iterator]()` returns itself), and this
|
|
||||||
constructor does not call `reader.reset()` between scans, so a second
|
|
||||||
scan would always see an exhausted reader. For genuinely replayable
|
|
||||||
sources, use
|
|
||||||
`fromFactory(schema, () => openReader(), { rescannable: true })`,
|
|
||||||
which mints a fresh reader on each scan.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **reader**: `RecordBatchReader`<`any`>
|
|
||||||
|
|
||||||
* **opts**: [`ScannableOptions`](../interfaces/ScannableOptions.md) = `{}`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Scannable`](Scannable.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fromTable()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
static fromTable(table, opts): Promise<Scannable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Build a Scannable from an in-memory Arrow `Table`. Always rescannable;
|
|
||||||
the table's batches are replayed on each scan.
|
|
||||||
|
|
||||||
The table's row count is authoritative: `opts.numRows` must either be
|
|
||||||
omitted or equal to `table.numRows`. `opts.rescannable` of `false` is
|
|
||||||
rejected because in-memory Tables are always rescannable.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **table**: `Table`<`any`>
|
|
||||||
|
|
||||||
* **opts**: [`ScannableOptions`](../interfaces/ScannableOptions.md) = `{}`
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Scannable`](Scannable.md)>
|
|
||||||
+18
-242
@@ -71,12 +71,11 @@ Add new columns with defined values.
|
|||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* **newColumnTransforms**: `Field`<`any`> \| `Field`<`any`>[] \| `Schema`<`any`> \| [`AddColumnsSql`](../interfaces/AddColumnsSql.md)[]
|
* **newColumnTransforms**: [`AddColumnsSql`](../interfaces/AddColumnsSql.md)[]
|
||||||
Either:
|
pairs of column names and
|
||||||
- An array of objects with column names and SQL expressions to calculate values
|
the SQL expression to use to calculate the value of the new column. These
|
||||||
- A single Arrow Field defining one column with its data type (column will be initialized with null values)
|
expressions will be evaluated for each row in the table, and can
|
||||||
- An array of Arrow Fields defining columns with their data types (columns will be initialized with null values)
|
reference existing columns in the table.
|
||||||
- An Arrow Schema defining columns with their data types (columns will be initialized with null values)
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@@ -110,23 +109,6 @@ containing the new version number of the table after altering the columns.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### branches()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract branches(): Promise<Branches>
|
|
||||||
```
|
|
||||||
|
|
||||||
Get the branch manager for this table.
|
|
||||||
|
|
||||||
Branches are isolated, writable lines of history forked from another
|
|
||||||
branch (or version). Writes on a branch do not affect `main`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Branches`](Branches.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### checkout()
|
### checkout()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -204,25 +186,6 @@ Any attempt to use the table after it is closed will result in an error.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### closeLsmWriters()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract closeLsmWriters(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Drain and close any cached MemWAL shard writers held for this table.
|
|
||||||
|
|
||||||
When an [LsmWriteSpec](../interfaces/LsmWriteSpec.md) is installed, `mergeInsert` opens MemWAL
|
|
||||||
shard writers and caches them for reuse across calls. This closes them,
|
|
||||||
flushing pending data; writers reopen lazily on the next `mergeInsert`.
|
|
||||||
It is a no-op when no writers are cached.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### countRows()
|
### countRows()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -295,23 +258,6 @@ await table.createIndex("my_float_col");
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### currentBranch()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract currentBranch(): null | string
|
|
||||||
```
|
|
||||||
|
|
||||||
The branch this table handle is scoped to, or `null` for the main branch.
|
|
||||||
|
|
||||||
A handle returned by [Branches.create](Branches.md#create) or [Branches.checkout](Branches.md#checkout)
|
|
||||||
reports the branch it targets; a handle opened normally reports `null`.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`null` \| `string`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### delete()
|
### delete()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -398,26 +344,6 @@ Drop an index from the table.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### getLsmWriteSpec()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract getLsmWriteSpec(): Promise<undefined | LsmWriteSpec>
|
|
||||||
```
|
|
||||||
|
|
||||||
Read the [LsmWriteSpec](../interfaces/LsmWriteSpec.md) currently installed on this table.
|
|
||||||
|
|
||||||
Resolves to `undefined` when the MemWAL LSM write path is not enabled (no
|
|
||||||
spec has been set, or it was removed with [Table#unsetLsmWriteSpec](Table.md#unsetlsmwritespec)).
|
|
||||||
The returned spec — including its `maintainedIndexes` and
|
|
||||||
`writerConfigDefaults` — mirrors what was passed to
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec).
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`undefined` \| [`LsmWriteSpec`](../interfaces/LsmWriteSpec.md)>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexStats()
|
### indexStats()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -558,7 +484,19 @@ Modeled after ``VACUUM`` in PostgreSQL.
|
|||||||
- Prune: Removes old versions of the dataset
|
- Prune: Removes old versions of the dataset
|
||||||
- Index: Optimizes the indices, adding new data to existing indices
|
- Index: Optimizes the indices, adding new data to existing indices
|
||||||
|
|
||||||
The frequency an application should call optimize is based on the frequency of
|
Experimental API
|
||||||
|
----------------
|
||||||
|
|
||||||
|
The optimization process is undergoing active development and may change.
|
||||||
|
Our goal with these changes is to improve the performance of optimization and
|
||||||
|
reduce the complexity.
|
||||||
|
|
||||||
|
That being said, it is essential today to run optimize if you want the best
|
||||||
|
performance. It should be stable and safe to use in production, but it our
|
||||||
|
hope that the API may be simplified (or not even need to be called) in the
|
||||||
|
future.
|
||||||
|
|
||||||
|
The frequency an application shoudl call optimize is based on the frequency of
|
||||||
data modifications. If data is frequently added, deleted, or updated then
|
data modifications. If data is frequently added, deleted, or updated then
|
||||||
optimize should be run frequently. A good rule of thumb is to run optimize if
|
optimize should be run frequently. A good rule of thumb is to run optimize if
|
||||||
you have added or modified 100,000 or more records or run more than 20 data
|
you have added or modified 100,000 or more records or run more than 20 data
|
||||||
@@ -574,34 +512,6 @@ Modeled after ``VACUUM`` in PostgreSQL.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### prewarmData()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract prewarmData(columns?): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Prewarm one or more columns of data in the table.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **columns?**: `string`[]
|
|
||||||
The columns to prewarm. If undefined, all columns are prewarmed.
|
|
||||||
This will load the column data into the page cache so that future queries that
|
|
||||||
read those columns avoid the initial cold-start latency. This call initiates
|
|
||||||
prewarming and returns once the request is accepted; the warming itself may
|
|
||||||
continue in the background. Calling it on already-prewarmed columns is a
|
|
||||||
no-op on the server.
|
|
||||||
Prewarming is generally useful for columns used in filters or projections.
|
|
||||||
Large columns (e.g. high-dimensional vectors or binary data) may not be
|
|
||||||
practical to prewarm.
|
|
||||||
This feature is currently only supported on remote tables.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### prewarmIndex()
|
### prewarmIndex()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -763,74 +673,6 @@ of the given query
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### setLsmWriteSpec()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract setLsmWriteSpec(spec): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Install an [LsmWriteSpec](../interfaces/LsmWriteSpec.md) on this table, selecting Lance's MemWAL
|
|
||||||
LSM-style write path for future `mergeInsert` calls.
|
|
||||||
|
|
||||||
`LsmWriteSpec` chooses one of three sharding strategies via `specType`:
|
|
||||||
|
|
||||||
- `"bucket"` — hash-bucket writes by the single-column unenforced primary
|
|
||||||
key (`column` and `numBuckets` required).
|
|
||||||
- `"identity"` — shard by the raw value of a scalar `column`.
|
|
||||||
- `"unsharded"` — route every write to a single shard.
|
|
||||||
|
|
||||||
All variants require the table to have an unenforced primary key
|
|
||||||
([Table#setUnenforcedPrimaryKey](Table.md#setunenforcedprimarykey)); bucket sharding additionally
|
|
||||||
requires it to be the single column being bucketed.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **spec**: [`LsmWriteSpec`](../interfaces/LsmWriteSpec.md)
|
|
||||||
The sharding spec to install.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
await table.setUnenforcedPrimaryKey("id");
|
|
||||||
await table.setLsmWriteSpec({
|
|
||||||
specType: "bucket",
|
|
||||||
column: "id",
|
|
||||||
numBuckets: 16,
|
|
||||||
maintainedIndexes: ["id_idx"],
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### setUnenforcedPrimaryKey()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract setUnenforcedPrimaryKey(columns): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Set the unenforced primary key for this table to a single column.
|
|
||||||
|
|
||||||
"Unenforced" means LanceDB does not check uniqueness on writes; the
|
|
||||||
column is recorded in the schema as the primary key for use by features
|
|
||||||
such as `merge_insert`. Only single-column primary keys are supported,
|
|
||||||
and the key cannot be changed once set.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **columns**: `string` \| `string`[]
|
|
||||||
The primary key column. A one-element
|
|
||||||
array is also accepted; passing more than one column is rejected.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### stats()
|
### stats()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -934,49 +776,6 @@ Return the table as an arrow table
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### tokenize()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract tokenize(query, options): Promise<FtsToken[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
Tokenize a full-text search query using the tokenizer configured on an FTS index.
|
|
||||||
|
|
||||||
Specify exactly one of `column` or `indexName`.
|
|
||||||
|
|
||||||
Model-backed tokenizers such as `jieba/*` and `lindera/*` are rebuilt in
|
|
||||||
the client process from index metadata. For remote tables, this means the
|
|
||||||
same tokenizer model files must also exist locally.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **query**: `string`
|
|
||||||
|
|
||||||
* **options**: [`TokenizeTableOptions`](../type-aliases/TokenizeTableOptions.md)
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`FtsToken`](../interfaces/FtsToken.md)[]>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### unsetLsmWriteSpec()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract unsetLsmWriteSpec(): Promise<void>
|
|
||||||
```
|
|
||||||
|
|
||||||
Remove the [LsmWriteSpec](../interfaces/LsmWriteSpec.md) from this table, reverting to the standard
|
|
||||||
`mergeInsert` write path.
|
|
||||||
|
|
||||||
Errors if no spec is currently set.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<`void`>
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### update()
|
### update()
|
||||||
|
|
||||||
#### update(opts)
|
#### update(opts)
|
||||||
@@ -1074,29 +873,6 @@ based on the row being updated (e.g. "my_col + 1")
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### updateFieldMetadata()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
abstract updateFieldMetadata(updates): Promise<UpdateFieldMetadataResult>
|
|
||||||
```
|
|
||||||
|
|
||||||
Update per-field (column) metadata.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **updates**: [`FieldMetadataUpdate`](../interfaces/FieldMetadataUpdate.md)[]
|
|
||||||
One or more per-field updates. Each
|
|
||||||
update's metadata is merged into the field's existing metadata by default;
|
|
||||||
a value of `null` deletes that key, and `replace: true` swaps the whole map.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`Promise`<[`UpdateFieldMetadataResult`](../interfaces/UpdateFieldMetadataResult.md)>
|
|
||||||
|
|
||||||
resolves to the new table version.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### vectorSearch()
|
### vectorSearch()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ protected inner: TakeQuery | Promise<TakeQuery>;
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -37,12 +37,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
@@ -273,29 +267,6 @@ ArrowTable.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this take query.
|
|
||||||
|
|
||||||
`false` bypasses the MemWAL and reads the base table only — the escape hatch,
|
|
||||||
since take-by-row-id/offset is not supported on the LSM scanner and, on a
|
|
||||||
MemWAL table, auto-routes to it and errors otherwise.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`false` reads the base table only.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### withRowId()
|
### withRowId()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ addQueryVector(vector): VectorQuery
|
|||||||
### analyzePlan()
|
### analyzePlan()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
analyzePlan(distributedMetrics?): Promise<string>
|
analyzePlan(): Promise<string>
|
||||||
```
|
```
|
||||||
|
|
||||||
Executes the query and returns the physical query plan annotated with runtime metrics.
|
Executes the query and returns the physical query plan annotated with runtime metrics.
|
||||||
@@ -59,12 +59,6 @@ Executes the query and returns the physical query plan annotated with runtime me
|
|||||||
This is useful for debugging and performance analysis, as it shows how the query was executed
|
This is useful for debugging and performance analysis, as it shows how the query was executed
|
||||||
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
and includes metrics such as elapsed time, rows processed, and I/O statistics.
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **distributedMetrics?**: [`AnalyzePlanDistributedMetrics`](../type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
How distributed worker metrics are displayed for remote query plans.
|
|
||||||
Defaults to `"aggregate"`.
|
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
`Promise`<`string`>
|
`Promise`<`string`>
|
||||||
@@ -504,30 +498,6 @@ This is useful for pagination.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### orderBy()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
orderBy(ordering): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Sort the results by the specified column(s).
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **ordering**: [`ColumnOrdering`](../interfaces/ColumnOrdering.md) \| [`ColumnOrdering`](../interfaces/ColumnOrdering.md)[]
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
This query builder.
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.orderBy`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### outputSchema()
|
### outputSchema()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -746,42 +716,6 @@ ArrowTable.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### useLsm()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
useLsm(enable): this
|
|
||||||
```
|
|
||||||
|
|
||||||
Control MemWAL read routing for this query.
|
|
||||||
|
|
||||||
By default (unset), when the table carries a MemWAL write spec (see
|
|
||||||
[Table#setLsmWriteSpec](Table.md#setlsmwritespec)), reads are routed through the LSM scanner so
|
|
||||||
they also return data written via the `mergeInsert` LSM path that has not yet
|
|
||||||
been compacted into the base table (the active/frozen in-memory memtables and
|
|
||||||
the flushed generations), deduplicated by primary key; a table without a spec
|
|
||||||
reads the base table.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **enable**: `boolean`
|
|
||||||
`true` forces the LSM scanner and errors if the table has no
|
|
||||||
MemWAL write spec. `false` bypasses the MemWAL and reads the base table only,
|
|
||||||
even when a spec is present.
|
|
||||||
Note: the LSM scanner does not support every query shape (e.g. reranking,
|
|
||||||
hybrid search, `orderBy`). On a MemWAL table those shapes error unless
|
|
||||||
`useLsm(false)` is set, because a base-only read would silently exclude
|
|
||||||
un-compacted MemWAL data.
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`this`
|
|
||||||
|
|
||||||
#### Inherited from
|
|
||||||
|
|
||||||
`StandardQueryBase.useLsm`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### where()
|
### where()
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -809,9 +743,6 @@ x > 5 OR y = 'test'
|
|||||||
|
|
||||||
Filtering performance can often be improved by creating a scalar index
|
Filtering performance can often be improved by creating a scalar index
|
||||||
on the filter column(s).
|
on the filter column(s).
|
||||||
|
|
||||||
Calling this multiple times combines the filters with a logical AND rather
|
|
||||||
than replacing the previous filter.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Inherited from
|
#### Inherited from
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / OAuthFlowType
|
|
||||||
|
|
||||||
# Enumeration: OAuthFlowType
|
|
||||||
|
|
||||||
OAuth authentication flow types.
|
|
||||||
|
|
||||||
## Enumeration Members
|
|
||||||
|
|
||||||
### AzureManagedIdentity
|
|
||||||
|
|
||||||
```ts
|
|
||||||
AzureManagedIdentity: "azure_managed_identity";
|
|
||||||
```
|
|
||||||
|
|
||||||
Azure Managed Identity via IMDS.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### ClientCredentials
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ClientCredentials: "client_credentials";
|
|
||||||
```
|
|
||||||
|
|
||||||
Client Credentials grant (service-to-service / M2M).
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / connectNamespace
|
|
||||||
|
|
||||||
# Function: connectNamespace()
|
|
||||||
|
|
||||||
## connectNamespace(implName, config, options)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function connectNamespace(
|
|
||||||
implName,
|
|
||||||
config,
|
|
||||||
options?): Promise<Connection>
|
|
||||||
```
|
|
||||||
|
|
||||||
Connect to a LanceDB database through a namespace.
|
|
||||||
|
|
||||||
Unlike [connect](connect.md), which routes by URI scheme (local path vs.
|
|
||||||
`db://` cloud), `connectNamespace` always returns a namespace-backed
|
|
||||||
connection. The `implName` selects the namespace implementation:
|
|
||||||
|
|
||||||
- `"dir"` — directory namespace, configured with [DirNamespaceConfig](../interfaces/DirNamespaceConfig.md).
|
|
||||||
- `"rest"` — remote REST catalog, configured with [RestNamespaceConfig](../interfaces/RestNamespaceConfig.md).
|
|
||||||
- Any other string — full module path for a custom implementation,
|
|
||||||
configured with a free-form string-keyed `properties` map.
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
* **implName**: `"dir"`
|
|
||||||
|
|
||||||
* **config**: [`DirNamespaceConfig`](../interfaces/DirNamespaceConfig.md)
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`ConnectNamespaceOptions`](../interfaces/ConnectNamespaceOptions.md)>
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Connection`](../classes/Connection.md)>
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const db = await connectNamespace("dir", { root: "/path/to/db" });
|
|
||||||
await db.createTable("users", [{ id: 1 }]);
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const db = await connectNamespace("rest", {
|
|
||||||
uri: "https://catalog.example.com",
|
|
||||||
headers: { "x-api-key": process.env.CATALOG_KEY ?? "" },
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const db = await connectNamespace("my.custom.Namespace", {
|
|
||||||
endpoint: "...",
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## connectNamespace(implName, config, options)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function connectNamespace(
|
|
||||||
implName,
|
|
||||||
config,
|
|
||||||
options?): Promise<Connection>
|
|
||||||
```
|
|
||||||
|
|
||||||
Connect through the built-in REST namespace.
|
|
||||||
|
|
||||||
Configured with [RestNamespaceConfig](../interfaces/RestNamespaceConfig.md). See the function-level
|
|
||||||
documentation above for the full surface, examples, and how this
|
|
||||||
relates to [connect](connect.md).
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
* **implName**: `"rest"`
|
|
||||||
|
|
||||||
* **config**: [`RestNamespaceConfig`](../interfaces/RestNamespaceConfig.md)
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`ConnectNamespaceOptions`](../interfaces/ConnectNamespaceOptions.md)>
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Connection`](../classes/Connection.md)>
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const db = await connectNamespace("rest", {
|
|
||||||
uri: "https://catalog.example.com",
|
|
||||||
headers: { "x-api-key": process.env.CATALOG_KEY ?? "" },
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## connectNamespace(implName, properties, options)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function connectNamespace(
|
|
||||||
implName,
|
|
||||||
properties,
|
|
||||||
options?): Promise<Connection>
|
|
||||||
```
|
|
||||||
|
|
||||||
Connect through a custom namespace implementation by full module path,
|
|
||||||
configured with a free-form string-keyed `properties` map. Use the
|
|
||||||
typed overloads above for the built-in `"dir"` and `"rest"` impls.
|
|
||||||
|
|
||||||
See the function-level documentation above for examples and how this
|
|
||||||
relates to [connect](connect.md).
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
* **implName**: `string`
|
|
||||||
|
|
||||||
* **properties**: `Record`<`string`, `string`>
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`ConnectNamespaceOptions`](../interfaces/ConnectNamespaceOptions.md)>
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`Promise`<[`Connection`](../classes/Connection.md)>
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
const db = await connectNamespace("my.custom.Namespace", {
|
|
||||||
endpoint: "...",
|
|
||||||
});
|
|
||||||
```
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / instrumentLanceDbMetrics
|
|
||||||
|
|
||||||
# Function: instrumentLanceDbMetrics()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function instrumentLanceDbMetrics(meterProvider?): boolean
|
|
||||||
```
|
|
||||||
|
|
||||||
Register LanceDB metrics as OpenTelemetry observable instruments.
|
|
||||||
|
|
||||||
Installs a process-global metrics recorder and creates one observable
|
|
||||||
instrument per LanceDB metric (currently object store request counts, bytes,
|
|
||||||
latency, errors, and throttles) on the given (or global) `MeterProvider`. The
|
|
||||||
configured `MetricReader` then collects them on its own schedule.
|
|
||||||
|
|
||||||
Counters and gauges map directly to observable counters/gauges. Because
|
|
||||||
OpenTelemetry has no asynchronous histogram instrument, each histogram is
|
|
||||||
exported Prometheus-style as cumulative `le` bucket counts (`<name>_bucket`,
|
|
||||||
with an `le` attribute) plus `<name>_count` and `<name>_sum`.
|
|
||||||
|
|
||||||
Requires `@opentelemetry/api` (a dependency) and, to actually export, an
|
|
||||||
OpenTelemetry SDK such as `@opentelemetry/sdk-metrics`.
|
|
||||||
|
|
||||||
## Parameters
|
|
||||||
|
|
||||||
* **meterProvider?**: `MeterProvider`
|
|
||||||
The provider to register instruments on. Defaults to the
|
|
||||||
global provider from `@opentelemetry/api`.
|
|
||||||
|
|
||||||
## Returns
|
|
||||||
|
|
||||||
`boolean`
|
|
||||||
|
|
||||||
`true` if the recorder is installed and instruments are registered.
|
|
||||||
`false` if a different `metrics` recorder is already installed in this
|
|
||||||
process (only one global recorder is permitted), in which case a warning is
|
|
||||||
emitted and no instruments are created. Calling this more than once is safe;
|
|
||||||
instruments are created only on the first successful call.
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / tokenize
|
|
||||||
|
|
||||||
# Function: tokenize()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
function tokenize(query, options?): Promise<FtsToken[]>
|
|
||||||
```
|
|
||||||
|
|
||||||
Tokenize a full-text search query using an explicit tokenizer.
|
|
||||||
|
|
||||||
This does not require a table or FTS index. The tokenizer options match
|
|
||||||
[Index.fts](../classes/Index.md#fts).
|
|
||||||
|
|
||||||
## Parameters
|
|
||||||
|
|
||||||
* **query**: `string`
|
|
||||||
|
|
||||||
* **options?**: `Partial`<[`TokenizeOptions`](../interfaces/TokenizeOptions.md)>
|
|
||||||
|
|
||||||
## Returns
|
|
||||||
|
|
||||||
`Promise`<[`FtsToken`](../interfaces/FtsToken.md)[]>
|
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
## Enumerations
|
## Enumerations
|
||||||
|
|
||||||
- [FullTextQueryType](enumerations/FullTextQueryType.md)
|
- [FullTextQueryType](enumerations/FullTextQueryType.md)
|
||||||
- [OAuthFlowType](enumerations/OAuthFlowType.md)
|
|
||||||
- [Occur](enumerations/Occur.md)
|
- [Occur](enumerations/Occur.md)
|
||||||
- [Operator](enumerations/Operator.md)
|
- [Operator](enumerations/Operator.md)
|
||||||
|
|
||||||
@@ -20,8 +19,6 @@
|
|||||||
|
|
||||||
- [BooleanQuery](classes/BooleanQuery.md)
|
- [BooleanQuery](classes/BooleanQuery.md)
|
||||||
- [BoostQuery](classes/BoostQuery.md)
|
- [BoostQuery](classes/BoostQuery.md)
|
||||||
- [BranchContents](classes/BranchContents.md)
|
|
||||||
- [Branches](classes/Branches.md)
|
|
||||||
- [Connection](classes/Connection.md)
|
- [Connection](classes/Connection.md)
|
||||||
- [HeaderProvider](classes/HeaderProvider.md)
|
- [HeaderProvider](classes/HeaderProvider.md)
|
||||||
- [Index](classes/Index.md)
|
- [Index](classes/Index.md)
|
||||||
@@ -35,7 +32,6 @@
|
|||||||
- [PhraseQuery](classes/PhraseQuery.md)
|
- [PhraseQuery](classes/PhraseQuery.md)
|
||||||
- [Query](classes/Query.md)
|
- [Query](classes/Query.md)
|
||||||
- [QueryBase](classes/QueryBase.md)
|
- [QueryBase](classes/QueryBase.md)
|
||||||
- [Scannable](classes/Scannable.md)
|
|
||||||
- [Session](classes/Session.md)
|
- [Session](classes/Session.md)
|
||||||
- [StaticHeaderProvider](classes/StaticHeaderProvider.md)
|
- [StaticHeaderProvider](classes/StaticHeaderProvider.md)
|
||||||
- [Table](classes/Table.md)
|
- [Table](classes/Table.md)
|
||||||
@@ -52,32 +48,17 @@
|
|||||||
- [AddDataOptions](interfaces/AddDataOptions.md)
|
- [AddDataOptions](interfaces/AddDataOptions.md)
|
||||||
- [AddResult](interfaces/AddResult.md)
|
- [AddResult](interfaces/AddResult.md)
|
||||||
- [AlterColumnsResult](interfaces/AlterColumnsResult.md)
|
- [AlterColumnsResult](interfaces/AlterColumnsResult.md)
|
||||||
- [BranchColumnChange](interfaces/BranchColumnChange.md)
|
|
||||||
- [BranchColumnSummary](interfaces/BranchColumnSummary.md)
|
|
||||||
- [BranchDiff](interfaces/BranchDiff.md)
|
|
||||||
- [BranchIndexSummary](interfaces/BranchIndexSummary.md)
|
|
||||||
- [BranchRowCountSummary](interfaces/BranchRowCountSummary.md)
|
|
||||||
- [ClientConfig](interfaces/ClientConfig.md)
|
- [ClientConfig](interfaces/ClientConfig.md)
|
||||||
- [ColumnAlteration](interfaces/ColumnAlteration.md)
|
- [ColumnAlteration](interfaces/ColumnAlteration.md)
|
||||||
- [ColumnOrdering](interfaces/ColumnOrdering.md)
|
|
||||||
- [CompactionStats](interfaces/CompactionStats.md)
|
- [CompactionStats](interfaces/CompactionStats.md)
|
||||||
- [ConnectNamespaceOptions](interfaces/ConnectNamespaceOptions.md)
|
|
||||||
- [ConnectionOptions](interfaces/ConnectionOptions.md)
|
- [ConnectionOptions](interfaces/ConnectionOptions.md)
|
||||||
- [CreateNamespaceOptions](interfaces/CreateNamespaceOptions.md)
|
|
||||||
- [CreateNamespaceResponse](interfaces/CreateNamespaceResponse.md)
|
|
||||||
- [CreateTableOptions](interfaces/CreateTableOptions.md)
|
- [CreateTableOptions](interfaces/CreateTableOptions.md)
|
||||||
- [DeleteResult](interfaces/DeleteResult.md)
|
- [DeleteResult](interfaces/DeleteResult.md)
|
||||||
- [DescribeNamespaceResponse](interfaces/DescribeNamespaceResponse.md)
|
|
||||||
- [DirNamespaceConfig](interfaces/DirNamespaceConfig.md)
|
|
||||||
- [DropColumnsResult](interfaces/DropColumnsResult.md)
|
- [DropColumnsResult](interfaces/DropColumnsResult.md)
|
||||||
- [DropNamespaceOptions](interfaces/DropNamespaceOptions.md)
|
|
||||||
- [DropNamespaceResponse](interfaces/DropNamespaceResponse.md)
|
|
||||||
- [ExecutableQuery](interfaces/ExecutableQuery.md)
|
- [ExecutableQuery](interfaces/ExecutableQuery.md)
|
||||||
- [FieldMetadataUpdate](interfaces/FieldMetadataUpdate.md)
|
|
||||||
- [FragmentStatistics](interfaces/FragmentStatistics.md)
|
- [FragmentStatistics](interfaces/FragmentStatistics.md)
|
||||||
- [FragmentSummaryStats](interfaces/FragmentSummaryStats.md)
|
- [FragmentSummaryStats](interfaces/FragmentSummaryStats.md)
|
||||||
- [FtsOptions](interfaces/FtsOptions.md)
|
- [FtsOptions](interfaces/FtsOptions.md)
|
||||||
- [FtsToken](interfaces/FtsToken.md)
|
|
||||||
- [FullTextQuery](interfaces/FullTextQuery.md)
|
- [FullTextQuery](interfaces/FullTextQuery.md)
|
||||||
- [FullTextSearchOptions](interfaces/FullTextSearchOptions.md)
|
- [FullTextSearchOptions](interfaces/FullTextSearchOptions.md)
|
||||||
- [HnswPqOptions](interfaces/HnswPqOptions.md)
|
- [HnswPqOptions](interfaces/HnswPqOptions.md)
|
||||||
@@ -88,24 +69,13 @@
|
|||||||
- [IvfFlatOptions](interfaces/IvfFlatOptions.md)
|
- [IvfFlatOptions](interfaces/IvfFlatOptions.md)
|
||||||
- [IvfPqOptions](interfaces/IvfPqOptions.md)
|
- [IvfPqOptions](interfaces/IvfPqOptions.md)
|
||||||
- [IvfRqOptions](interfaces/IvfRqOptions.md)
|
- [IvfRqOptions](interfaces/IvfRqOptions.md)
|
||||||
- [ListNamespacesOptions](interfaces/ListNamespacesOptions.md)
|
|
||||||
- [ListNamespacesResponse](interfaces/ListNamespacesResponse.md)
|
|
||||||
- [LsmWriteSpec](interfaces/LsmWriteSpec.md)
|
|
||||||
- [MergeBlocker](interfaces/MergeBlocker.md)
|
|
||||||
- [MergeBranchResult](interfaces/MergeBranchResult.md)
|
|
||||||
- [MergePreview](interfaces/MergePreview.md)
|
|
||||||
- [MergeResult](interfaces/MergeResult.md)
|
- [MergeResult](interfaces/MergeResult.md)
|
||||||
- [NativeOAuthConfig](interfaces/NativeOAuthConfig.md)
|
|
||||||
- [OAuthConfig](interfaces/OAuthConfig.md)
|
|
||||||
- [OpenTableOptions](interfaces/OpenTableOptions.md)
|
- [OpenTableOptions](interfaces/OpenTableOptions.md)
|
||||||
- [OptimizeOptions](interfaces/OptimizeOptions.md)
|
- [OptimizeOptions](interfaces/OptimizeOptions.md)
|
||||||
- [OptimizeStats](interfaces/OptimizeStats.md)
|
- [OptimizeStats](interfaces/OptimizeStats.md)
|
||||||
- [QueryExecutionOptions](interfaces/QueryExecutionOptions.md)
|
- [QueryExecutionOptions](interfaces/QueryExecutionOptions.md)
|
||||||
- [RemovalStats](interfaces/RemovalStats.md)
|
- [RemovalStats](interfaces/RemovalStats.md)
|
||||||
- [RenameTableOptions](interfaces/RenameTableOptions.md)
|
|
||||||
- [RestNamespaceConfig](interfaces/RestNamespaceConfig.md)
|
|
||||||
- [RetryConfig](interfaces/RetryConfig.md)
|
- [RetryConfig](interfaces/RetryConfig.md)
|
||||||
- [ScannableOptions](interfaces/ScannableOptions.md)
|
|
||||||
- [ShuffleOptions](interfaces/ShuffleOptions.md)
|
- [ShuffleOptions](interfaces/ShuffleOptions.md)
|
||||||
- [SplitCalculatedOptions](interfaces/SplitCalculatedOptions.md)
|
- [SplitCalculatedOptions](interfaces/SplitCalculatedOptions.md)
|
||||||
- [SplitHashOptions](interfaces/SplitHashOptions.md)
|
- [SplitHashOptions](interfaces/SplitHashOptions.md)
|
||||||
@@ -116,18 +86,13 @@
|
|||||||
- [TimeoutConfig](interfaces/TimeoutConfig.md)
|
- [TimeoutConfig](interfaces/TimeoutConfig.md)
|
||||||
- [TlsConfig](interfaces/TlsConfig.md)
|
- [TlsConfig](interfaces/TlsConfig.md)
|
||||||
- [TokenResponse](interfaces/TokenResponse.md)
|
- [TokenResponse](interfaces/TokenResponse.md)
|
||||||
- [TokenizeOptions](interfaces/TokenizeOptions.md)
|
|
||||||
- [UpdateFieldMetadataResult](interfaces/UpdateFieldMetadataResult.md)
|
|
||||||
- [UpdateOptions](interfaces/UpdateOptions.md)
|
- [UpdateOptions](interfaces/UpdateOptions.md)
|
||||||
- [UpdateResult](interfaces/UpdateResult.md)
|
- [UpdateResult](interfaces/UpdateResult.md)
|
||||||
- [Version](interfaces/Version.md)
|
- [Version](interfaces/Version.md)
|
||||||
- [WriteExecutionOptions](interfaces/WriteExecutionOptions.md)
|
- [WriteExecutionOptions](interfaces/WriteExecutionOptions.md)
|
||||||
- [WriteProgress](interfaces/WriteProgress.md)
|
|
||||||
|
|
||||||
## Type Aliases
|
## Type Aliases
|
||||||
|
|
||||||
- [AnalyzePlanDistributedMetrics](type-aliases/AnalyzePlanDistributedMetrics.md)
|
|
||||||
- [BaseTokenizer](type-aliases/BaseTokenizer.md)
|
|
||||||
- [Data](type-aliases/Data.md)
|
- [Data](type-aliases/Data.md)
|
||||||
- [DataLike](type-aliases/DataLike.md)
|
- [DataLike](type-aliases/DataLike.md)
|
||||||
- [FieldLike](type-aliases/FieldLike.md)
|
- [FieldLike](type-aliases/FieldLike.md)
|
||||||
@@ -137,15 +102,11 @@
|
|||||||
- [RecordBatchLike](type-aliases/RecordBatchLike.md)
|
- [RecordBatchLike](type-aliases/RecordBatchLike.md)
|
||||||
- [SchemaLike](type-aliases/SchemaLike.md)
|
- [SchemaLike](type-aliases/SchemaLike.md)
|
||||||
- [TableLike](type-aliases/TableLike.md)
|
- [TableLike](type-aliases/TableLike.md)
|
||||||
- [TokenizeTableOptions](type-aliases/TokenizeTableOptions.md)
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
- [RecordBatchIterator](functions/RecordBatchIterator.md)
|
- [RecordBatchIterator](functions/RecordBatchIterator.md)
|
||||||
- [connect](functions/connect.md)
|
- [connect](functions/connect.md)
|
||||||
- [connectNamespace](functions/connectNamespace.md)
|
|
||||||
- [instrumentLanceDbMetrics](functions/instrumentLanceDbMetrics.md)
|
|
||||||
- [makeArrowTable](functions/makeArrowTable.md)
|
- [makeArrowTable](functions/makeArrowTable.md)
|
||||||
- [packBits](functions/packBits.md)
|
- [packBits](functions/packBits.md)
|
||||||
- [permutationBuilder](functions/permutationBuilder.md)
|
- [permutationBuilder](functions/permutationBuilder.md)
|
||||||
- [tokenize](functions/tokenize.md)
|
|
||||||
|
|||||||
@@ -19,39 +19,3 @@ mode: "append" | "overwrite";
|
|||||||
If "append" (the default) then the new data will be added to the table
|
If "append" (the default) then the new data will be added to the table
|
||||||
|
|
||||||
If "overwrite" then the new data will replace the existing data in the table.
|
If "overwrite" then the new data will replace the existing data in the table.
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### progress()
|
|
||||||
|
|
||||||
```ts
|
|
||||||
progress: (progress) => void;
|
|
||||||
```
|
|
||||||
|
|
||||||
Optional callback invoked periodically with write progress.
|
|
||||||
|
|
||||||
The callback is fired once per batch written and once more with
|
|
||||||
`done: true` when the write completes. Calls are dispatched
|
|
||||||
asynchronously to the JS event loop and never block the write — a slow
|
|
||||||
callback will queue events rather than back-pressure the writer.
|
|
||||||
|
|
||||||
Errors thrown from the callback are logged with `console.warn` and
|
|
||||||
swallowed — they do not abort the write.
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
* **progress**: [`WriteProgress`](WriteProgress.md)
|
|
||||||
|
|
||||||
#### Returns
|
|
||||||
|
|
||||||
`void`
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
await table.add(data, {
|
|
||||||
progress: (p) => {
|
|
||||||
console.log(`${p.outputRows}/${p.totalRows ?? "?"} rows`);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchColumnChange
|
|
||||||
|
|
||||||
# Interface: BranchColumnChange
|
|
||||||
|
|
||||||
A column whose definition differs between main and the branch.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### branch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
branch: BranchColumnSummary;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### main
|
|
||||||
|
|
||||||
```ts
|
|
||||||
main: BranchColumnSummary;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### name
|
|
||||||
|
|
||||||
```ts
|
|
||||||
name: string;
|
|
||||||
```
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchColumnSummary
|
|
||||||
|
|
||||||
# Interface: BranchColumnSummary
|
|
||||||
|
|
||||||
Summary of a column in a branch diff.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### dataType
|
|
||||||
|
|
||||||
```ts
|
|
||||||
dataType: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### name
|
|
||||||
|
|
||||||
```ts
|
|
||||||
name: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### nullable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
nullable: boolean;
|
|
||||||
```
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchDiff
|
|
||||||
|
|
||||||
# Interface: BranchDiff
|
|
||||||
|
|
||||||
Read-only comparison of a branch against main.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### addedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
addedColumns: BranchColumnSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### addedIndexes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
addedIndexes: BranchIndexSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### baseMoved
|
|
||||||
|
|
||||||
```ts
|
|
||||||
baseMoved: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### branchVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
branchVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### changedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
changedColumns: BranchColumnChange[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### fromBranch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
fromBranch: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mainVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
mainVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mergeBlockers
|
|
||||||
|
|
||||||
```ts
|
|
||||||
mergeBlockers: MergeBlocker[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mergeable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
mergeable: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### parentVersion
|
|
||||||
|
|
||||||
```ts
|
|
||||||
parentVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### removedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
removedColumns: BranchColumnSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### removedIndexes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
removedIndexes: BranchIndexSummary[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rowCountBranch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rowCountBranch: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rowCountMain
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rowCountMain: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### rowSummary
|
|
||||||
|
|
||||||
```ts
|
|
||||||
rowSummary: BranchRowCountSummary;
|
|
||||||
```
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchIndexSummary
|
|
||||||
|
|
||||||
# Interface: BranchIndexSummary
|
|
||||||
|
|
||||||
Summary of an index in a branch diff.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### columns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
columns: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexName
|
|
||||||
|
|
||||||
```ts
|
|
||||||
indexName: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexType?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexType: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### status
|
|
||||||
|
|
||||||
```ts
|
|
||||||
status: string;
|
|
||||||
```
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / BranchRowCountSummary
|
|
||||||
|
|
||||||
# Interface: BranchRowCountSummary
|
|
||||||
|
|
||||||
Row-level comparison between main and the branch.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### deltaAvailable
|
|
||||||
|
|
||||||
```ts
|
|
||||||
deltaAvailable: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### inputsChanged
|
|
||||||
|
|
||||||
```ts
|
|
||||||
inputsChanged: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### newOnBase
|
|
||||||
|
|
||||||
```ts
|
|
||||||
newOnBase: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### newOnBranch
|
|
||||||
|
|
||||||
```ts
|
|
||||||
newOnBranch: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### staleRecompute
|
|
||||||
|
|
||||||
```ts
|
|
||||||
staleRecompute: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### unchanged
|
|
||||||
|
|
||||||
```ts
|
|
||||||
unchanged: number;
|
|
||||||
```
|
|
||||||
@@ -53,18 +53,3 @@ optional tlsConfig: TlsConfig;
|
|||||||
```ts
|
```ts
|
||||||
optional userAgent: string;
|
optional userAgent: string;
|
||||||
```
|
```
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### userId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional userId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
User identifier for tracking purposes.
|
|
||||||
|
|
||||||
This is sent as the `x-lancedb-user-id` header in requests to LanceDB Cloud/Enterprise.
|
|
||||||
It can be set directly, or via the `LANCEDB_USER_ID` environment variable.
|
|
||||||
Alternatively, set `LANCEDB_USER_ID_ENV_KEY` to specify another environment
|
|
||||||
variable that contains the user ID value.
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / ColumnOrdering
|
|
||||||
|
|
||||||
# Interface: ColumnOrdering
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### ascending?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional ascending: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### columnName
|
|
||||||
|
|
||||||
```ts
|
|
||||||
columnName: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### nullsFirst?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional nullsFirst: boolean;
|
|
||||||
```
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / ConnectNamespaceOptions
|
|
||||||
|
|
||||||
# Interface: ConnectNamespaceOptions
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### namespaceClientProperties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional namespaceClientProperties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Extra properties for the backing namespace client.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### readConsistencyInterval?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional readConsistencyInterval: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The interval, in seconds, at which to check for updates to the table
|
|
||||||
from other processes. If None, then consistency is not checked. For
|
|
||||||
performance reasons, this is the default. For strong consistency, set
|
|
||||||
this to zero seconds. Then every read will check for updates from other
|
|
||||||
processes. As a compromise, you can set this to a non-zero value for
|
|
||||||
eventual consistency.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### session?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional session: Session;
|
|
||||||
```
|
|
||||||
|
|
||||||
The session to use for this connection. Holds shared caches and other
|
|
||||||
session-specific state.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### storageOptions?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional storageOptions: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Configuration for object storage. The available options are described
|
|
||||||
at https://docs.lancedb.com/storage/
|
|
||||||
@@ -41,62 +41,22 @@ for testing purposes.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### manifestEnabled?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional manifestEnabled: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
(For LanceDB OSS only): use directory namespace manifests as the source
|
|
||||||
of truth for table metadata. Existing directory-listed root tables are
|
|
||||||
migrated into the manifest on access.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### namespaceClientProperties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional namespaceClientProperties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
(For LanceDB OSS only): extra properties for the backing namespace
|
|
||||||
client used by manifest-enabled native connections.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### oauthConfig?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional oauthConfig: NativeOAuthConfig;
|
|
||||||
```
|
|
||||||
|
|
||||||
(For LanceDB cloud only): OAuth configuration for IdP-based
|
|
||||||
authentication (e.g., Azure Entra ID). When set, token acquisition
|
|
||||||
and refresh are handled entirely in Rust. TypeScript users should pass
|
|
||||||
the public `OAuthConfig` type exported from `@lancedb/lancedb`.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### readConsistencyInterval?
|
### readConsistencyInterval?
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
optional readConsistencyInterval: number;
|
optional readConsistencyInterval: number;
|
||||||
```
|
```
|
||||||
|
|
||||||
The interval, in seconds, at which to check for updates to the table
|
(For LanceDB OSS only): The interval, in seconds, at which to check for
|
||||||
from other processes. If None, then consistency is not checked. For
|
updates to the table from other processes. If None, then consistency is not
|
||||||
performance reasons, this is the default. For strong consistency, set
|
checked. For performance reasons, this is the default. For strong
|
||||||
this to zero seconds. Then every read will check for updates from other
|
consistency, set this to zero seconds. Then every read will check for
|
||||||
processes. As a compromise, you can set this to a non-zero value for
|
updates from other processes. As a compromise, you can set this to a
|
||||||
eventual consistency. If more than that interval has passed since the
|
non-zero value for eventual consistency. If more than that interval
|
||||||
last check, then the table will be checked for updates. Note: this
|
has passed since the last check, then the table will be checked for updates.
|
||||||
consistency only applies to read operations. Write operations are
|
Note: this consistency only applies to read operations. Write operations are
|
||||||
always consistent.
|
always consistent.
|
||||||
|
|
||||||
Stronger consistency is not free. The smaller the interval, the more
|
|
||||||
often each read pays the cost of checking for updates against object
|
|
||||||
storage, raising per-read latency and cost.
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### region?
|
### region?
|
||||||
@@ -129,4 +89,4 @@ optional storageOptions: Record<string, string>;
|
|||||||
|
|
||||||
(For LanceDB OSS only): configuration for object storage.
|
(For LanceDB OSS only): configuration for object storage.
|
||||||
|
|
||||||
The available options are described at https://docs.lancedb.com/storage/
|
The available options are described at https://lancedb.com/docs/storage/
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / CreateNamespaceOptions
|
|
||||||
|
|
||||||
# Interface: CreateNamespaceOptions
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### mode?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional mode: "overwrite" | "create" | "exist_ok";
|
|
||||||
```
|
|
||||||
|
|
||||||
Creation mode.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### properties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional properties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Properties to set on the new namespace.
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / CreateNamespaceResponse
|
|
||||||
|
|
||||||
# Interface: CreateNamespaceResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### properties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional properties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### transactionId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional transactionId: string;
|
|
||||||
```
|
|
||||||
@@ -97,4 +97,4 @@ Configuration for object storage.
|
|||||||
Options already set on the connection will be inherited by the table,
|
Options already set on the connection will be inherited by the table,
|
||||||
but can be overridden here.
|
but can be overridden here.
|
||||||
|
|
||||||
The available options are described at https://docs.lancedb.com/storage/
|
The available options are described at https://lancedb.com/docs/storage/
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / DescribeNamespaceResponse
|
|
||||||
|
|
||||||
# Interface: DescribeNamespaceResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### properties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional properties: Record<string, string>;
|
|
||||||
```
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / DirNamespaceConfig
|
|
||||||
|
|
||||||
# Interface: DirNamespaceConfig
|
|
||||||
|
|
||||||
Configuration for the built-in directory namespace (`"dir"`).
|
|
||||||
|
|
||||||
The directory namespace stores tables under a single root path (local
|
|
||||||
filesystem or object storage URI). See
|
|
||||||
[https://docs.lancedb.com/namespaces](https://docs.lancedb.com/namespaces) for the documented surface;
|
|
||||||
less-common knobs live under [DirNamespaceConfig.extraProperties](DirNamespaceConfig.md#extraproperties).
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### extraProperties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional extraProperties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Additional raw properties passed verbatim to the namespace
|
|
||||||
implementation (e.g. `storage.*`, `credential_vendor.*`). Typed
|
|
||||||
fields above take precedence on key collision.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### manifestEnabled?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional manifestEnabled: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
Whether to maintain a namespace manifest at the root. Required for
|
|
||||||
child namespaces. Defaults to true on the impl side.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### root
|
|
||||||
|
|
||||||
```ts
|
|
||||||
root: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Root path or URI containing the LanceDB tables.
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / DropNamespaceOptions
|
|
||||||
|
|
||||||
# Interface: DropNamespaceOptions
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### behavior?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional behavior: "restrict" | "cascade";
|
|
||||||
```
|
|
||||||
|
|
||||||
Refuse to drop if non-empty (restrict) or drop recursively (cascade).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mode?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional mode: "fail" | "skip";
|
|
||||||
```
|
|
||||||
|
|
||||||
Whether to skip if the namespace doesn't exist, or fail.
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / DropNamespaceResponse
|
|
||||||
|
|
||||||
# Interface: DropNamespaceResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### properties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional properties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### transactionId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional transactionId: string[];
|
|
||||||
```
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / FieldMetadataUpdate
|
|
||||||
|
|
||||||
# Interface: FieldMetadataUpdate
|
|
||||||
|
|
||||||
A per-field metadata update, addressed by dot-path.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### metadata
|
|
||||||
|
|
||||||
```ts
|
|
||||||
metadata: Record<string, null | string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Metadata key/value pairs. Merged into the field's existing metadata by
|
|
||||||
default; a value of `null` deletes that key.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### path
|
|
||||||
|
|
||||||
```ts
|
|
||||||
path: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Dot-separated path to the field. For a top-level column this is just its
|
|
||||||
name; for a nested field it's the path, e.g. "a.b.c".
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### replace?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional replace: boolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
If true, replace the field's entire metadata map instead of merging.
|
|
||||||
@@ -23,7 +23,7 @@ whether to remove punctuation
|
|||||||
### baseTokenizer?
|
### baseTokenizer?
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
optional baseTokenizer: BaseTokenizer;
|
optional baseTokenizer: "raw" | "simple" | "whitespace" | "ngram";
|
||||||
```
|
```
|
||||||
|
|
||||||
The tokenizer to use when building the index.
|
The tokenizer to use when building the index.
|
||||||
@@ -37,38 +37,6 @@ The following tokenizers are available:
|
|||||||
|
|
||||||
"raw" - Raw tokenizer. This tokenizer does not split the text into tokens and indexes the entire text as a single token.
|
"raw" - Raw tokenizer. This tokenizer does not split the text into tokens and indexes the entire text as a single token.
|
||||||
|
|
||||||
"icu" - ICU dictionary-based word segmentation.
|
|
||||||
|
|
||||||
"icu/split" - ICU segmentation with simple-style delimiter splitting.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### blockSize?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional blockSize: 128 | 256;
|
|
||||||
```
|
|
||||||
|
|
||||||
Number of documents per compressed posting block.
|
|
||||||
|
|
||||||
The default is 128. Supported values are 128 and 256. A value of 256 uses
|
|
||||||
the experimental FTS V3 format and may introduce breaking changes.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### customStopWords?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional customStopWords: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Custom stop words that replace the built-in list for `language`.
|
|
||||||
|
|
||||||
This option only affects tokenization when `removeStopWords` is true.
|
|
||||||
|
|
||||||
`undefined` keeps the built-in language list. An empty array explicitly
|
|
||||||
replaces it with no stop words.
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### language?
|
### language?
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / FtsToken
|
|
||||||
|
|
||||||
# Interface: FtsToken
|
|
||||||
|
|
||||||
Token produced by the tokenizer configured on a full-text search index.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### position
|
|
||||||
|
|
||||||
```ts
|
|
||||||
position: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Token position used by full-text query matching.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### text
|
|
||||||
|
|
||||||
```ts
|
|
||||||
text: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Token text after tokenizer filters have been applied.
|
|
||||||
@@ -23,31 +23,6 @@ be more columns to represent composite indices.
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### createdAt?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional createdAt: Date;
|
|
||||||
```
|
|
||||||
|
|
||||||
When the index was created.
|
|
||||||
|
|
||||||
`undefined` for remote tables or indices created before timestamps were tracked.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexDetails?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexDetails: any;
|
|
||||||
```
|
|
||||||
|
|
||||||
Index-type-specific details parsed as a JavaScript object.
|
|
||||||
|
|
||||||
Falls back to a raw string if JSON parsing fails. `undefined` for
|
|
||||||
remote tables or when details are unavailable.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexType
|
### indexType
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -58,30 +33,6 @@ The type of the index
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### indexUuid?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexUuid: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The UUID of the first segment of the index.
|
|
||||||
|
|
||||||
`undefined` for remote tables, which do not yet surface this.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### indexVersion?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional indexVersion: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The on-disk index format version.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### name
|
### name
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -89,63 +40,3 @@ name: string;
|
|||||||
```
|
```
|
||||||
|
|
||||||
The name of the index
|
The name of the index
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numIndexedRows?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numIndexedRows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The number of rows indexed, across all segments.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numSegments?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numSegments: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The number of segments that make up the index.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numUnindexedRows?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numUnindexedRows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The number of rows not yet covered by this index.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### sizeBytes?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional sizeBytes: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
The total size in bytes of all index files across all segments.
|
|
||||||
|
|
||||||
`undefined` for remote tables or indices without size tracking.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### typeUrl?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional typeUrl: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
The protobuf type URL, a precise type identifier for the index.
|
|
||||||
|
|
||||||
`undefined` for remote tables.
|
|
||||||
|
|||||||
@@ -30,6 +30,17 @@ The type of the index
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
|
### loss?
|
||||||
|
|
||||||
|
```ts
|
||||||
|
optional loss: number;
|
||||||
|
```
|
||||||
|
|
||||||
|
The KMeans loss value of the index,
|
||||||
|
it is only present for vector indices.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
### numIndexedRows
|
### numIndexedRows
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / ListNamespacesOptions
|
|
||||||
|
|
||||||
# Interface: ListNamespacesOptions
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### limit?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional limit: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
An optional limit to the number of results to return.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### pageToken?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional pageToken: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Token from a previous response for pagination.
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / ListNamespacesResponse
|
|
||||||
|
|
||||||
# Interface: ListNamespacesResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### namespaces
|
|
||||||
|
|
||||||
```ts
|
|
||||||
namespaces: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### pageToken?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional pageToken: string;
|
|
||||||
```
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / LsmWriteSpec
|
|
||||||
|
|
||||||
# Interface: LsmWriteSpec
|
|
||||||
|
|
||||||
Specification selecting Lance's MemWAL LSM-style write path for
|
|
||||||
`mergeInsert`.
|
|
||||||
|
|
||||||
`specType` is `"bucket"`, `"identity"`, or `"unsharded"`. For `"bucket"`,
|
|
||||||
`column` and `numBuckets` are required; for `"identity"`, `column` is
|
|
||||||
required and must be a deterministic function of the unenforced primary
|
|
||||||
key (every row with a given primary key must always produce the same
|
|
||||||
`column` value, or upserts of that key can land in different shards and a
|
|
||||||
stale version can win).
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### column?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional column: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Bucket and identity variants: the sharding column.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### maintainedIndexes?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional maintainedIndexes: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
Names of indexes the MemWAL should keep up to date during writes.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numBuckets?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional numBuckets: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Bucket variant: the number of buckets, in `[1, 1024]`.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### specType
|
|
||||||
|
|
||||||
```ts
|
|
||||||
specType: "bucket" | "identity" | "unsharded";
|
|
||||||
```
|
|
||||||
|
|
||||||
One of `"bucket"`, `"identity"`, or `"unsharded"`.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### writerConfigDefaults?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional writerConfigDefaults: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Default `ShardWriter` configuration recorded in the MemWAL index.
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / MergeBlocker
|
|
||||||
|
|
||||||
# Interface: MergeBlocker
|
|
||||||
|
|
||||||
A reason why a branch cannot currently be merged.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### code
|
|
||||||
|
|
||||||
```ts
|
|
||||||
code: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### message
|
|
||||||
|
|
||||||
```ts
|
|
||||||
message: string;
|
|
||||||
```
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / MergeBranchResult
|
|
||||||
|
|
||||||
# Interface: MergeBranchResult
|
|
||||||
|
|
||||||
Result of previewing or attempting a branch merge.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### diff
|
|
||||||
|
|
||||||
```ts
|
|
||||||
diff: BranchDiff;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### mainVersionAfter?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional mainVersionAfter: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### preview
|
|
||||||
|
|
||||||
```ts
|
|
||||||
preview: MergePreview;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### status
|
|
||||||
|
|
||||||
```ts
|
|
||||||
status:
|
|
||||||
| "unknown"
|
|
||||||
| "rejected"
|
|
||||||
| "ready"
|
|
||||||
| "notImplemented"
|
|
||||||
| "merged";
|
|
||||||
```
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / MergePreview
|
|
||||||
|
|
||||||
# Interface: MergePreview
|
|
||||||
|
|
||||||
Changes that would be, or were, promoted by a branch merge.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### promotedColumns
|
|
||||||
|
|
||||||
```ts
|
|
||||||
promotedColumns: string[];
|
|
||||||
```
|
|
||||||
@@ -32,14 +32,6 @@ numInsertedRows: number;
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### numRows
|
|
||||||
|
|
||||||
```ts
|
|
||||||
numRows: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### numUpdatedRows
|
### numUpdatedRows
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / NativeOAuthConfig
|
|
||||||
|
|
||||||
# Interface: NativeOAuthConfig
|
|
||||||
|
|
||||||
OAuth configuration for LanceDB authentication.
|
|
||||||
|
|
||||||
This is the generated napi-rs binding shape. TypeScript users should prefer
|
|
||||||
the public `OAuthConfig` type exported from `@lancedb/lancedb`.
|
|
||||||
|
|
||||||
All token acquisition and refresh is handled in the Rust layer.
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### clientId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
clientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Application / Client ID.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### clientSecret?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional clientSecret: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client secret (required for client_credentials).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### flow?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional flow: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Authentication flow: "client_credentials" or "azure_managed_identity"
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### issuerUrl
|
|
||||||
|
|
||||||
```ts
|
|
||||||
issuerUrl: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
OIDC issuer URL or OAuth authority URL.
|
|
||||||
For Azure: `https://login.microsoftonline.com/{tenant_id}/v2.0`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### managedIdentityClientId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional managedIdentityClientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client ID for user-assigned managed identity (azure_managed_identity).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### refreshBufferSecs?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional refreshBufferSecs: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Seconds before expiry to trigger proactive refresh (default: 300).
|
|
||||||
Keep this well below the token TTL; if it is greater than or equal to
|
|
||||||
the TTL, each request refreshes the token.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### scopes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
scopes: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
OAuth scopes to request. For Azure managed identity, exactly one scope
|
|
||||||
or resource is required. For example: `["api://{app_id}/.default"]`
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / OAuthConfig
|
|
||||||
|
|
||||||
# Interface: OAuthConfig
|
|
||||||
|
|
||||||
OAuth configuration for LanceDB authentication.
|
|
||||||
|
|
||||||
This is the public TypeScript OAuth configuration type. The generated
|
|
||||||
`NativeOAuthConfig` type has the same runtime shape but is an implementation
|
|
||||||
detail of the napi-rs binding.
|
|
||||||
|
|
||||||
All token acquisition and refresh is handled in the Rust layer.
|
|
||||||
This config is passed through to Rust via napi-rs.
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
const config: OAuthConfig = {
|
|
||||||
issuerUrl: "https://login.microsoftonline.com/{tenant}/v2.0",
|
|
||||||
clientId: "app-id",
|
|
||||||
clientSecret: "secret",
|
|
||||||
scopes: ["api://lancedb-api/.default"],
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
const config: OAuthConfig = {
|
|
||||||
issuerUrl: "https://login.microsoftonline.com/{tenant}/v2.0",
|
|
||||||
clientId: "app-id",
|
|
||||||
scopes: ["api://lancedb-api/.default"],
|
|
||||||
flow: OAuthFlowType.AzureManagedIdentity,
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### clientId
|
|
||||||
|
|
||||||
```ts
|
|
||||||
clientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Application / Client ID.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### clientSecret?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional clientSecret: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client secret (required for ClientCredentials).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### flow?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional flow: OAuthFlowType;
|
|
||||||
```
|
|
||||||
|
|
||||||
Authentication flow (default: ClientCredentials).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### issuerUrl
|
|
||||||
|
|
||||||
```ts
|
|
||||||
issuerUrl: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
OIDC issuer URL or OAuth authority URL.
|
|
||||||
For Azure: `https://login.microsoftonline.com/{tenant_id}/v2.0`
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### managedIdentityClientId?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional managedIdentityClientId: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Client ID for user-assigned managed identity (AzureManagedIdentity).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### refreshBufferSecs?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional refreshBufferSecs: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Seconds before expiry to trigger proactive refresh (default: 300).
|
|
||||||
Keep this well below the token TTL; if it is greater than or equal to
|
|
||||||
the TTL, each request refreshes the token.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### scopes
|
|
||||||
|
|
||||||
```ts
|
|
||||||
scopes: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
OAuth scopes to request.
|
|
||||||
For Azure managed identity, exactly one scope or resource is required.
|
|
||||||
For example: `["api://{app_id}/.default"]`
|
|
||||||
@@ -8,18 +8,6 @@
|
|||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
### branch?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional branch: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Open the table scoped to this branch instead of the default branch.
|
|
||||||
|
|
||||||
Reads and writes on the returned table operate in the branch's context.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### ~~indexCacheSize?~~
|
### ~~indexCacheSize?~~
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -54,18 +42,4 @@ Configuration for object storage.
|
|||||||
Options already set on the connection will be inherited by the table,
|
Options already set on the connection will be inherited by the table,
|
||||||
but can be overridden here.
|
but can be overridden here.
|
||||||
|
|
||||||
The available options are described at https://docs.lancedb.com/storage/
|
The available options are described at https://lancedb.com/docs/storage/
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### version?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional version: number;
|
|
||||||
```
|
|
||||||
|
|
||||||
Open the table pinned to this version, producing a read-only view.
|
|
||||||
|
|
||||||
Composes with [OpenTableOptions.branch](OpenTableOptions.md#branch): when both are set, opens
|
|
||||||
that branch at the version; otherwise opens `main` at the version. Call
|
|
||||||
`checkoutLatest` to return to a writable state.
|
|
||||||
|
|||||||
@@ -37,12 +37,3 @@ tbl.optimize({cleanupOlderThan: new Date()});
|
|||||||
```ts
|
```ts
|
||||||
deleteUnverified: boolean;
|
deleteUnverified: boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
Because they may be part of an in-progress transaction, files newer than
|
|
||||||
7 days old are not deleted by default. If you are sure that there are no
|
|
||||||
in-progress transactions, then you can set this to true to delete all
|
|
||||||
files older than `cleanupOlderThan`.
|
|
||||||
|
|
||||||
**WARNING**: This should only be set to true if you can guarantee that
|
|
||||||
no other process is currently working on this dataset. Otherwise the
|
|
||||||
dataset could be put into a corrupted state.
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / RenameTableOptions
|
|
||||||
|
|
||||||
# Interface: RenameTableOptions
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### namespacePath?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional namespacePath: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
The namespace path of the table being renamed. Defaults to the root
|
|
||||||
namespace (`[]`) when omitted.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### newNamespacePath?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional newNamespacePath: string[];
|
|
||||||
```
|
|
||||||
|
|
||||||
The namespace path to move the table to as part of the rename. When
|
|
||||||
omitted the table stays in `namespacePath`.
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
[@lancedb/lancedb](../globals.md) / RestNamespaceConfig
|
|
||||||
|
|
||||||
# Interface: RestNamespaceConfig
|
|
||||||
|
|
||||||
Configuration for the built-in REST namespace (`"rest"`).
|
|
||||||
|
|
||||||
The REST namespace talks to a remote catalog server over HTTP. See
|
|
||||||
[https://docs.lancedb.com/namespaces](https://docs.lancedb.com/namespaces) for the documented surface;
|
|
||||||
less-common knobs (TLS, metrics) live under
|
|
||||||
[RestNamespaceConfig.extraProperties](RestNamespaceConfig.md#extraproperties).
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
### extraProperties?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional extraProperties: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
Additional raw properties passed verbatim to the namespace
|
|
||||||
implementation (e.g. `tls.*`, `ops_metrics_enabled`, `delimiter`).
|
|
||||||
Typed fields above take precedence on key collision.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### headers?
|
|
||||||
|
|
||||||
```ts
|
|
||||||
optional headers: Record<string, string>;
|
|
||||||
```
|
|
||||||
|
|
||||||
HTTP headers forwarded with each request. Keys are passed through
|
|
||||||
as-is (e.g. `"x-api-key"`, `"Authorization"`).
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### uri
|
|
||||||
|
|
||||||
```ts
|
|
||||||
uri: string;
|
|
||||||
```
|
|
||||||
|
|
||||||
Catalog endpoint URL.
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user