@lancedb/lancedb 0.14.2-beta.0 → 0.15.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
1
+ # Contributing to LanceDB Typescript
2
+
3
+ This document outlines the process for contributing to LanceDB Typescript.
4
+ For general contribution guidelines, see [CONTRIBUTING.md](../CONTRIBUTING.md).
5
+
6
+ ## Project layout
7
+
8
+ The Typescript package is a wrapper around the Rust library, `lancedb`. We use
9
+ the [napi-rs](https://napi.rs/) library to create the bindings between Rust and
10
+ Typescript.
11
+
12
+ * `src/`: Rust bindings source code
13
+ * `lancedb/`: Typescript package source code
14
+ * `__test__/`: Unit tests
15
+ * `examples/`: An npm package with the examples shown in the documentation
16
+
17
+ ## Development environment
18
+
19
+ To set up your development environment, you will need to install the following:
20
+
21
+ 1. Node.js 14 or later
22
+ 2. Rust's package manager, Cargo. Use [rustup](https://rustup.rs/) to install.
23
+ 3. [protoc](https://grpc.io/docs/protoc-installation/) (Protocol Buffers compiler)
24
+
25
+ Initial setup:
26
+
27
+ ```shell
28
+ npm install
29
+ ```
30
+
31
+ ### Commit Hooks
32
+
33
+ It is **highly recommended** to install the [pre-commit](https://pre-commit.com/) hooks to ensure that your
34
+ code is formatted correctly and passes basic checks before committing:
35
+
36
+ ```shell
37
+ pre-commit install
38
+ ```
39
+
40
+ ## Development
41
+
42
+ Most common development commands can be run using the npm scripts.
43
+
44
+ Build the package
45
+
46
+ ```shell
47
+ npm install
48
+ npm run build
49
+ ```
50
+
51
+ Lint:
52
+
53
+ ```shell
54
+ npm run lint
55
+ ```
56
+
57
+ Format and fix lints:
58
+
59
+ ```shell
60
+ npm run lint-fix
61
+ ```
62
+
63
+ Run tests:
64
+
65
+ ```shell
66
+ npm test
67
+ ```
68
+
69
+ To run a single test:
70
+
71
+ ```shell
72
+ # Single file: table.test.ts
73
+ npm test -- table.test.ts
74
+ # Single test: 'merge insert' in table.test.ts
75
+ npm test -- table.test.ts --testNamePattern=merge\ insert
76
+ ```
package/README.md CHANGED
@@ -36,37 +36,4 @@ The [quickstart](../basic.md) contains a more complete example.
36
36
 
37
37
  ## Development
38
38
 
39
- ```sh
40
- npm run build
41
- npm run test
42
- ```
43
-
44
- ### Running lint / format
45
-
46
- LanceDb uses [biome](https://biomejs.dev/) for linting and formatting. if you are using VSCode you will need to install the official [Biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) extension.
47
- To manually lint your code you can run:
48
-
49
- ```sh
50
- npm run lint
51
- ```
52
-
53
- to automatically fix all fixable issues:
54
-
55
- ```sh
56
- npm run lint-fix
57
- ```
58
-
59
- If you do not have your workspace root set to the `nodejs` directory, unfortunately the extension will not work. You can still run the linting and formatting commands manually.
60
-
61
- ### Generating docs
62
-
63
- ```sh
64
- npm run docs
65
-
66
- cd ../docs
67
- # Asssume the virtual environment was created
68
- # python3 -m venv venv
69
- # pip install -r requirements.txt
70
- . ./venv/bin/activate
71
- mkdocs build
72
- ```
39
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for information on how to contribute to LanceDB.
package/dist/native.d.ts CHANGED
@@ -304,6 +304,7 @@ export class VectorQuery {
304
304
  postfilter(): void
305
305
  refineFactor(refineFactor: number): void
306
306
  nprobes(nprobe: number): void
307
+ distanceRange(lowerBound?: number | undefined | null, upperBound?: number | undefined | null): void
307
308
  ef(ef: number): void
308
309
  bypassVectorIndex(): void
309
310
  onlyIf(predicate: string): void
package/dist/query.d.ts CHANGED
@@ -182,6 +182,7 @@ export declare class VectorQuery extends QueryBase<NativeVectorQuery> {
182
182
  * you the desired recall.
183
183
  */
184
184
  nprobes(nprobes: number): VectorQuery;
185
+ distanceRange(lowerBound?: number, upperBound?: number): VectorQuery;
185
186
  /**
186
187
  * Set the number of candidates to consider during the search
187
188
  *
package/dist/query.js CHANGED
@@ -308,6 +308,18 @@ class VectorQuery extends QueryBase {
308
308
  super.doCall((inner) => inner.nprobes(nprobes));
309
309
  return this;
310
310
  }
311
+ /*
312
+ * Set the distance range to use
313
+ *
314
+ * Only rows with distances within range [lower_bound, upper_bound)
315
+ * will be returned.
316
+ *
317
+ * `undefined` means no lower or upper bound.
318
+ */
319
+ distanceRange(lowerBound, upperBound) {
320
+ super.doCall((inner) => inner.distanceRange(lowerBound, upperBound));
321
+ return this;
322
+ }
311
323
  /**
312
324
  * Set the number of candidates to consider during the search
313
325
  *
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "ann"
12
12
  ],
13
13
  "private": false,
14
- "version": "0.14.2-beta.0",
14
+ "version": "0.15.0-beta.0",
15
15
  "main": "dist/index.js",
16
16
  "exports": {
17
17
  ".": "./dist/index.js",
@@ -98,14 +98,14 @@
98
98
  "reflect-metadata": "^0.2.2"
99
99
  },
100
100
  "optionalDependencies": {
101
- "@lancedb/lancedb-darwin-x64": "0.14.2-beta.0",
102
- "@lancedb/lancedb-darwin-arm64": "0.14.2-beta.0",
103
- "@lancedb/lancedb-linux-x64-gnu": "0.14.2-beta.0",
104
- "@lancedb/lancedb-linux-arm64-gnu": "0.14.2-beta.0",
105
- "@lancedb/lancedb-linux-x64-musl": "0.14.2-beta.0",
106
- "@lancedb/lancedb-linux-arm64-musl": "0.14.2-beta.0",
107
- "@lancedb/lancedb-win32-x64-msvc": "0.14.2-beta.0",
108
- "@lancedb/lancedb-win32-arm64-msvc": "0.14.2-beta.0"
101
+ "@lancedb/lancedb-darwin-x64": "0.15.0-beta.0",
102
+ "@lancedb/lancedb-darwin-arm64": "0.15.0-beta.0",
103
+ "@lancedb/lancedb-linux-x64-gnu": "0.15.0-beta.0",
104
+ "@lancedb/lancedb-linux-arm64-gnu": "0.15.0-beta.0",
105
+ "@lancedb/lancedb-linux-x64-musl": "0.15.0-beta.0",
106
+ "@lancedb/lancedb-linux-arm64-musl": "0.15.0-beta.0",
107
+ "@lancedb/lancedb-win32-x64-msvc": "0.15.0-beta.0",
108
+ "@lancedb/lancedb-win32-arm64-msvc": "0.15.0-beta.0"
109
109
  },
110
110
  "peerDependencies": {
111
111
  "apache-arrow": ">=15.0.0 <=18.1.0"