@lancedb/lancedb 0.39.0-beta.0 → 0.39.0-beta.3
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/dist/connection.d.ts +10 -22
- package/dist/connection.js +4 -14
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/job.d.ts +93 -0
- package/dist/job.js +163 -0
- package/dist/native.d.ts +40 -33
- package/dist/native.js +52 -52
- package/dist/table.d.ts +12 -1
- package/dist/table.js +3 -2
- package/package.json +10 -10
- package/pnpm-workspace.yaml +38 -0
package/dist/connection.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Data, SchemaLike, TableLike } from "./arrow";
|
|
2
|
-
import { Table as ArrowTable } from "./arrow";
|
|
3
2
|
import { EmbeddingFunctionConfig } from "./embedding/registry";
|
|
3
|
+
import { Job } from "./job";
|
|
4
4
|
import { MaterializedView, MaterializedViewSelect } from "./materialized_view";
|
|
5
5
|
import { Connection as LanceDbConnection } from "./native";
|
|
6
|
-
import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse,
|
|
6
|
+
import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, JobInfo, ListNamespacesResponse, ListTablesResponse } from "./native";
|
|
7
7
|
export type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, ListNamespacesResponse, ListTablesResponse, };
|
|
8
8
|
import { Table } from "./table";
|
|
9
9
|
export interface CreateTableOptions {
|
|
@@ -428,21 +428,17 @@ export declare abstract class Connection {
|
|
|
428
428
|
*/
|
|
429
429
|
abstract renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
|
|
430
430
|
/**
|
|
431
|
-
*
|
|
431
|
+
* Open a server-side job by id, returning a handle with its record already
|
|
432
|
+
* populated. Rejects when the server has no such job, the way
|
|
433
|
+
* {@link Connection.openTable} does for a missing table.
|
|
432
434
|
*
|
|
433
|
-
* The
|
|
434
|
-
*
|
|
435
|
-
*
|
|
435
|
+
* The returned {@link Job} answers for its own state, specification,
|
|
436
|
+
* result, failure and event history, so there is no separate
|
|
437
|
+
* connection-level call for any of them.
|
|
436
438
|
*/
|
|
437
|
-
abstract
|
|
439
|
+
abstract openJob(jobId: string): Promise<Job>;
|
|
438
440
|
/** List server-side jobs across the database's tables. */
|
|
439
441
|
abstract listJobs(): Promise<JobInfo[]>;
|
|
440
|
-
/**
|
|
441
|
-
* Describe a single server-side job by id.
|
|
442
|
-
*
|
|
443
|
-
* Resolves to `null` when the server has no such job.
|
|
444
|
-
*/
|
|
445
|
-
abstract getJob(jobId: string): Promise<JobDescription | null>;
|
|
446
442
|
/**
|
|
447
443
|
* Request cancellation of a server-side job by id.
|
|
448
444
|
*
|
|
@@ -450,12 +446,6 @@ export declare abstract class Connection {
|
|
|
450
446
|
* such job exists. Cancelling an already-terminal job is a no-op success.
|
|
451
447
|
*/
|
|
452
448
|
abstract cancelJob(jobId: string): Promise<boolean>;
|
|
453
|
-
/**
|
|
454
|
-
* The lifecycle event history of a server-side job, as an Arrow table.
|
|
455
|
-
*
|
|
456
|
-
* Lists history across all jobs when `jobId` is omitted.
|
|
457
|
-
*/
|
|
458
|
-
abstract jobHistory(jobId?: string): Promise<ArrowTable>;
|
|
459
449
|
}
|
|
460
450
|
/** @hideconstructor */
|
|
461
451
|
export declare class LocalConnection extends Connection {
|
|
@@ -496,11 +486,9 @@ export declare class LocalConnection extends Connection {
|
|
|
496
486
|
createNamespace(namespacePath: string[], options?: Partial<CreateNamespaceOptions>): Promise<CreateNamespaceResponse>;
|
|
497
487
|
dropNamespace(namespacePath: string[], options?: Partial<DropNamespaceOptions>): Promise<DropNamespaceResponse>;
|
|
498
488
|
renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
|
|
499
|
-
|
|
489
|
+
openJob(jobId: string): Promise<Job>;
|
|
500
490
|
listJobs(): Promise<JobInfo[]>;
|
|
501
|
-
getJob(jobId: string): Promise<JobDescription | null>;
|
|
502
491
|
cancelJob(jobId: string): Promise<boolean>;
|
|
503
|
-
jobHistory(jobId?: string): Promise<ArrowTable>;
|
|
504
492
|
}
|
|
505
493
|
/**
|
|
506
494
|
* Takes storage options and makes all the keys snake case.
|
package/dist/connection.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.LocalConnection = exports.Connection = void 0;
|
|
6
6
|
exports.cleanseStorageOptions = cleanseStorageOptions;
|
|
7
|
-
const apache_arrow_1 = require("apache-arrow");
|
|
8
7
|
const arrow_1 = require("./arrow");
|
|
9
8
|
const arrow_2 = require("./arrow");
|
|
10
9
|
const registry_1 = require("./embedding/registry");
|
|
10
|
+
const job_1 = require("./job");
|
|
11
11
|
const materialized_view_1 = require("./materialized_view");
|
|
12
12
|
const sanitize_1 = require("./sanitize");
|
|
13
13
|
const table_1 = require("./table");
|
|
@@ -198,7 +198,7 @@ class LocalConnection extends Connection {
|
|
|
198
198
|
return this.inner.dropTable(name, namespacePath ?? []);
|
|
199
199
|
}
|
|
200
200
|
async dropTableAsync(name, namespacePath) {
|
|
201
|
-
return this.inner.dropTableAsync(name, namespacePath ?? []);
|
|
201
|
+
return new job_1.Job(await this.inner.dropTableAsync(name, namespacePath ?? []));
|
|
202
202
|
}
|
|
203
203
|
async dropAllTables(namespacePath) {
|
|
204
204
|
return this.inner.dropAllTables(namespacePath ?? []);
|
|
@@ -218,25 +218,15 @@ class LocalConnection extends Connection {
|
|
|
218
218
|
async renameTable(currentName, newName, options) {
|
|
219
219
|
return this.inner.renameTable(currentName, newName, options?.namespacePath ?? [], options?.newNamespacePath);
|
|
220
220
|
}
|
|
221
|
-
|
|
222
|
-
return this.inner.
|
|
221
|
+
async openJob(jobId) {
|
|
222
|
+
return new job_1.Job(await this.inner.openJob(jobId));
|
|
223
223
|
}
|
|
224
224
|
async listJobs() {
|
|
225
225
|
return this.inner.listJobs();
|
|
226
226
|
}
|
|
227
|
-
async getJob(jobId) {
|
|
228
|
-
return this.inner.getJob(jobId);
|
|
229
|
-
}
|
|
230
227
|
async cancelJob(jobId) {
|
|
231
228
|
return this.inner.cancelJob(jobId);
|
|
232
229
|
}
|
|
233
|
-
async jobHistory(jobId) {
|
|
234
|
-
const buf = await this.inner.jobHistory(jobId);
|
|
235
|
-
if (buf.length === 0) {
|
|
236
|
-
return new arrow_2.Table();
|
|
237
|
-
}
|
|
238
|
-
return (0, apache_arrow_1.tableFromIPC)(buf);
|
|
239
|
-
}
|
|
240
230
|
}
|
|
241
231
|
exports.LocalConnection = LocalConnection;
|
|
242
232
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export { instrumentLanceDbMetrics } from "./otel";
|
|
|
9
9
|
export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, RefreshColumnResult, RefreshMaterializedViewResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
|
|
10
10
|
export { makeArrowTable, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
|
|
11
11
|
export { Connection, CreateTableOptions, TableNamesOptions, ListTablesOptions, OpenTableOptions, ListNamespacesOptions, CreateNamespaceOptions, DropNamespaceOptions, ListNamespacesResponse, ListTablesResponse, CreateNamespaceResponse, DropNamespaceResponse, DescribeNamespaceResponse, RenameTableOptions, } from "./connection";
|
|
12
|
-
export {
|
|
12
|
+
export { JobFailureInfo, JobInfo, Session } from "./native.js";
|
|
13
|
+
export { Job, JobEventsOptions } from "./job";
|
|
13
14
|
export { AutoQuery, ExecutableQuery, Query, QueryBase, VectorQuery, TakeQuery, AnalyzePlanDistributedMetrics, QueryExecutionOptions, ColumnOrdering, FullTextSearchOptions, RecordBatchIterator, FullTextQuery, MatchQuery, PhraseQuery, BoostQuery, MultiMatchQuery, BooleanQuery, FullTextQueryType, Operator, Occur, } from "./query";
|
|
14
15
|
export { Index, IndexOptions, IvfPqOptions, IvfRqOptions, IvfFlatOptions, HnswPqOptions, HnswSqOptions, FtsOptions, BaseTokenizer, } from "./indices";
|
|
15
16
|
export { Table, Branches, BranchColumnSummary, BranchColumnChange, BranchIndexSummary, BranchRowCountSummary, CherryPickError, BranchDiff, CherryPickPreview, CherryPickResult, AddDataOptions, UpdateOptions, OptimizeOptions, Version, WriteProgress, FtsToken, TokenizeTableOptions, LsmWriteSpec, LsmStats, BucketStats, GenerationStats, MemtableStats, ColumnAlteration, FieldMetadataUpdate, } from "./table";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.packBits = exports.rerankers = exports.Scannable = exports.PermutationBuilder = exports.permutationBuilder = exports.embedding = exports.MergeInsertBuilder = exports.OAuthFlowType = exports.OAuthHeaderProvider = exports.StaticHeaderProvider = exports.HeaderProvider = exports.Branches = exports.Table = exports.Index = exports.Occur = exports.Operator = exports.FullTextQueryType = exports.BooleanQuery = exports.MultiMatchQuery = exports.BoostQuery = exports.PhraseQuery = exports.MatchQuery = exports.RecordBatchIterator = exports.TakeQuery = exports.VectorQuery = exports.QueryBase = exports.Query = exports.AutoQuery = exports.
|
|
5
|
+
exports.packBits = exports.rerankers = exports.Scannable = exports.PermutationBuilder = exports.permutationBuilder = exports.embedding = exports.MergeInsertBuilder = exports.OAuthFlowType = exports.OAuthHeaderProvider = exports.StaticHeaderProvider = exports.HeaderProvider = exports.Branches = exports.Table = exports.Index = exports.Occur = exports.Operator = exports.FullTextQueryType = exports.BooleanQuery = exports.MultiMatchQuery = exports.BoostQuery = exports.PhraseQuery = exports.MatchQuery = exports.RecordBatchIterator = exports.TakeQuery = exports.VectorQuery = exports.QueryBase = exports.Query = exports.AutoQuery = exports.Job = exports.Session = exports.Connection = exports.VectorColumnOptions = exports.MakeArrowTableOptions = exports.makeArrowTable = exports.BranchContents = exports.TagContents = exports.Tags = exports.instrumentLanceDbMetrics = exports.NativeJsHeaderProvider = exports.MaterializedView = void 0;
|
|
6
6
|
exports.tokenize = tokenize;
|
|
7
7
|
exports.connect = connect;
|
|
8
8
|
exports.connectNamespace = connectNamespace;
|
|
@@ -29,8 +29,9 @@ Object.defineProperty(exports, "VectorColumnOptions", { enumerable: true, get: f
|
|
|
29
29
|
var connection_2 = require("./connection");
|
|
30
30
|
Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_2.Connection; } });
|
|
31
31
|
var native_js_4 = require("./native.js");
|
|
32
|
-
Object.defineProperty(exports, "Job", { enumerable: true, get: function () { return native_js_4.Job; } });
|
|
33
32
|
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return native_js_4.Session; } });
|
|
33
|
+
var job_1 = require("./job");
|
|
34
|
+
Object.defineProperty(exports, "Job", { enumerable: true, get: function () { return job_1.Job; } });
|
|
34
35
|
var query_1 = require("./query");
|
|
35
36
|
Object.defineProperty(exports, "AutoQuery", { enumerable: true, get: function () { return query_1.AutoQuery; } });
|
|
36
37
|
Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return query_1.Query; } });
|
package/dist/job.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Table as ArrowTable } from "apache-arrow";
|
|
2
|
+
import { JobFailureInfo, Job as NativeJob } from "./native";
|
|
3
|
+
/** Which of a job's events {@link Job.events} returns. */
|
|
4
|
+
export interface JobEventsOptions {
|
|
5
|
+
/** Maximum event rows to return, up to the server maximum of 10,000. */
|
|
6
|
+
limit?: number;
|
|
7
|
+
/** SQL-like filter over the event columns. */
|
|
8
|
+
filter?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A handle to an operation that may still be running.
|
|
12
|
+
*
|
|
13
|
+
* The operation may already be complete when the handle is created.
|
|
14
|
+
*
|
|
15
|
+
* The detail getters read what the handle last observed. Submitting an
|
|
16
|
+
* operation returns only a job id, so populating them eagerly would cost an
|
|
17
|
+
* extra round trip on every call:
|
|
18
|
+
*
|
|
19
|
+
* - {@link Job.refresh} and {@link Job.status} fetch the whole record.
|
|
20
|
+
* - {@link Job.wait} records the terminal state it establishes, but not the
|
|
21
|
+
* rest of the record.
|
|
22
|
+
* - Everything is null until one of those runs.
|
|
23
|
+
*
|
|
24
|
+
* @hideconstructor
|
|
25
|
+
*/
|
|
26
|
+
export declare class Job {
|
|
27
|
+
private readonly inner;
|
|
28
|
+
constructor(inner: NativeJob);
|
|
29
|
+
/**
|
|
30
|
+
* Identifies the operation on the server that is running it.
|
|
31
|
+
*
|
|
32
|
+
* Operations that run in this process have no server id. The value is
|
|
33
|
+
* opaque: parsing it or storing it to resume the job later is not supported.
|
|
34
|
+
*/
|
|
35
|
+
get id(): string | null;
|
|
36
|
+
/** The last observed lifecycle state, without contacting the backend. */
|
|
37
|
+
get state(): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* The job's type, as the server names it. Null for an in-process job, which
|
|
40
|
+
* has no server-side record.
|
|
41
|
+
*/
|
|
42
|
+
get jobType(): string | null;
|
|
43
|
+
/** When the job was created, in milliseconds since the epoch. */
|
|
44
|
+
get creationMs(): number | null;
|
|
45
|
+
/** The job-type-specific specification it was submitted with. */
|
|
46
|
+
get spec(): any | null;
|
|
47
|
+
/**
|
|
48
|
+
* The job-type-specific terminal result. Null until the job succeeds, so a
|
|
49
|
+
* job that never terminates reports its progress through {@link Job.events}
|
|
50
|
+
* instead.
|
|
51
|
+
*/
|
|
52
|
+
get result(): any | null;
|
|
53
|
+
/** Why the job failed, when it failed and the server reports a reason. */
|
|
54
|
+
get failure(): JobFailureInfo | null;
|
|
55
|
+
/**
|
|
56
|
+
* The operation's current lifecycle state: "running", "finished", "failed",
|
|
57
|
+
* or "cancelled".
|
|
58
|
+
*
|
|
59
|
+
* A point snapshot; unlike {@link Job.wait} it does not block or reject on a
|
|
60
|
+
* terminal failure state. Also refreshes the getters above.
|
|
61
|
+
*/
|
|
62
|
+
status(): Promise<string>;
|
|
63
|
+
/** Wait until the operation reaches a terminal state. */
|
|
64
|
+
wait(): Promise<void>;
|
|
65
|
+
/** Request cancellation. Cancelling a finished operation is a no-op. */
|
|
66
|
+
cancel(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Ask the backend for this job's current state, and for a server-side job
|
|
69
|
+
* its full record, then cache it for the getters above.
|
|
70
|
+
*/
|
|
71
|
+
refresh(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* This job's recorded lifecycle events.
|
|
74
|
+
*
|
|
75
|
+
* Where the getters above report a terminal result only once the job reaches
|
|
76
|
+
* one, events are written as the job runs and outlive the workers that
|
|
77
|
+
* produced them. A distributed job records a `claim`/`claim_complete` pair
|
|
78
|
+
* per unit of work, each carrying `rows_processed`, so a job that never
|
|
79
|
+
* finishes still accounts for what it did.
|
|
80
|
+
*
|
|
81
|
+
* The server caps results at 1000 rows by default and 10,000 at most, and
|
|
82
|
+
* truncates without saying so, so pass `limit` for a job that emits an event
|
|
83
|
+
* per fragment. `filter` is a SQL-like expression over the `state`,
|
|
84
|
+
* `updated_by`, `emitted_from`, `emitted_by`, and `claim_entity` columns.
|
|
85
|
+
*/
|
|
86
|
+
events(options?: JobEventsOptions): Promise<ArrowTable>;
|
|
87
|
+
/**
|
|
88
|
+
* Every field the handle currently knows, one per line, with the JSON
|
|
89
|
+
* payloads indented -- a refresh job's spec and result are the point of
|
|
90
|
+
* printing it.
|
|
91
|
+
*/
|
|
92
|
+
toString(): string;
|
|
93
|
+
}
|
package/dist/job.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Job = void 0;
|
|
6
|
+
const apache_arrow_1 = require("apache-arrow");
|
|
7
|
+
/**
|
|
8
|
+
* A handle to an operation that may still be running.
|
|
9
|
+
*
|
|
10
|
+
* The operation may already be complete when the handle is created.
|
|
11
|
+
*
|
|
12
|
+
* The detail getters read what the handle last observed. Submitting an
|
|
13
|
+
* operation returns only a job id, so populating them eagerly would cost an
|
|
14
|
+
* extra round trip on every call:
|
|
15
|
+
*
|
|
16
|
+
* - {@link Job.refresh} and {@link Job.status} fetch the whole record.
|
|
17
|
+
* - {@link Job.wait} records the terminal state it establishes, but not the
|
|
18
|
+
* rest of the record.
|
|
19
|
+
* - Everything is null until one of those runs.
|
|
20
|
+
*
|
|
21
|
+
* @hideconstructor
|
|
22
|
+
*/
|
|
23
|
+
class Job {
|
|
24
|
+
inner;
|
|
25
|
+
constructor(inner) {
|
|
26
|
+
this.inner = inner;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Identifies the operation on the server that is running it.
|
|
30
|
+
*
|
|
31
|
+
* Operations that run in this process have no server id. The value is
|
|
32
|
+
* opaque: parsing it or storing it to resume the job later is not supported.
|
|
33
|
+
*/
|
|
34
|
+
get id() {
|
|
35
|
+
return this.inner.id ?? null;
|
|
36
|
+
}
|
|
37
|
+
/** The last observed lifecycle state, without contacting the backend. */
|
|
38
|
+
get state() {
|
|
39
|
+
return this.inner.state ?? null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The job's type, as the server names it. Null for an in-process job, which
|
|
43
|
+
* has no server-side record.
|
|
44
|
+
*/
|
|
45
|
+
get jobType() {
|
|
46
|
+
return this.inner.jobType ?? null;
|
|
47
|
+
}
|
|
48
|
+
/** When the job was created, in milliseconds since the epoch. */
|
|
49
|
+
get creationMs() {
|
|
50
|
+
return this.inner.creationMs ?? null;
|
|
51
|
+
}
|
|
52
|
+
/** The job-type-specific specification it was submitted with. */
|
|
53
|
+
// biome-ignore lint/suspicious/noExplicitAny: shape varies by job type
|
|
54
|
+
get spec() {
|
|
55
|
+
return parseJson(this.inner.specJson);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The job-type-specific terminal result. Null until the job succeeds, so a
|
|
59
|
+
* job that never terminates reports its progress through {@link Job.events}
|
|
60
|
+
* instead.
|
|
61
|
+
*/
|
|
62
|
+
// biome-ignore lint/suspicious/noExplicitAny: shape varies by job type
|
|
63
|
+
get result() {
|
|
64
|
+
return parseJson(this.inner.resultJson);
|
|
65
|
+
}
|
|
66
|
+
/** Why the job failed, when it failed and the server reports a reason. */
|
|
67
|
+
get failure() {
|
|
68
|
+
return this.inner.failure ?? null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The operation's current lifecycle state: "running", "finished", "failed",
|
|
72
|
+
* or "cancelled".
|
|
73
|
+
*
|
|
74
|
+
* A point snapshot; unlike {@link Job.wait} it does not block or reject on a
|
|
75
|
+
* terminal failure state. Also refreshes the getters above.
|
|
76
|
+
*/
|
|
77
|
+
async status() {
|
|
78
|
+
return this.inner.status();
|
|
79
|
+
}
|
|
80
|
+
/** Wait until the operation reaches a terminal state. */
|
|
81
|
+
async wait() {
|
|
82
|
+
return this.inner.wait();
|
|
83
|
+
}
|
|
84
|
+
/** Request cancellation. Cancelling a finished operation is a no-op. */
|
|
85
|
+
async cancel() {
|
|
86
|
+
return this.inner.cancel();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Ask the backend for this job's current state, and for a server-side job
|
|
90
|
+
* its full record, then cache it for the getters above.
|
|
91
|
+
*/
|
|
92
|
+
async refresh() {
|
|
93
|
+
return this.inner.refresh();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* This job's recorded lifecycle events.
|
|
97
|
+
*
|
|
98
|
+
* Where the getters above report a terminal result only once the job reaches
|
|
99
|
+
* one, events are written as the job runs and outlive the workers that
|
|
100
|
+
* produced them. A distributed job records a `claim`/`claim_complete` pair
|
|
101
|
+
* per unit of work, each carrying `rows_processed`, so a job that never
|
|
102
|
+
* finishes still accounts for what it did.
|
|
103
|
+
*
|
|
104
|
+
* The server caps results at 1000 rows by default and 10,000 at most, and
|
|
105
|
+
* truncates without saying so, so pass `limit` for a job that emits an event
|
|
106
|
+
* per fragment. `filter` is a SQL-like expression over the `state`,
|
|
107
|
+
* `updated_by`, `emitted_from`, `emitted_by`, and `claim_entity` columns.
|
|
108
|
+
*/
|
|
109
|
+
async events(options) {
|
|
110
|
+
const buf = await this.inner.events(options?.limit, options?.filter);
|
|
111
|
+
if (buf.length === 0) {
|
|
112
|
+
return new apache_arrow_1.Table();
|
|
113
|
+
}
|
|
114
|
+
return (0, apache_arrow_1.tableFromIPC)(buf);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Every field the handle currently knows, one per line, with the JSON
|
|
118
|
+
* payloads indented -- a refresh job's spec and result are the point of
|
|
119
|
+
* printing it.
|
|
120
|
+
*/
|
|
121
|
+
toString() {
|
|
122
|
+
if (this.state === null) {
|
|
123
|
+
const known = this.id === null ? "" : `id=${JSON.stringify(this.id)}, `;
|
|
124
|
+
return `Job(${known}not refreshed)`;
|
|
125
|
+
}
|
|
126
|
+
const fields = [];
|
|
127
|
+
if (this.id !== null) {
|
|
128
|
+
fields.push(`id=${JSON.stringify(this.id)}`);
|
|
129
|
+
}
|
|
130
|
+
fields.push(`state=${JSON.stringify(this.state)}`);
|
|
131
|
+
if (this.jobType !== null) {
|
|
132
|
+
fields.push(`jobType=${JSON.stringify(this.jobType)}`);
|
|
133
|
+
}
|
|
134
|
+
if (this.creationMs !== null) {
|
|
135
|
+
fields.push(`creationMs=${this.creationMs}`);
|
|
136
|
+
}
|
|
137
|
+
for (const [name, value] of [
|
|
138
|
+
["spec", this.spec],
|
|
139
|
+
["result", this.result],
|
|
140
|
+
]) {
|
|
141
|
+
if (value !== null) {
|
|
142
|
+
fields.push(`${name}=${indentJson(value)}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (this.failure !== null) {
|
|
146
|
+
fields.push(`failure=${indentJson(this.failure)}`);
|
|
147
|
+
}
|
|
148
|
+
return `Job(${fields.map((field) => `\n${REPR_INDENT}${field},`).join("")}\n)`;
|
|
149
|
+
}
|
|
150
|
+
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
151
|
+
return this.toString();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.Job = Job;
|
|
155
|
+
const REPR_INDENT = " ";
|
|
156
|
+
// biome-ignore lint/suspicious/noExplicitAny: shape varies by job type
|
|
157
|
+
function indentJson(value) {
|
|
158
|
+
return JSON.stringify(value, null, 4).replace(/\n/g, `\n${REPR_INDENT}`);
|
|
159
|
+
}
|
|
160
|
+
// biome-ignore lint/suspicious/noExplicitAny: shape varies by job type
|
|
161
|
+
function parseJson(raw) {
|
|
162
|
+
return raw === null || raw === undefined ? null : JSON.parse(raw);
|
|
163
|
+
}
|
package/dist/native.d.ts
CHANGED
|
@@ -47,30 +47,21 @@ export declare class Connection {
|
|
|
47
47
|
dropTableAsync(name: string, namespacePath?: Array<string> | undefined | null): Promise<Job>
|
|
48
48
|
dropAllTables(namespacePath?: Array<string> | undefined | null): Promise<void>
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Open a server-side job by id, returning a handle with its record
|
|
51
|
+
* already populated. Rejects when the server has no such job.
|
|
51
52
|
*
|
|
52
|
-
* The handle
|
|
53
|
-
*
|
|
53
|
+
* The returned handle answers for its own state, specification, result,
|
|
54
|
+
* failure and event history, so there is no separate connection-level
|
|
55
|
+
* call for any of them.
|
|
54
56
|
*/
|
|
55
|
-
|
|
57
|
+
openJob(jobId: string): Promise<Job>
|
|
56
58
|
/** List server-side jobs across the database's tables. */
|
|
57
59
|
listJobs(): Promise<Array<JobInfo>>
|
|
58
|
-
/**
|
|
59
|
-
* Describe a single server-side job by id. `null` when the server has
|
|
60
|
-
* no such job.
|
|
61
|
-
*/
|
|
62
|
-
getJob(jobId: string): Promise<JobDescription | null>
|
|
63
60
|
/**
|
|
64
61
|
* Request cancellation of a server-side job by id. Returns true if the
|
|
65
62
|
* server accepted the cancellation, false if no such job exists.
|
|
66
63
|
*/
|
|
67
64
|
cancelJob(jobId: string): Promise<boolean>
|
|
68
|
-
/**
|
|
69
|
-
* The lifecycle event history of a server-side job (all jobs when
|
|
70
|
-
* `job_id` is null), as an Arrow IPC stream buffer. Empty when there is
|
|
71
|
-
* no history.
|
|
72
|
-
*/
|
|
73
|
-
jobHistory(jobId?: string | undefined | null): Promise<Buffer>
|
|
74
65
|
/** Describe a namespace and return its properties. */
|
|
75
66
|
describeNamespace(namespacePath: Array<string>): Promise<DescribeNamespaceResponse>
|
|
76
67
|
/** List child namespaces under the given namespace path */
|
|
@@ -120,6 +111,39 @@ export declare class Job {
|
|
|
120
111
|
wait(): Promise<void>
|
|
121
112
|
/** Request cancellation. Cancelling a finished operation is a no-op. */
|
|
122
113
|
cancel(): Promise<void>
|
|
114
|
+
/**
|
|
115
|
+
* Ask the backend for this job's current state, and for a server-side job
|
|
116
|
+
* its full record, then cache it for the getters below.
|
|
117
|
+
*
|
|
118
|
+
* They are all null until this runs, because submitting an operation
|
|
119
|
+
* returns only a job id. {@link Job.status} fetches the whole record too;
|
|
120
|
+
* {@link Job.wait} records only the terminal state it establishes.
|
|
121
|
+
*/
|
|
122
|
+
refresh(): Promise<void>
|
|
123
|
+
/** The last observed lifecycle state, without contacting the backend. */
|
|
124
|
+
get state(): string | null
|
|
125
|
+
/**
|
|
126
|
+
* The job's type, as the server names it. Null for an in-process job,
|
|
127
|
+
* which has no server-side record.
|
|
128
|
+
*/
|
|
129
|
+
get jobType(): string | null
|
|
130
|
+
/** When the job was created, in milliseconds since the epoch. */
|
|
131
|
+
get creationMs(): number | null
|
|
132
|
+
/** The job-type-specific specification as a JSON string, when present. */
|
|
133
|
+
get specJson(): string | null
|
|
134
|
+
/**
|
|
135
|
+
* The job-type-specific terminal result as a JSON string. Null until the
|
|
136
|
+
* job succeeds, so a job that never terminates reports its progress
|
|
137
|
+
* through {@link Job.events} instead.
|
|
138
|
+
*/
|
|
139
|
+
get resultJson(): string | null
|
|
140
|
+
/** Why the job failed, when it failed and the server reports a reason. */
|
|
141
|
+
get failure(): JobFailureInfo | null
|
|
142
|
+
/**
|
|
143
|
+
* This job's recorded lifecycle events, as an Arrow IPC stream buffer.
|
|
144
|
+
* The TypeScript wrapper turns it into an Arrow table.
|
|
145
|
+
*/
|
|
146
|
+
events(limit?: number | undefined | null, filter?: string | undefined | null): Promise<Buffer>
|
|
123
147
|
}
|
|
124
148
|
|
|
125
149
|
export declare class JsFullTextQuery {
|
|
@@ -773,23 +797,6 @@ export interface IndexStatistics {
|
|
|
773
797
|
numIndices?: number
|
|
774
798
|
}
|
|
775
799
|
|
|
776
|
-
/** A described job from `Connection.getJob`. */
|
|
777
|
-
export interface JobDescription {
|
|
778
|
-
jobId: string
|
|
779
|
-
jobType: string
|
|
780
|
-
/** Lifecycle state: "running", "finished", "failed", or "cancelled". */
|
|
781
|
-
state: string
|
|
782
|
-
/** When the job was created, in milliseconds since the epoch. */
|
|
783
|
-
creationMs: number
|
|
784
|
-
/** The job-type-specific specification as a JSON string, when present. */
|
|
785
|
-
specJson?: string
|
|
786
|
-
/**
|
|
787
|
-
* Why the job failed, when the job is failed and the server reports a
|
|
788
|
-
* reason.
|
|
789
|
-
*/
|
|
790
|
-
failure?: JobFailureInfo
|
|
791
|
-
}
|
|
792
|
-
|
|
793
800
|
/** The server's account of why a job failed. */
|
|
794
801
|
export interface JobFailureInfo {
|
|
795
802
|
phase?: string
|
|
@@ -800,7 +807,7 @@ export interface JobFailureInfo {
|
|
|
800
807
|
/** A row from `Connection.listJobs`: one server-side job. */
|
|
801
808
|
export interface JobInfo {
|
|
802
809
|
/**
|
|
803
|
-
* The job id -- what `Connection.
|
|
810
|
+
* The job id -- what `Connection.openJob` and `Connection.cancelJob`
|
|
804
811
|
* accept.
|
|
805
812
|
*/
|
|
806
813
|
jobId: string
|
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.39.0-beta.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
79
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
98
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
123
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
142
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
162
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
181
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
204
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
222
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
241
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
265
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
284
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
309
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
328
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
349
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
368
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
389
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
408
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
429
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
448
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
469
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
488
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
508
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
527
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
551
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
570
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 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.39.0-beta.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.39.0-beta.
|
|
589
|
+
if (bindingPackageVersion !== '0.39.0-beta.3' && 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.39.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
package/dist/table.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Table as ArrowTable, Data, DataType, Field, IntoVector, MultiVector, Schema } from "./arrow";
|
|
2
2
|
import { IndexOptions } from "./indices";
|
|
3
|
+
import { Job } from "./job";
|
|
3
4
|
import { MergeInsertBuilder } from "./merge";
|
|
4
|
-
import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, IndexConfig, IndexStatistics,
|
|
5
|
+
import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, IndexConfig, IndexStatistics, LsmStats, Branches as NativeBranches, OptimizeStats, RefreshColumnResult, RefreshMaterializedViewResult, TableStatistics, Tags, UpdateFieldMetadataResult, UpdateResult, Table as _NativeTable } from "./native";
|
|
5
6
|
import { AutoQuery, FullTextQuery, Query, TakeQuery, VectorQuery } from "./query";
|
|
6
7
|
import { IntoSql } from "./util";
|
|
7
8
|
export { IndexConfig } from "./native";
|
|
@@ -785,6 +786,16 @@ export declare abstract class Table {
|
|
|
785
786
|
abstract tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
|
|
786
787
|
/** Return the table as an arrow table */
|
|
787
788
|
abstract toArrow(): Promise<ArrowTable>;
|
|
789
|
+
/**
|
|
790
|
+
* Create a {@link MergeInsertBuilder}, which combines new data with the
|
|
791
|
+
* existing table in a single transaction — inserting, updating and deleting
|
|
792
|
+
* rows depending on how they match.
|
|
793
|
+
*
|
|
794
|
+
* @param on - The column, or columns, to match source rows against target
|
|
795
|
+
* rows on. Typically a key or id column. Several columns match on the
|
|
796
|
+
* composite key: a source row updates a target row only when it agrees on
|
|
797
|
+
* every one of them.
|
|
798
|
+
*/
|
|
788
799
|
abstract mergeInsert(on: string | string[]): MergeInsertBuilder;
|
|
789
800
|
/** List all the stats of a specified index
|
|
790
801
|
*
|
package/dist/table.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.Branches = exports.LocalTable = exports.Table = void 0;
|
|
6
6
|
const arrow_1 = require("./arrow");
|
|
7
7
|
const registry_1 = require("./embedding/registry");
|
|
8
|
+
const job_1 = require("./job");
|
|
8
9
|
const merge_1 = require("./merge");
|
|
9
10
|
const query_1 = require("./query");
|
|
10
11
|
const sanitize_1 = require("./sanitize");
|
|
@@ -143,7 +144,7 @@ class LocalTable extends Table {
|
|
|
143
144
|
async createIndexAsync(column, options) {
|
|
144
145
|
// biome-ignore lint/suspicious/noExplicitAny: skip
|
|
145
146
|
const nativeIndex = options?.config?.inner;
|
|
146
|
-
return await this.inner.createIndexAsync(nativeIndex, column, options?.replace, options?.waitTimeoutSeconds, options?.name, options?.train);
|
|
147
|
+
return new job_1.Job(await this.inner.createIndexAsync(nativeIndex, column, options?.replace, options?.waitTimeoutSeconds, options?.name, options?.train));
|
|
147
148
|
}
|
|
148
149
|
async dropIndex(name) {
|
|
149
150
|
await this.inner.dropIndex(name);
|
|
@@ -273,7 +274,7 @@ class LocalTable extends Table {
|
|
|
273
274
|
return await this.inner.refreshColumn(column);
|
|
274
275
|
}
|
|
275
276
|
async refreshColumnAsync(column) {
|
|
276
|
-
return await this.inner.refreshColumnAsync(column);
|
|
277
|
+
return new job_1.Job(await this.inner.refreshColumnAsync(column));
|
|
277
278
|
}
|
|
278
279
|
async refreshMaterializedView(full, sourceVersion) {
|
|
279
280
|
return await this.inner.refreshMaterializedView(full, sourceVersion);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.39.0-beta.
|
|
14
|
+
"version": "0.39.0-beta.3",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@biomejs/biome": "^1.7.3",
|
|
45
45
|
"@jest/globals": "^29.7.0",
|
|
46
46
|
"@napi-rs/cli": "3.7.0",
|
|
47
|
-
"@opentelemetry/sdk-metrics": "^
|
|
47
|
+
"@opentelemetry/sdk-metrics": "^2.10.0",
|
|
48
48
|
"@types/axios": "^0.14.0",
|
|
49
49
|
"@types/jest": "^29.1.2",
|
|
50
50
|
"@types/node": "22.7.4",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"eslint": "^8.57.0",
|
|
57
57
|
"jest": "^29.7.0",
|
|
58
58
|
"shx": "^0.3.4",
|
|
59
|
-
"tmp": "^0.2.
|
|
59
|
+
"tmp": "^0.2.7",
|
|
60
60
|
"ts-jest": "^29.1.2",
|
|
61
61
|
"typedoc": "0.26.4",
|
|
62
62
|
"typedoc-plugin-markdown": "4.2.1",
|
|
@@ -106,13 +106,13 @@
|
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"@huggingface/transformers": "3.0.2",
|
|
108
108
|
"openai": "4.29.2",
|
|
109
|
-
"@lancedb/lancedb-darwin-arm64": "0.39.0-beta.
|
|
110
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.39.0-beta.
|
|
111
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.39.0-beta.
|
|
112
|
-
"@lancedb/lancedb-linux-x64-musl": "0.39.0-beta.
|
|
113
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.39.0-beta.
|
|
114
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.39.0-beta.
|
|
115
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.39.0-beta.
|
|
109
|
+
"@lancedb/lancedb-darwin-arm64": "0.39.0-beta.3",
|
|
110
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.39.0-beta.3",
|
|
111
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.39.0-beta.3",
|
|
112
|
+
"@lancedb/lancedb-linux-x64-musl": "0.39.0-beta.3",
|
|
113
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.39.0-beta.3",
|
|
114
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.39.0-beta.3",
|
|
115
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.39.0-beta.3"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"@types/node": ">=22",
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -16,3 +16,41 @@ allowBuilds:
|
|
|
16
16
|
onnxruntime-node: true
|
|
17
17
|
protobufjs: true
|
|
18
18
|
sharp: true
|
|
19
|
+
|
|
20
|
+
minimumReleaseAgeExclude:
|
|
21
|
+
- protobufjs@7.5.8
|
|
22
|
+
- tmp@0.2.6
|
|
23
|
+
- form-data@4.0.6
|
|
24
|
+
- tar@7.5.16
|
|
25
|
+
- markdown-it@14.1.2
|
|
26
|
+
- linkify-it@5.0.1
|
|
27
|
+
- js-yaml@3.15.0
|
|
28
|
+
- js-yaml@4.1.2
|
|
29
|
+
- protobufjs@7.6.1
|
|
30
|
+
- protobufjs@7.6.3
|
|
31
|
+
- '@babel/core@7.29.1'
|
|
32
|
+
- axios@1.18.0
|
|
33
|
+
- brace-expansion@2.1.2
|
|
34
|
+
- brace-expansion@1.1.16
|
|
35
|
+
- js-yaml@4.3.0
|
|
36
|
+
- tar@7.5.18
|
|
37
|
+
- tar@7.5.19
|
|
38
|
+
- tar@7.5.17
|
|
39
|
+
- protobufjs@7.6.5
|
|
40
|
+
- linkify-it@5.0.2
|
|
41
|
+
- sharp@0.35.0
|
|
42
|
+
- brace-expansion@1.1.17
|
|
43
|
+
- brace-expansion@2.1.3
|
|
44
|
+
- brace-expansion@2.1.4
|
|
45
|
+
- brace-expansion@1.1.18
|
|
46
|
+
- js-yaml@3.15.1
|
|
47
|
+
- js-yaml@4.3.1
|
|
48
|
+
- tar@7.5.21
|
|
49
|
+
- '@opentelemetry/core@2.8.0'
|
|
50
|
+
|
|
51
|
+
# @huggingface/transformers pins sharp ^0.33.5 and no released version has moved
|
|
52
|
+
# past ^0.34.5, all of which inherit the libvips CVEs in GHSA-f88m-g3jw-g9cj.
|
|
53
|
+
# Force the patched line. sharp is only reached by transformers' image pipeline,
|
|
54
|
+
# which LanceDB's text embedding function never uses.
|
|
55
|
+
overrides:
|
|
56
|
+
sharp: ^0.35.4
|