@lancedb/lancedb 0.29.0 → 0.30.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.
- package/AGENTS.md +6 -6
- package/CONTRIBUTING.md +15 -13
- package/dist/arrow.d.ts +6 -0
- package/dist/arrow.js +10 -0
- package/dist/connection.d.ts +98 -0
- package/dist/connection.js +15 -0
- package/dist/index.d.ts +118 -5
- package/dist/index.js +48 -1
- package/dist/native.d.ts +140 -1
- package/dist/native.js +53 -52
- package/dist/query.d.ts +10 -0
- package/dist/query.js +14 -0
- package/dist/scannable.d.ts +92 -0
- package/dist/scannable.js +200 -0
- package/dist/table.d.ts +118 -0
- package/dist/table.js +25 -1
- package/package.json +21 -20
- package/pnpm-workspace.yaml +18 -0
package/dist/native.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
export declare class Connection {
|
|
4
4
|
/** Create a new Connection instance from the given URI. */
|
|
5
5
|
static new(uri: string, options: ConnectionOptions, headerProvider?: JsHeaderProvider | undefined | null): Promise<Connection>
|
|
6
|
+
/** Create a new Connection instance backed by a namespace implementation. */
|
|
7
|
+
static newWithNamespace(implName: string, properties: Record<string, string>, options: ConnectNamespaceOptions): Promise<Connection>
|
|
6
8
|
display(): string
|
|
7
9
|
isOpen(): boolean
|
|
8
10
|
close(): void
|
|
@@ -22,6 +24,20 @@ export declare class Connection {
|
|
|
22
24
|
/** Drop table with the name. Or raise an error if the table does not exist. */
|
|
23
25
|
dropTable(name: string, namespacePath?: Array<string> | undefined | null): Promise<void>
|
|
24
26
|
dropAllTables(namespacePath?: Array<string> | undefined | null): Promise<void>
|
|
27
|
+
/** Describe a namespace and return its properties. */
|
|
28
|
+
describeNamespace(namespacePath: Array<string>): Promise<DescribeNamespaceResponse>
|
|
29
|
+
/** List child namespaces under the given namespace path */
|
|
30
|
+
listNamespaces(namespacePath?: Array<string> | undefined | null, pageToken?: string | undefined | null, limit?: number | undefined | null): Promise<ListNamespacesResponse>
|
|
31
|
+
/** Create a new namespace with optional properties. */
|
|
32
|
+
createNamespace(namespacePath: Array<string>, mode?: string | undefined | null, properties?: Record<string, string> | undefined | null): Promise<CreateNamespaceResponse>
|
|
33
|
+
/** Drop a namespace. */
|
|
34
|
+
dropNamespace(namespacePath: Array<string>, mode?: string | undefined | null, behavior?: string | undefined | null): Promise<DropNamespaceResponse>
|
|
35
|
+
/**
|
|
36
|
+
* Rename a table. `current_namespace_path` and `new_namespace_path` default to
|
|
37
|
+
* the root namespace when omitted; the caller is expected to either pass both
|
|
38
|
+
* or pass neither.
|
|
39
|
+
*/
|
|
40
|
+
renameTable(currentName: string, newName: string, currentNamespacePath?: Array<string> | undefined | null, newNamespacePath?: Array<string> | undefined | null): Promise<void>
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
export declare class Index {
|
|
@@ -55,6 +71,30 @@ export declare class JsHeaderProvider {
|
|
|
55
71
|
constructor(getHeadersCallback: () => Promise<Record<string, string>>)
|
|
56
72
|
}
|
|
57
73
|
|
|
74
|
+
/**
|
|
75
|
+
* A Rust-side view of a JS-constructed `Scannable`.
|
|
76
|
+
*
|
|
77
|
+
* Held in JS as the return value of the `Scannable` class constructor. When
|
|
78
|
+
* passed to a consumer that accepts `impl lancedb::data::scannable::Scannable`,
|
|
79
|
+
* the consumer invokes `scan_as_stream()` to pull batches through the JS
|
|
80
|
+
* callback.
|
|
81
|
+
*/
|
|
82
|
+
export declare class NapiScannable {
|
|
83
|
+
/**
|
|
84
|
+
* Construct a new `NapiScannable`.
|
|
85
|
+
*
|
|
86
|
+
* - `schema_buf` — Arrow IPC File buffer carrying only the schema (no batches).
|
|
87
|
+
* - `num_rows` — optional row count hint; not validated against the stream.
|
|
88
|
+
* - `rescannable` — whether `get_next_batch` may be re-driven after the
|
|
89
|
+
* scan completes.
|
|
90
|
+
* - `get_next_batch` -- JS callback that yields the next batch as an Arrow
|
|
91
|
+
* IPC Stream message wrapped in a `Buffer`, or `null` at EOF. The
|
|
92
|
+
* `isStart` argument is `true` on the first call of each new scan;
|
|
93
|
+
* JS uses it to discard any cached iterator before pulling.
|
|
94
|
+
*/
|
|
95
|
+
constructor(schemaBuf: Buffer, numRows: number | undefined | null, rescannable: boolean, getNextBatch: (arg: boolean) => Promise<Buffer | undefined | null>)
|
|
96
|
+
}
|
|
97
|
+
|
|
58
98
|
/** A builder used to create and run a merge insert operation */
|
|
59
99
|
export declare class NativeMergeInsertBuilder {
|
|
60
100
|
whenMatchedUpdateAll(condition?: string | undefined | null): NativeMergeInsertBuilder
|
|
@@ -94,6 +134,7 @@ export declare class Query {
|
|
|
94
134
|
nearestToRaw(data: Uint8Array, dtype: string): VectorQuery
|
|
95
135
|
fastSearch(): void
|
|
96
136
|
withRowId(): void
|
|
137
|
+
orderBy(ordering?: Array<ColumnOrdering> | undefined | null): void
|
|
97
138
|
outputSchema(): Promise<Buffer>
|
|
98
139
|
execute(maxBatchLength?: number | undefined | null, timeoutMs?: number | undefined | null): Promise<RecordBatchIterator>
|
|
99
140
|
explainPlan(verbose: boolean): Promise<string>
|
|
@@ -154,7 +195,7 @@ export declare class Table {
|
|
|
154
195
|
close(): void
|
|
155
196
|
/** Return Schema as empty Arrow IPC file. */
|
|
156
197
|
schema(): Promise<Buffer>
|
|
157
|
-
add(buf: Buffer, mode: string): Promise<AddResult>
|
|
198
|
+
add(buf: Buffer, mode: string, progressCallback?: (progress: WriteProgressInfo) => void): Promise<AddResult>
|
|
158
199
|
countRows(filter?: string | undefined | null): Promise<number>
|
|
159
200
|
delete(predicate: string): Promise<DeleteResult>
|
|
160
201
|
createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null, waitTimeoutS?: number | undefined | null, name?: string | undefined | null, train?: boolean | undefined | null): Promise<void>
|
|
@@ -174,6 +215,9 @@ export declare class Table {
|
|
|
174
215
|
addColumnsWithSchema(schemaBuf: Buffer): Promise<AddColumnsResult>
|
|
175
216
|
alterColumns(alterations: Array<ColumnAlteration>): Promise<AlterColumnsResult>
|
|
176
217
|
dropColumns(columns: Array<string>): Promise<DropColumnsResult>
|
|
218
|
+
setUnenforcedPrimaryKey(columns: Array<string>): Promise<void>
|
|
219
|
+
setLsmWriteSpec(spec: LsmWriteSpec): Promise<void>
|
|
220
|
+
unsetLsmWriteSpec(): Promise<void>
|
|
177
221
|
version(): Promise<number>
|
|
178
222
|
checkout(version: number): Promise<void>
|
|
179
223
|
checkoutTag(tag: string): Promise<void>
|
|
@@ -234,6 +278,7 @@ export declare class VectorQuery {
|
|
|
234
278
|
fastSearch(): void
|
|
235
279
|
withRowId(): void
|
|
236
280
|
rerank(rerankHybrid: (arg: RerankHybridCallbackArgs) => Promise<Buffer>): void
|
|
281
|
+
orderBy(ordering?: Array<ColumnOrdering> | undefined | null): void
|
|
237
282
|
outputSchema(): Promise<Buffer>
|
|
238
283
|
execute(maxBatchLength?: number | undefined | null, timeoutMs?: number | undefined | null): Promise<RecordBatchIterator>
|
|
239
284
|
explainPlan(verbose: boolean): Promise<string>
|
|
@@ -316,6 +361,12 @@ export interface ColumnAlteration {
|
|
|
316
361
|
nullable?: boolean
|
|
317
362
|
}
|
|
318
363
|
|
|
364
|
+
export interface ColumnOrdering {
|
|
365
|
+
ascending: boolean
|
|
366
|
+
nullsFirst: boolean
|
|
367
|
+
columnName: string
|
|
368
|
+
}
|
|
369
|
+
|
|
319
370
|
/** Statistics about a compaction operation. */
|
|
320
371
|
export interface CompactionStats {
|
|
321
372
|
/** The number of fragments removed */
|
|
@@ -383,15 +434,53 @@ export interface ConnectionOptions {
|
|
|
383
434
|
hostOverride?: string
|
|
384
435
|
}
|
|
385
436
|
|
|
437
|
+
export interface ConnectNamespaceOptions {
|
|
438
|
+
/**
|
|
439
|
+
* The interval, in seconds, at which to check for updates to the table
|
|
440
|
+
* from other processes. If None, then consistency is not checked. For
|
|
441
|
+
* performance reasons, this is the default. For strong consistency, set
|
|
442
|
+
* this to zero seconds. Then every read will check for updates from other
|
|
443
|
+
* processes. As a compromise, you can set this to a non-zero value for
|
|
444
|
+
* eventual consistency.
|
|
445
|
+
*/
|
|
446
|
+
readConsistencyInterval?: number
|
|
447
|
+
/**
|
|
448
|
+
* Configuration for object storage. The available options are described
|
|
449
|
+
* at https://docs.lancedb.com/storage/
|
|
450
|
+
*/
|
|
451
|
+
storageOptions?: Record<string, string>
|
|
452
|
+
/** Extra properties for the backing namespace client. */
|
|
453
|
+
namespaceClientProperties?: Record<string, string>
|
|
454
|
+
/**
|
|
455
|
+
* The session to use for this connection. Holds shared caches and other
|
|
456
|
+
* session-specific state.
|
|
457
|
+
*/
|
|
458
|
+
session?: Session
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export interface CreateNamespaceResponse {
|
|
462
|
+
properties?: Record<string, string>
|
|
463
|
+
transactionId?: string
|
|
464
|
+
}
|
|
465
|
+
|
|
386
466
|
export interface DeleteResult {
|
|
387
467
|
numDeletedRows: number
|
|
388
468
|
version: number
|
|
389
469
|
}
|
|
390
470
|
|
|
471
|
+
export interface DescribeNamespaceResponse {
|
|
472
|
+
properties?: Record<string, string>
|
|
473
|
+
}
|
|
474
|
+
|
|
391
475
|
export interface DropColumnsResult {
|
|
392
476
|
version: number
|
|
393
477
|
}
|
|
394
478
|
|
|
479
|
+
export interface DropNamespaceResponse {
|
|
480
|
+
properties?: Record<string, string>
|
|
481
|
+
transactionId?: Array<string>
|
|
482
|
+
}
|
|
483
|
+
|
|
395
484
|
export interface FragmentStatistics {
|
|
396
485
|
/** The number of fragments in the table */
|
|
397
486
|
numFragments: number
|
|
@@ -455,6 +544,32 @@ export interface IndexStatistics {
|
|
|
455
544
|
loss?: number
|
|
456
545
|
}
|
|
457
546
|
|
|
547
|
+
export interface ListNamespacesResponse {
|
|
548
|
+
namespaces: Array<string>
|
|
549
|
+
pageToken?: string
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Specification selecting Lance's MemWAL LSM-style write path for
|
|
554
|
+
* `mergeInsert`.
|
|
555
|
+
*
|
|
556
|
+
* `specType` must be `"bucket"`, `"identity"`, or `"unsharded"`. For
|
|
557
|
+
* `"bucket"`, `column` and `numBuckets` are required; for `"identity"`,
|
|
558
|
+
* `column` is required.
|
|
559
|
+
*/
|
|
560
|
+
export interface LsmWriteSpec {
|
|
561
|
+
/** One of `"bucket"`, `"identity"`, or `"unsharded"`. */
|
|
562
|
+
specType: string
|
|
563
|
+
/** Bucket and identity variants: the sharding column. */
|
|
564
|
+
column?: string
|
|
565
|
+
/** Bucket variant: the number of buckets, in `[1, 1024]`. */
|
|
566
|
+
numBuckets?: number
|
|
567
|
+
/** Names of indexes the MemWAL should keep up to date during writes. */
|
|
568
|
+
maintainedIndexes?: Array<string>
|
|
569
|
+
/** Default `ShardWriter` configuration recorded in the MemWAL index. */
|
|
570
|
+
writerConfigDefaults?: Record<string, string>
|
|
571
|
+
}
|
|
572
|
+
|
|
458
573
|
export interface MergeResult {
|
|
459
574
|
version: number
|
|
460
575
|
numInsertedRows: number
|
|
@@ -637,3 +752,27 @@ export interface Version {
|
|
|
637
752
|
timestamp: number
|
|
638
753
|
metadata: Record<string, string>
|
|
639
754
|
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Progress snapshot for a write operation, delivered to the JS callback
|
|
758
|
+
* passed to `Table.add`.
|
|
759
|
+
*/
|
|
760
|
+
export interface WriteProgressInfo {
|
|
761
|
+
/** Number of rows written so far. */
|
|
762
|
+
outputRows: number
|
|
763
|
+
/** Number of bytes written so far. */
|
|
764
|
+
outputBytes: number
|
|
765
|
+
/**
|
|
766
|
+
* Total rows expected, if the input source reports it.
|
|
767
|
+
* Always set on the final callback (where `done` is `true`).
|
|
768
|
+
*/
|
|
769
|
+
totalRows?: number
|
|
770
|
+
/** Wall-clock seconds since monitoring started. */
|
|
771
|
+
elapsedSeconds: number
|
|
772
|
+
/** Number of parallel write tasks currently in flight. */
|
|
773
|
+
activeTasks: number
|
|
774
|
+
/** Total number of parallel write tasks (the write parallelism). */
|
|
775
|
+
totalTasks: number
|
|
776
|
+
/** `true` for the final callback; `false` otherwise. */
|
|
777
|
+
done: boolean
|
|
778
|
+
}
|
package/dist/native.js
CHANGED
|
@@ -76,8 +76,8 @@ function requireNative() {
|
|
|
76
76
|
try {
|
|
77
77
|
const binding = require('@lancedb/lancedb-android-arm64');
|
|
78
78
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm64/package.json').version;
|
|
79
|
-
if (bindingPackageVersion !== '0.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
79
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
80
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
81
81
|
}
|
|
82
82
|
return binding;
|
|
83
83
|
}
|
|
@@ -95,8 +95,8 @@ function requireNative() {
|
|
|
95
95
|
try {
|
|
96
96
|
const binding = require('@lancedb/lancedb-android-arm-eabi');
|
|
97
97
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm-eabi/package.json').version;
|
|
98
|
-
if (bindingPackageVersion !== '0.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
98
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
99
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
100
100
|
}
|
|
101
101
|
return binding;
|
|
102
102
|
}
|
|
@@ -120,8 +120,8 @@ function requireNative() {
|
|
|
120
120
|
try {
|
|
121
121
|
const binding = require('@lancedb/lancedb-win32-x64-gnu');
|
|
122
122
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-gnu/package.json').version;
|
|
123
|
-
if (bindingPackageVersion !== '0.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
123
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
124
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
125
125
|
}
|
|
126
126
|
return binding;
|
|
127
127
|
}
|
|
@@ -139,8 +139,8 @@ function requireNative() {
|
|
|
139
139
|
try {
|
|
140
140
|
const binding = require('@lancedb/lancedb-win32-x64-msvc');
|
|
141
141
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-msvc/package.json').version;
|
|
142
|
-
if (bindingPackageVersion !== '0.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
142
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
143
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
144
144
|
}
|
|
145
145
|
return binding;
|
|
146
146
|
}
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('@lancedb/lancedb-win32-ia32-msvc');
|
|
161
161
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-ia32-msvc/package.json').version;
|
|
162
|
-
if (bindingPackageVersion !== '0.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
162
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
163
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
164
164
|
}
|
|
165
165
|
return binding;
|
|
166
166
|
}
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@lancedb/lancedb-win32-arm64-msvc');
|
|
180
180
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-arm64-msvc/package.json').version;
|
|
181
|
-
if (bindingPackageVersion !== '0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
183
183
|
}
|
|
184
184
|
return binding;
|
|
185
185
|
}
|
|
@@ -201,8 +201,8 @@ function requireNative() {
|
|
|
201
201
|
try {
|
|
202
202
|
const binding = require('@lancedb/lancedb-darwin-universal');
|
|
203
203
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-universal/package.json').version;
|
|
204
|
-
if (bindingPackageVersion !== '0.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
204
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
205
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
206
206
|
}
|
|
207
207
|
return binding;
|
|
208
208
|
}
|
|
@@ -219,8 +219,8 @@ function requireNative() {
|
|
|
219
219
|
try {
|
|
220
220
|
const binding = require('@lancedb/lancedb-darwin-x64');
|
|
221
221
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-x64/package.json').version;
|
|
222
|
-
if (bindingPackageVersion !== '0.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
222
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
224
224
|
}
|
|
225
225
|
return binding;
|
|
226
226
|
}
|
|
@@ -238,8 +238,8 @@ function requireNative() {
|
|
|
238
238
|
try {
|
|
239
239
|
const binding = require('@lancedb/lancedb-darwin-arm64');
|
|
240
240
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-arm64/package.json').version;
|
|
241
|
-
if (bindingPackageVersion !== '0.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
241
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
243
243
|
}
|
|
244
244
|
return binding;
|
|
245
245
|
}
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('@lancedb/lancedb-freebsd-x64');
|
|
264
264
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-x64/package.json').version;
|
|
265
|
-
if (bindingPackageVersion !== '0.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
265
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
266
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
267
267
|
}
|
|
268
268
|
return binding;
|
|
269
269
|
}
|
|
@@ -281,8 +281,8 @@ function requireNative() {
|
|
|
281
281
|
try {
|
|
282
282
|
const binding = require('@lancedb/lancedb-freebsd-arm64');
|
|
283
283
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-arm64/package.json').version;
|
|
284
|
-
if (bindingPackageVersion !== '0.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
284
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
285
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
286
286
|
}
|
|
287
287
|
return binding;
|
|
288
288
|
}
|
|
@@ -306,8 +306,8 @@ function requireNative() {
|
|
|
306
306
|
try {
|
|
307
307
|
const binding = require('@lancedb/lancedb-linux-x64-musl');
|
|
308
308
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-musl/package.json').version;
|
|
309
|
-
if (bindingPackageVersion !== '0.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
309
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
311
311
|
}
|
|
312
312
|
return binding;
|
|
313
313
|
}
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@lancedb/lancedb-linux-x64-gnu');
|
|
327
327
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-gnu/package.json').version;
|
|
328
|
-
if (bindingPackageVersion !== '0.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
328
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
330
330
|
}
|
|
331
331
|
return binding;
|
|
332
332
|
}
|
|
@@ -346,8 +346,8 @@ function requireNative() {
|
|
|
346
346
|
try {
|
|
347
347
|
const binding = require('@lancedb/lancedb-linux-arm64-musl');
|
|
348
348
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-musl/package.json').version;
|
|
349
|
-
if (bindingPackageVersion !== '0.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
349
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
350
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
}
|
|
352
352
|
return binding;
|
|
353
353
|
}
|
|
@@ -365,8 +365,8 @@ function requireNative() {
|
|
|
365
365
|
try {
|
|
366
366
|
const binding = require('@lancedb/lancedb-linux-arm64-gnu');
|
|
367
367
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-gnu/package.json').version;
|
|
368
|
-
if (bindingPackageVersion !== '0.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
368
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
369
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
370
370
|
}
|
|
371
371
|
return binding;
|
|
372
372
|
}
|
|
@@ -386,8 +386,8 @@ function requireNative() {
|
|
|
386
386
|
try {
|
|
387
387
|
const binding = require('@lancedb/lancedb-linux-arm-musleabihf');
|
|
388
388
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-musleabihf/package.json').version;
|
|
389
|
-
if (bindingPackageVersion !== '0.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
389
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
390
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
391
391
|
}
|
|
392
392
|
return binding;
|
|
393
393
|
}
|
|
@@ -405,8 +405,8 @@ function requireNative() {
|
|
|
405
405
|
try {
|
|
406
406
|
const binding = require('@lancedb/lancedb-linux-arm-gnueabihf');
|
|
407
407
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-gnueabihf/package.json').version;
|
|
408
|
-
if (bindingPackageVersion !== '0.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
408
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
409
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
410
410
|
}
|
|
411
411
|
return binding;
|
|
412
412
|
}
|
|
@@ -426,8 +426,8 @@ function requireNative() {
|
|
|
426
426
|
try {
|
|
427
427
|
const binding = require('@lancedb/lancedb-linux-loong64-musl');
|
|
428
428
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-musl/package.json').version;
|
|
429
|
-
if (bindingPackageVersion !== '0.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
429
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
430
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
431
431
|
}
|
|
432
432
|
return binding;
|
|
433
433
|
}
|
|
@@ -445,8 +445,8 @@ function requireNative() {
|
|
|
445
445
|
try {
|
|
446
446
|
const binding = require('@lancedb/lancedb-linux-loong64-gnu');
|
|
447
447
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-gnu/package.json').version;
|
|
448
|
-
if (bindingPackageVersion !== '0.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
448
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
449
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
450
450
|
}
|
|
451
451
|
return binding;
|
|
452
452
|
}
|
|
@@ -466,8 +466,8 @@ function requireNative() {
|
|
|
466
466
|
try {
|
|
467
467
|
const binding = require('@lancedb/lancedb-linux-riscv64-musl');
|
|
468
468
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-musl/package.json').version;
|
|
469
|
-
if (bindingPackageVersion !== '0.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
469
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
470
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
471
471
|
}
|
|
472
472
|
return binding;
|
|
473
473
|
}
|
|
@@ -485,8 +485,8 @@ function requireNative() {
|
|
|
485
485
|
try {
|
|
486
486
|
const binding = require('@lancedb/lancedb-linux-riscv64-gnu');
|
|
487
487
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-gnu/package.json').version;
|
|
488
|
-
if (bindingPackageVersion !== '0.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
488
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
489
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
490
490
|
}
|
|
491
491
|
return binding;
|
|
492
492
|
}
|
|
@@ -505,8 +505,8 @@ function requireNative() {
|
|
|
505
505
|
try {
|
|
506
506
|
const binding = require('@lancedb/lancedb-linux-ppc64-gnu');
|
|
507
507
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-ppc64-gnu/package.json').version;
|
|
508
|
-
if (bindingPackageVersion !== '0.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
508
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
509
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
510
510
|
}
|
|
511
511
|
return binding;
|
|
512
512
|
}
|
|
@@ -524,8 +524,8 @@ function requireNative() {
|
|
|
524
524
|
try {
|
|
525
525
|
const binding = require('@lancedb/lancedb-linux-s390x-gnu');
|
|
526
526
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-s390x-gnu/package.json').version;
|
|
527
|
-
if (bindingPackageVersion !== '0.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
527
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
528
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
529
529
|
}
|
|
530
530
|
return binding;
|
|
531
531
|
}
|
|
@@ -548,8 +548,8 @@ function requireNative() {
|
|
|
548
548
|
try {
|
|
549
549
|
const binding = require('@lancedb/lancedb-openharmony-arm64');
|
|
550
550
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm64/package.json').version;
|
|
551
|
-
if (bindingPackageVersion !== '0.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
551
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
552
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
553
553
|
}
|
|
554
554
|
return binding;
|
|
555
555
|
}
|
|
@@ -567,8 +567,8 @@ function requireNative() {
|
|
|
567
567
|
try {
|
|
568
568
|
const binding = require('@lancedb/lancedb-openharmony-x64');
|
|
569
569
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-x64/package.json').version;
|
|
570
|
-
if (bindingPackageVersion !== '0.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
570
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
571
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
572
572
|
}
|
|
573
573
|
return binding;
|
|
574
574
|
}
|
|
@@ -586,8 +586,8 @@ function requireNative() {
|
|
|
586
586
|
try {
|
|
587
587
|
const binding = require('@lancedb/lancedb-openharmony-arm');
|
|
588
588
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm/package.json').version;
|
|
589
|
-
if (bindingPackageVersion !== '0.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
589
|
+
if (bindingPackageVersion !== '0.30.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
590
|
+
throw new Error(`Native binding package version mismatch, expected 0.30.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
|
@@ -657,6 +657,7 @@ module.exports.Connection = nativeBinding.Connection;
|
|
|
657
657
|
module.exports.Index = nativeBinding.Index;
|
|
658
658
|
module.exports.JsFullTextQuery = nativeBinding.JsFullTextQuery;
|
|
659
659
|
module.exports.JsHeaderProvider = nativeBinding.JsHeaderProvider;
|
|
660
|
+
module.exports.NapiScannable = nativeBinding.NapiScannable;
|
|
660
661
|
module.exports.NativeMergeInsertBuilder = nativeBinding.NativeMergeInsertBuilder;
|
|
661
662
|
module.exports.PermutationBuilder = nativeBinding.PermutationBuilder;
|
|
662
663
|
module.exports.Query = nativeBinding.Query;
|
package/dist/query.d.ts
CHANGED
|
@@ -19,6 +19,11 @@ export interface QueryExecutionOptions {
|
|
|
19
19
|
*/
|
|
20
20
|
timeoutMs?: number;
|
|
21
21
|
}
|
|
22
|
+
export interface ColumnOrdering {
|
|
23
|
+
columnName: string;
|
|
24
|
+
ascending?: boolean;
|
|
25
|
+
nullsFirst?: boolean;
|
|
26
|
+
}
|
|
22
27
|
/**
|
|
23
28
|
* Options that control the behavior of a full text search
|
|
24
29
|
*/
|
|
@@ -201,6 +206,11 @@ export declare class StandardQueryBase<NativeQueryType extends NativeQuery | Nat
|
|
|
201
206
|
* This is useful for pagination.
|
|
202
207
|
*/
|
|
203
208
|
offset(offset: number): this;
|
|
209
|
+
/**
|
|
210
|
+
* Sort the results by the specified column(s).
|
|
211
|
+
* @returns This query builder.
|
|
212
|
+
*/
|
|
213
|
+
orderBy(ordering: ColumnOrdering | ColumnOrdering[]): this;
|
|
204
214
|
/**
|
|
205
215
|
* Skip searching un-indexed data. This can make search faster, but will miss
|
|
206
216
|
* any data that is not yet indexed.
|
package/dist/query.js
CHANGED
|
@@ -332,6 +332,20 @@ class StandardQueryBase extends QueryBase {
|
|
|
332
332
|
this.doCall((inner) => inner.offset(offset));
|
|
333
333
|
return this;
|
|
334
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Sort the results by the specified column(s).
|
|
337
|
+
* @returns This query builder.
|
|
338
|
+
*/
|
|
339
|
+
orderBy(ordering) {
|
|
340
|
+
const orderings = Array.isArray(ordering) ? ordering : [ordering];
|
|
341
|
+
const normalized = orderings.map((o) => ({
|
|
342
|
+
columnName: o.columnName,
|
|
343
|
+
ascending: o.ascending ?? true,
|
|
344
|
+
nullsFirst: o.nullsFirst ?? false,
|
|
345
|
+
}));
|
|
346
|
+
this.doCall((inner) => inner.orderBy(normalized));
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
335
349
|
/**
|
|
336
350
|
* Skip searching un-indexed data. This can make search faster, but will miss
|
|
337
351
|
* any data that is not yet indexed.
|