@lancedb/lancedb 0.41.0-beta.12 → 0.41.0-beta.15
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/arrow.d.ts +1 -0
- package/dist/connection.d.ts +17 -75
- package/dist/connection.js +28 -26
- package/dist/embedding/transformers.js +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -5
- package/dist/indices.d.ts +2 -1
- package/dist/job.d.ts +8 -5
- package/dist/job.js +8 -5
- package/dist/native.d.ts +10 -20
- package/dist/native.js +52 -52
- package/dist/query.d.ts +5 -3
- package/dist/query.js +58 -21
- package/dist/table.d.ts +5 -1
- package/package.json +10 -9
package/dist/arrow.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Buffers } from "apache-arrow/data";
|
|
|
3
3
|
import { type EmbeddingFunction } from "./embedding/embedding_function";
|
|
4
4
|
import { EmbeddingFunctionConfig } from "./embedding/registry";
|
|
5
5
|
export * from "apache-arrow";
|
|
6
|
+
export type { Data as ArrowData } from "apache-arrow";
|
|
6
7
|
export type SchemaLike = Schema | {
|
|
7
8
|
fields: FieldLike[];
|
|
8
9
|
metadata: Map<string, string>;
|
package/dist/connection.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { Job } from "./job";
|
|
|
4
4
|
import { Listing, ListingOptions } from "./listing";
|
|
5
5
|
import { MaterializedView, MaterializedViewSelect } from "./materialized_view";
|
|
6
6
|
import { Connection as LanceDbConnection } from "./native";
|
|
7
|
-
import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, JobInfo
|
|
7
|
+
import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, JobInfo } from "./native";
|
|
8
8
|
import { ViewDescription } from "./view";
|
|
9
|
-
export type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse,
|
|
9
|
+
export type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, };
|
|
10
10
|
import { Table } from "./table";
|
|
11
11
|
export interface CreateTableOptions {
|
|
12
12
|
/**
|
|
@@ -17,8 +17,11 @@ export interface CreateTableOptions {
|
|
|
17
17
|
* happen. Any provided data will be ignored.
|
|
18
18
|
*
|
|
19
19
|
* If this is set to "overwrite" then any existing table will be replaced.
|
|
20
|
+
*
|
|
21
|
+
* If this is set to "exist_ok" then an existing table is opened and any
|
|
22
|
+
* provided data is ignored.
|
|
20
23
|
*/
|
|
21
|
-
mode: "create" | "overwrite";
|
|
24
|
+
mode: "create" | "overwrite" | "exist_ok";
|
|
22
25
|
/**
|
|
23
26
|
* If this is true and the table already exists and the mode is "create"
|
|
24
27
|
* then no error will be raised.
|
|
@@ -96,7 +99,7 @@ export interface OpenTableOptions {
|
|
|
96
99
|
indexCacheSize?: number;
|
|
97
100
|
}
|
|
98
101
|
/**
|
|
99
|
-
* @deprecated Use {@link
|
|
102
|
+
* @deprecated Use {@link ListingOptions} with {@link Connection.listTables}
|
|
100
103
|
* instead.
|
|
101
104
|
*/
|
|
102
105
|
export interface TableNamesOptions {
|
|
@@ -111,30 +114,6 @@ export interface TableNamesOptions {
|
|
|
111
114
|
/** The maximum number of names to return. Omitted returns all names; zero returns none. */
|
|
112
115
|
limit?: number;
|
|
113
116
|
}
|
|
114
|
-
export interface ListTablesOptions {
|
|
115
|
-
/**
|
|
116
|
-
* Token from a previous response, to resume listing where it left off.
|
|
117
|
-
*
|
|
118
|
-
* The token is opaque: it carries whatever the database needs to resume, and
|
|
119
|
-
* callers should not construct or interpret one.
|
|
120
|
-
*/
|
|
121
|
-
pageToken?: string;
|
|
122
|
-
/**
|
|
123
|
-
* An upper bound on how many tables to return.
|
|
124
|
-
* Defaults to 100. Zero returns an empty page without a continuation token.
|
|
125
|
-
*
|
|
126
|
-
* A page may hold fewer than this and still not be the last one, so keep
|
|
127
|
-
* going while the response carries a page token rather than while pages are
|
|
128
|
-
* full.
|
|
129
|
-
*/
|
|
130
|
-
limit?: number;
|
|
131
|
-
}
|
|
132
|
-
export interface ListNamespacesOptions {
|
|
133
|
-
/** Token from a previous response for pagination. */
|
|
134
|
-
pageToken?: string;
|
|
135
|
-
/** An optional limit to the number of results to return. */
|
|
136
|
-
limit?: number;
|
|
137
|
-
}
|
|
138
117
|
export interface CreateNamespaceOptions {
|
|
139
118
|
/** Creation mode. */
|
|
140
119
|
mode?: "create" | "exist_ok" | "overwrite";
|
|
@@ -216,40 +195,15 @@ export declare abstract class Connection {
|
|
|
216
195
|
* @deprecated Use {@link Connection.listTables} instead.
|
|
217
196
|
*/
|
|
218
197
|
abstract tableNames(namespacePath?: string[], options?: Partial<TableNamesOptions>): Promise<string[]>;
|
|
219
|
-
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* To retrieve the tables after the page, pass the `pageToken` the response
|
|
223
|
-
* carries back in. A page can be shorter than `limit` without being the last
|
|
224
|
-
* one, so walk until a response carries no page token:
|
|
225
|
-
*
|
|
198
|
+
/** Lazily list tables in a namespace, requesting 100 per page by default.
|
|
199
|
+
* @example
|
|
226
200
|
* ```ts
|
|
227
|
-
* const
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* const page = await conn.listTables({ pageToken, limit: 100 });
|
|
231
|
-
* names.push(...page.tables);
|
|
232
|
-
* pageToken = page.pageToken;
|
|
233
|
-
* } while (pageToken);
|
|
201
|
+
* for await (const name of conn.listTables([], { pageLimit: 20 })) {
|
|
202
|
+
* console.log(name);
|
|
203
|
+
* }
|
|
234
204
|
* ```
|
|
235
|
-
*
|
|
236
|
-
* @param {Partial<ListTablesOptions>} options - Pagination options
|
|
237
|
-
* (`pageToken`, `limit`).
|
|
238
|
-
* @returns {Promise<ListTablesResponse>} A page of table names and an
|
|
239
|
-
* optional token for the tables after it.
|
|
240
205
|
*/
|
|
241
|
-
abstract listTables(options?:
|
|
242
|
-
/**
|
|
243
|
-
* List a page of the tables in this database.
|
|
244
|
-
*
|
|
245
|
-
* @param {string[]} namespacePath - The namespace path to list tables from
|
|
246
|
-
* (defaults to root namespace)
|
|
247
|
-
* @param {Partial<ListTablesOptions>} options - Pagination options
|
|
248
|
-
* (`pageToken`, `limit`).
|
|
249
|
-
* @returns {Promise<ListTablesResponse>} A page of table names and an
|
|
250
|
-
* optional token for the tables after it.
|
|
251
|
-
*/
|
|
252
|
-
abstract listTables(namespacePath?: string[], options?: Partial<ListTablesOptions>): Promise<ListTablesResponse>;
|
|
206
|
+
abstract listTables(namespacePath?: string[], options?: ListingOptions): Listing<string>;
|
|
253
207
|
/**
|
|
254
208
|
* Open a table in the database.
|
|
255
209
|
* @param {string} name - The name of the table
|
|
@@ -410,20 +364,8 @@ export declare abstract class Connection {
|
|
|
410
364
|
* (may be undefined if the namespace has none).
|
|
411
365
|
*/
|
|
412
366
|
abstract describeNamespace(namespacePath: string[]): Promise<DescribeNamespaceResponse>;
|
|
413
|
-
/**
|
|
414
|
-
|
|
415
|
-
*
|
|
416
|
-
* Results may be paginated. To retrieve subsequent pages, pass the
|
|
417
|
-
* `pageToken` returned by a previous call.
|
|
418
|
-
*
|
|
419
|
-
* @param {string[]} namespacePath - The parent namespace path. Defaults
|
|
420
|
-
* to the root namespace if omitted.
|
|
421
|
-
* @param {Partial<ListNamespacesOptions>} options - Pagination options
|
|
422
|
-
* (`pageToken`, `limit`).
|
|
423
|
-
* @returns {Promise<ListNamespacesResponse>} Child namespace names and
|
|
424
|
-
* an optional token for fetching the next page.
|
|
425
|
-
*/
|
|
426
|
-
abstract listNamespaces(namespacePath?: string[], options?: Partial<ListNamespacesOptions>): Promise<ListNamespacesResponse>;
|
|
367
|
+
/** Lazily list immediate child namespaces, 100 per page by default. */
|
|
368
|
+
abstract listNamespaces(namespacePath?: string[], options?: ListingOptions): Listing<string>;
|
|
427
369
|
/**
|
|
428
370
|
* Create a new namespace at the given path.
|
|
429
371
|
*
|
|
@@ -548,7 +490,7 @@ export declare class LocalConnection extends Connection {
|
|
|
548
490
|
dropView(name: string, namespacePath?: string[]): Promise<void>;
|
|
549
491
|
dropViewAsync(name: string, namespacePath?: string[]): Promise<Job>;
|
|
550
492
|
listViews(namespacePath?: string[], options?: ListingOptions): Listing<string>;
|
|
551
|
-
listTables(
|
|
493
|
+
listTables(namespacePath?: string[], options?: ListingOptions): Listing<string>;
|
|
552
494
|
openTable(name: string, namespacePath?: string[], options?: Partial<OpenTableOptions>): Promise<Table>;
|
|
553
495
|
cloneTable(targetTableName: string, sourceUri: string, options?: {
|
|
554
496
|
targetNamespacePath?: string[];
|
|
@@ -567,7 +509,7 @@ export declare class LocalConnection extends Connection {
|
|
|
567
509
|
dropTableAsync(name: string, namespacePath?: string[]): Promise<Job>;
|
|
568
510
|
dropAllTables(namespacePath?: string[]): Promise<void>;
|
|
569
511
|
describeNamespace(namespacePath: string[]): Promise<DescribeNamespaceResponse>;
|
|
570
|
-
listNamespaces(namespacePath?: string[], options?:
|
|
512
|
+
listNamespaces(namespacePath?: string[], options?: ListingOptions): Listing<string>;
|
|
571
513
|
createNamespace(namespacePath: string[], options?: Partial<CreateNamespaceOptions>): Promise<CreateNamespaceResponse>;
|
|
572
514
|
dropNamespace(namespacePath: string[], options?: Partial<DropNamespaceOptions>): Promise<DropNamespaceResponse>;
|
|
573
515
|
renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
|
package/dist/connection.js
CHANGED
|
@@ -67,9 +67,9 @@ class LocalConnection extends Connection {
|
|
|
67
67
|
else {
|
|
68
68
|
// First argument is options object (backwards compatibility)
|
|
69
69
|
namespacePath = undefined;
|
|
70
|
-
tableNamesOptions = namespacePathOrOptions;
|
|
70
|
+
tableNamesOptions = namespacePathOrOptions ?? options;
|
|
71
71
|
}
|
|
72
|
-
return this.inner.tableNames(namespacePath ?? [], tableNamesOptions?.startAfter, tableNamesOptions?.limit);
|
|
72
|
+
return this.inner.tableNames(namespacePath ?? [], tableNamesOptions?.startAfter, normalizeTableListingLimit(tableNamesOptions?.limit));
|
|
73
73
|
}
|
|
74
74
|
async createMaterializedView(name, source, options) {
|
|
75
75
|
(0, materialized_view_1.validateNonNegativeInteger)(options?.limit, "limit");
|
|
@@ -106,15 +106,9 @@ class LocalConnection extends Connection {
|
|
|
106
106
|
(0, listing_1.validateListingOptions)(options);
|
|
107
107
|
return new listing_1.Listing(this.inner.listViews(namespacePath ?? [], options.pageToken, options.pageLimit));
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
? namespacePathOrOptions
|
|
113
|
-
: undefined;
|
|
114
|
-
const listTablesOptions = Array.isArray(namespacePathOrOptions)
|
|
115
|
-
? options
|
|
116
|
-
: namespacePathOrOptions;
|
|
117
|
-
return this.inner.listTables(namespacePath ?? [], listTablesOptions?.pageToken, listTablesOptions?.limit);
|
|
109
|
+
listTables(namespacePath, options = {}) {
|
|
110
|
+
(0, listing_1.validateListingOptions)(options);
|
|
111
|
+
return new listing_1.Listing(this.inner.listTables(namespacePath ?? [], options.pageToken, options.pageLimit));
|
|
118
112
|
}
|
|
119
113
|
async openTable(name, namespacePath, options) {
|
|
120
114
|
const innerTable = await this.inner.openTable(name, namespacePath ?? [], cleanseStorageOptions(options?.storageOptions), options?.indexCacheSize);
|
|
@@ -138,21 +132,22 @@ class LocalConnection extends Connection {
|
|
|
138
132
|
return new table_1.LocalTable(innerTable);
|
|
139
133
|
}
|
|
140
134
|
getStorageOptions(options) {
|
|
135
|
+
let storageOptions = options?.storageOptions;
|
|
141
136
|
if (options?.dataStorageVersion !== undefined) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
options.dataStorageVersion;
|
|
137
|
+
storageOptions = {
|
|
138
|
+
...storageOptions,
|
|
139
|
+
newTableDataStorageVersion: options.dataStorageVersion,
|
|
140
|
+
};
|
|
147
141
|
}
|
|
148
142
|
if (options?.enableV2ManifestPaths !== undefined) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
143
|
+
storageOptions = {
|
|
144
|
+
...storageOptions,
|
|
145
|
+
newTableEnableV2ManifestPaths: options.enableV2ManifestPaths
|
|
146
|
+
? "true"
|
|
147
|
+
: "false",
|
|
148
|
+
};
|
|
154
149
|
}
|
|
155
|
-
return cleanseStorageOptions(
|
|
150
|
+
return cleanseStorageOptions(storageOptions);
|
|
156
151
|
}
|
|
157
152
|
async createTable(nameOrOptions, dataOrNamespacePath, namespacePathOrOptions, options) {
|
|
158
153
|
if (typeof nameOrOptions !== "string" && "name" in nameOrOptions) {
|
|
@@ -175,7 +170,7 @@ class LocalConnection extends Connection {
|
|
|
175
170
|
else {
|
|
176
171
|
// Third argument is options object (backwards compatibility)
|
|
177
172
|
namespacePath = undefined;
|
|
178
|
-
createOptions = namespacePathOrOptions;
|
|
173
|
+
createOptions = namespacePathOrOptions ?? options;
|
|
179
174
|
}
|
|
180
175
|
return this._createTableImpl(name, data, namespacePath, createOptions);
|
|
181
176
|
}
|
|
@@ -200,7 +195,7 @@ class LocalConnection extends Connection {
|
|
|
200
195
|
else {
|
|
201
196
|
// Third argument is options object (backwards compatibility)
|
|
202
197
|
namespacePath = undefined;
|
|
203
|
-
createOptions = namespacePathOrOptions;
|
|
198
|
+
createOptions = namespacePathOrOptions ?? options;
|
|
204
199
|
}
|
|
205
200
|
let mode = createOptions?.mode ?? "create";
|
|
206
201
|
const existOk = createOptions?.existOk ?? false;
|
|
@@ -231,8 +226,9 @@ class LocalConnection extends Connection {
|
|
|
231
226
|
describeNamespace(namespacePath) {
|
|
232
227
|
return this.inner.describeNamespace(namespacePath);
|
|
233
228
|
}
|
|
234
|
-
listNamespaces(namespacePath, options) {
|
|
235
|
-
|
|
229
|
+
listNamespaces(namespacePath, options = {}) {
|
|
230
|
+
(0, listing_1.validateListingOptions)(options);
|
|
231
|
+
return new listing_1.Listing(this.inner.listNamespaces(namespacePath ?? [], options.pageToken, options.pageLimit));
|
|
236
232
|
}
|
|
237
233
|
createNamespace(namespacePath, options) {
|
|
238
234
|
return this.inner.createNamespace(namespacePath, options?.mode, options?.properties);
|
|
@@ -261,6 +257,12 @@ class LocalConnection extends Connection {
|
|
|
261
257
|
}
|
|
262
258
|
}
|
|
263
259
|
exports.LocalConnection = LocalConnection;
|
|
260
|
+
function normalizeTableListingLimit(limit) {
|
|
261
|
+
(0, materialized_view_1.validateNonNegativeInteger)(limit, "limit");
|
|
262
|
+
// The native binding takes u32: larger JS numbers otherwise wrap to zero or
|
|
263
|
+
// a smaller page size. A listing limit is an upper bound, so saturate it.
|
|
264
|
+
return limit === undefined ? undefined : Math.min(limit, 0xffffffff);
|
|
265
|
+
}
|
|
264
266
|
/**
|
|
265
267
|
* Takes storage options and makes all the keys snake case.
|
|
266
268
|
*/
|
|
@@ -10,6 +10,7 @@ class TransformersEmbeddingFunction extends embedding_function_1.EmbeddingFuncti
|
|
|
10
10
|
#model;
|
|
11
11
|
#tokenizer;
|
|
12
12
|
#modelName;
|
|
13
|
+
#tokenizerName;
|
|
13
14
|
#initialized = false;
|
|
14
15
|
#tokenizerOptions;
|
|
15
16
|
#ndims;
|
|
@@ -25,6 +26,7 @@ class TransformersEmbeddingFunction extends embedding_function_1.EmbeddingFuncti
|
|
|
25
26
|
};
|
|
26
27
|
this.#ndims = options.ndims;
|
|
27
28
|
this.#modelName = modelName;
|
|
29
|
+
this.#tokenizerName = options.tokenizer ?? modelName;
|
|
28
30
|
}
|
|
29
31
|
async init() {
|
|
30
32
|
let transformers;
|
|
@@ -47,10 +49,10 @@ class TransformersEmbeddingFunction extends embedding_function_1.EmbeddingFuncti
|
|
|
47
49
|
throw new Error(`error loading model ${this.#modelName}. Make sure you are using a wasm compatible model.\nReason: ${e}`);
|
|
48
50
|
}
|
|
49
51
|
try {
|
|
50
|
-
this.#tokenizer = await transformers.AutoTokenizer.from_pretrained(this.#
|
|
52
|
+
this.#tokenizer = await transformers.AutoTokenizer.from_pretrained(this.#tokenizerName);
|
|
51
53
|
}
|
|
52
54
|
catch (e) {
|
|
53
|
-
throw new Error(`error loading tokenizer
|
|
55
|
+
throw new Error(`error loading tokenizer ${this.#tokenizerName}. Make sure you are using a wasm compatible model:\nReason: ${e}`);
|
|
54
56
|
}
|
|
55
57
|
this.#initialized = true;
|
|
56
58
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatist
|
|
|
11
11
|
export { makeArrowTable, makeJsonField, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
|
|
12
12
|
export { blob, isBlobField, BlobFile } from "./blob";
|
|
13
13
|
export type { BlobData, BlobInput, BlobOptions, BlobRange, BlobReadOptions, BlobUri, } from "./blob";
|
|
14
|
-
export { Connection, CreateTableOptions, TableNamesOptions,
|
|
14
|
+
export { Connection, CreateTableOptions, TableNamesOptions, OpenTableOptions, CreateNamespaceOptions, DropNamespaceOptions, CreateNamespaceResponse, DropNamespaceResponse, DescribeNamespaceResponse, RenameTableOptions, } from "./connection";
|
|
15
15
|
export { JobFailureInfo, JobInfo, Session } from "./native.js";
|
|
16
16
|
export { Job, JobEventsOptions } from "./job";
|
|
17
17
|
export { AutoQuery, ExecutableQuery, Query, QueryBase, VectorQuery, TakeQuery, AnalyzePlanDistributedMetrics, BlobMode, QueryExecutionOptions, ColumnOrdering, FullTextSearchOptions, RecordBatchIterator, FullTextQuery, MatchQuery, PhraseQuery, BoostQuery, MultiMatchQuery, BooleanQuery, FullTextQueryType, Operator, Occur, } from "./query";
|
package/dist/index.js
CHANGED
|
@@ -122,8 +122,10 @@ async function connect(uriOrOptions, optionsOrSession, sessionOrHeaderProvider,
|
|
|
122
122
|
if (!uri) {
|
|
123
123
|
throw new Error("uri is required");
|
|
124
124
|
}
|
|
125
|
-
finalOptions =
|
|
126
|
-
|
|
125
|
+
finalOptions = {
|
|
126
|
+
...finalOptions,
|
|
127
|
+
storageOptions: (0, connection_1.cleanseStorageOptions)(finalOptions.storageOptions),
|
|
128
|
+
};
|
|
127
129
|
// Create native header provider if one was provided
|
|
128
130
|
let nativeProvider;
|
|
129
131
|
if (finalHeaderProvider) {
|
|
@@ -176,9 +178,10 @@ async function connectNamespace(implName, configOrProperties, options) {
|
|
|
176
178
|
else {
|
|
177
179
|
properties = configOrProperties;
|
|
178
180
|
}
|
|
179
|
-
const finalOptions =
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
const finalOptions = {
|
|
182
|
+
...options,
|
|
183
|
+
storageOptions: (0, connection_1.cleanseStorageOptions)(options?.storageOptions),
|
|
184
|
+
};
|
|
182
185
|
const nativeConn = await native_js_1.Connection.newWithNamespace(implName, properties, finalOptions);
|
|
183
186
|
return new connection_1.LocalConnection(nativeConn);
|
|
184
187
|
}
|
package/dist/indices.d.ts
CHANGED
|
@@ -119,7 +119,8 @@ export interface IvfRqOptions {
|
|
|
119
119
|
*
|
|
120
120
|
* This value controls how much each residual component is compressed. The more
|
|
121
121
|
* bits, the more accurate the index will be but the slower search. Typical values
|
|
122
|
-
* are small integers
|
|
122
|
+
* are small integers. If unset, uses Lance's default (currently 5 bits per
|
|
123
|
+
* dimension). Set to 1 for maximum compression.
|
|
123
124
|
*/
|
|
124
125
|
numBits?: number;
|
|
125
126
|
/**
|
package/dist/job.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export interface JobEventsOptions {
|
|
|
19
19
|
* - {@link Job.refresh} and {@link Job.status} fetch the whole record.
|
|
20
20
|
* - {@link Job.wait} records the terminal state it establishes, but not the
|
|
21
21
|
* rest of the record.
|
|
22
|
-
* -
|
|
22
|
+
* - Registry details are null until one of those runs. Query handles report
|
|
23
|
+
* jobType "query" immediately.
|
|
23
24
|
*
|
|
24
25
|
* @hideconstructor
|
|
25
26
|
*/
|
|
@@ -29,15 +30,17 @@ export declare class Job {
|
|
|
29
30
|
/**
|
|
30
31
|
* Identifies the operation on the server that is running it.
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* Registry handles expose a registry job ID; query handles expose a
|
|
34
|
+
* connection-scoped SQL query UUID string. Local handles have no ID.
|
|
35
|
+
* Query handles report jobType "query". Their IDs are not registry IDs or
|
|
36
|
+
* durable resume tokens.
|
|
34
37
|
*/
|
|
35
38
|
get id(): string | null;
|
|
36
39
|
/** The last observed lifecycle state, without contacting the backend. */
|
|
37
40
|
get state(): string | null;
|
|
38
41
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
42
|
+
* "query" immediately for SQL-backed handles; otherwise the cached
|
|
43
|
+
* server-reported job type. Null for in-process handles.
|
|
41
44
|
*/
|
|
42
45
|
get jobType(): string | null;
|
|
43
46
|
/** When the job was created, in milliseconds since the epoch. */
|
package/dist/job.js
CHANGED
|
@@ -16,7 +16,8 @@ const apache_arrow_1 = require("apache-arrow");
|
|
|
16
16
|
* - {@link Job.refresh} and {@link Job.status} fetch the whole record.
|
|
17
17
|
* - {@link Job.wait} records the terminal state it establishes, but not the
|
|
18
18
|
* rest of the record.
|
|
19
|
-
* -
|
|
19
|
+
* - Registry details are null until one of those runs. Query handles report
|
|
20
|
+
* jobType "query" immediately.
|
|
20
21
|
*
|
|
21
22
|
* @hideconstructor
|
|
22
23
|
*/
|
|
@@ -28,8 +29,10 @@ class Job {
|
|
|
28
29
|
/**
|
|
29
30
|
* Identifies the operation on the server that is running it.
|
|
30
31
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* Registry handles expose a registry job ID; query handles expose a
|
|
33
|
+
* connection-scoped SQL query UUID string. Local handles have no ID.
|
|
34
|
+
* Query handles report jobType "query". Their IDs are not registry IDs or
|
|
35
|
+
* durable resume tokens.
|
|
33
36
|
*/
|
|
34
37
|
get id() {
|
|
35
38
|
return this.inner.id ?? null;
|
|
@@ -39,8 +42,8 @@ class Job {
|
|
|
39
42
|
return this.inner.state ?? null;
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
45
|
+
* "query" immediately for SQL-backed handles; otherwise the cached
|
|
46
|
+
* server-reported job type. Null for in-process handles.
|
|
44
47
|
*/
|
|
45
48
|
get jobType() {
|
|
46
49
|
return this.inner.jobType ?? null;
|
package/dist/native.d.ts
CHANGED
|
@@ -45,8 +45,8 @@ export declare class Connection {
|
|
|
45
45
|
close(): void
|
|
46
46
|
/** List all tables in the dataset. */
|
|
47
47
|
tableNames(namespacePath?: Array<string> | undefined | null, startAfter?: string | undefined | null, limit?: number | undefined | null): Promise<Array<string>>
|
|
48
|
-
/**
|
|
49
|
-
listTables(namespacePath?: Array<string> | undefined | null, pageToken?: string | undefined | null, limit?: number | undefined | null):
|
|
48
|
+
/** Lazily list tables in the database. */
|
|
49
|
+
listTables(namespacePath?: Array<string> | undefined | null, pageToken?: string | undefined | null, limit?: number | undefined | null): NameListing
|
|
50
50
|
/**
|
|
51
51
|
* Create table from a Apache Arrow IPC (file) buffer.
|
|
52
52
|
*
|
|
@@ -111,8 +111,8 @@ export declare class Connection {
|
|
|
111
111
|
resumeJob(jobId: string): Promise<string>
|
|
112
112
|
/** Describe a namespace and return its properties. */
|
|
113
113
|
describeNamespace(namespacePath: Array<string>): Promise<DescribeNamespaceResponse>
|
|
114
|
-
/**
|
|
115
|
-
listNamespaces(namespacePath?: Array<string> | undefined | null, pageToken?: string | undefined | null, limit?: number | undefined | null):
|
|
114
|
+
/** Lazily list child namespaces under the given namespace path */
|
|
115
|
+
listNamespaces(namespacePath?: Array<string> | undefined | null, pageToken?: string | undefined | null, limit?: number | undefined | null): NameListing
|
|
116
116
|
/** Create a new namespace with optional properties. */
|
|
117
117
|
createNamespace(namespacePath: Array<string>, mode?: string | undefined | null, properties?: Record<string, string> | undefined | null): Promise<CreateNamespaceResponse>
|
|
118
118
|
/** Drop a namespace. */
|
|
@@ -151,8 +151,8 @@ export declare class Index {
|
|
|
151
151
|
/** A handle to an operation that may still be running. */
|
|
152
152
|
export declare class Job {
|
|
153
153
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
154
|
+
* The operation's opaque ID. Interpret registry and query IDs using job_type().
|
|
155
|
+
* Local handles have no ID.
|
|
156
156
|
*/
|
|
157
157
|
get id(): string | null
|
|
158
158
|
/**
|
|
@@ -172,16 +172,16 @@ export declare class Job {
|
|
|
172
172
|
* Ask the backend for this job's current state, and for a server-side job
|
|
173
173
|
* its full record, then cache it for the getters below.
|
|
174
174
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
175
|
+
* Registry details are null until this runs; query handles already expose
|
|
176
|
+
* job_type "query". {@link Job.status} fetches the whole registry record too;
|
|
177
177
|
* {@link Job.wait} records only the terminal state it establishes.
|
|
178
178
|
*/
|
|
179
179
|
refresh(): Promise<void>
|
|
180
180
|
/** The last observed lifecycle state, without contacting the backend. */
|
|
181
181
|
get state(): string | null
|
|
182
182
|
/**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
183
|
+
* "query" immediately for SQL-backed handles; otherwise the cached
|
|
184
|
+
* server-reported job type. Null for in-process handles.
|
|
185
185
|
*/
|
|
186
186
|
get jobType(): string | null
|
|
187
187
|
/** When the job was created, in milliseconds since the epoch. */
|
|
@@ -966,16 +966,6 @@ export interface JobInfo {
|
|
|
966
966
|
/** The catalog of described LanceDB metrics. Empty until the recorder is installed. */
|
|
967
967
|
export declare function lancedbMetricsCatalog(): Array<MetricDescription>
|
|
968
968
|
|
|
969
|
-
export interface ListNamespacesResponse {
|
|
970
|
-
namespaces: Array<string>
|
|
971
|
-
pageToken?: string
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
export interface ListTablesResponse {
|
|
975
|
-
tables: Array<string>
|
|
976
|
-
pageToken?: string
|
|
977
|
-
}
|
|
978
|
-
|
|
979
969
|
/** One in-memory memtable. */
|
|
980
970
|
export interface MemtableStats {
|
|
981
971
|
/** The generation this memtable will become once frozen. */
|
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.41.0-beta.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
79
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
98
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
123
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
142
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
162
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
181
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
204
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
222
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
241
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
265
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
284
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
309
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
328
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
349
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
368
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
389
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
408
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
429
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
448
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
469
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
488
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
508
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
527
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
551
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
570
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 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.41.0-beta.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.41.0-beta.
|
|
589
|
+
if (bindingPackageVersion !== '0.41.0-beta.15' && 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.41.0-beta.15 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -38,12 +38,14 @@ export interface QueryExecutionOptions {
|
|
|
38
38
|
*
|
|
39
39
|
* - `"descriptions"` (default): each blob is a descriptor. Read the bytes
|
|
40
40
|
* with {@link Table.fetchBlobs} or {@link Table.fetchBlobFiles}.
|
|
41
|
-
* - `"bytes"`: each
|
|
42
|
-
* `LargeBinary`. The query also reads `_rowid` to fetch
|
|
41
|
+
* - `"bytes"`: each blob column, including blobs nested in structs, holds
|
|
42
|
+
* the bytes as `LargeBinary`. The query also reads `_rowid` to fetch them, and
|
|
43
43
|
* leaves it out of the result unless {@link QueryBase.withRowId} was
|
|
44
44
|
* called. All the bytes are held in memory.
|
|
45
45
|
*
|
|
46
|
-
*
|
|
46
|
+
* Selecting a parent struct or directly aliasing a blob or struct also returns
|
|
47
|
+
* bytes. Blobs inside lists keep their descriptors. Arbitrary projection
|
|
48
|
+
* expressions are not materialized as bytes.
|
|
47
49
|
*
|
|
48
50
|
* The rows and the bytes come from the same table version. If the table
|
|
49
51
|
* changes while the query runs, the query runs again, up to three times.
|
package/dist/query.js
CHANGED
|
@@ -23,10 +23,25 @@ async function* RecordBatchIterator(promisedInner) {
|
|
|
23
23
|
}
|
|
24
24
|
const BLOB_BYTES_ATTEMPTS = 3;
|
|
25
25
|
function blobSources(blobColumns, projection) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
if (projection === undefined) {
|
|
27
|
+
return blobColumns.map((source) => {
|
|
28
|
+
const [output, ...path] = source.split(".");
|
|
29
|
+
return { output, path, source };
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const sources = [];
|
|
33
|
+
for (const [output, source] of projection) {
|
|
34
|
+
for (const column of blobColumns) {
|
|
35
|
+
if (column === source || column.startsWith(`${source}.`)) {
|
|
36
|
+
sources.push({
|
|
37
|
+
output,
|
|
38
|
+
path: column === source ? [] : column.slice(source.length + 1).split("."),
|
|
39
|
+
source: column,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return sources;
|
|
30
45
|
}
|
|
31
46
|
async function readBlobBytes(table, sources, snapshot, dropRowId) {
|
|
32
47
|
const rowIdColumn = table.getChild("_rowid");
|
|
@@ -36,14 +51,21 @@ async function readBlobBytes(table, sources, snapshot, dropRowId) {
|
|
|
36
51
|
const rowIds = rowIdColumn === null
|
|
37
52
|
? []
|
|
38
53
|
: Array.from(rowIdColumn.toArray());
|
|
54
|
+
const outputFields = new Map(table.schema.fields.map((field) => [field.name, field]));
|
|
39
55
|
const replacements = new Map();
|
|
40
|
-
for (const
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
for (const { output, path, source } of sources) {
|
|
57
|
+
let field = outputFields.get(output);
|
|
58
|
+
for (const name of path) {
|
|
59
|
+
field =
|
|
60
|
+
field !== undefined && arrow_1.DataType.isStruct(field.type)
|
|
61
|
+
? field.type.children.find((child) => child.name === name)
|
|
62
|
+
: undefined;
|
|
63
|
+
}
|
|
64
|
+
if (field === undefined) {
|
|
43
65
|
continue;
|
|
44
66
|
}
|
|
45
67
|
const values = rowIds.length === 0 ? [] : await snapshot.fetchBlobs(source, rowIds);
|
|
46
|
-
replacements.set(
|
|
68
|
+
replacements.set(field, values.map((value) => value ?? null));
|
|
47
69
|
}
|
|
48
70
|
const result = withBinaryColumns(table, replacements);
|
|
49
71
|
if (!dropRowId) {
|
|
@@ -53,27 +75,42 @@ async function readBlobBytes(table, sources, snapshot, dropRowId) {
|
|
|
53
75
|
.map((field) => field.name)
|
|
54
76
|
.filter((name) => name !== "_rowid"));
|
|
55
77
|
}
|
|
56
|
-
// A fresh field, not a clone: the descriptor field's metadata must not follow
|
|
57
|
-
// the bytes.
|
|
58
78
|
function withBinaryColumns(table, replacements) {
|
|
59
79
|
if (replacements.size === 0) {
|
|
60
80
|
return table;
|
|
61
81
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
const replaceField = (field) => {
|
|
83
|
+
if (replacements.has(field)) {
|
|
84
|
+
// The descriptor's extension and encoding metadata must not follow bytes.
|
|
85
|
+
return new arrow_1.Field(field.name, new arrow_1.LargeBinary(), true);
|
|
86
|
+
}
|
|
87
|
+
if (arrow_1.DataType.isStruct(field.type)) {
|
|
88
|
+
const children = field.type.children.map(replaceField);
|
|
89
|
+
if (children.some((child, i) => child !== field.type.children[i])) {
|
|
90
|
+
return field.clone({ type: new arrow_1.Struct(children) });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return field;
|
|
94
|
+
};
|
|
95
|
+
const fields = table.schema.fields.map(replaceField);
|
|
65
96
|
const schema = new arrow_1.Schema(fields, table.schema.metadata);
|
|
66
97
|
let offset = 0;
|
|
67
98
|
const batches = table.batches.map((batch) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return child;
|
|
99
|
+
const replaceData = (data, field, updated) => {
|
|
100
|
+
if (field === updated) {
|
|
101
|
+
return data;
|
|
72
102
|
}
|
|
73
|
-
|
|
74
|
-
|
|
103
|
+
const values = replacements.get(field);
|
|
104
|
+
if (values !== undefined) {
|
|
105
|
+
return (0, arrow_1.vectorFromArray)(values.slice(offset, offset + batch.numRows), new arrow_1.LargeBinary()).data[0];
|
|
106
|
+
}
|
|
107
|
+
const children = data.children.map((child, index) => replaceData(child, field.type.children[index], updated.type.children[index]));
|
|
108
|
+
// Keep the struct's validity bitmap and offset, including null parents.
|
|
109
|
+
return data.clone(updated.type, undefined, undefined, undefined, undefined, children);
|
|
110
|
+
};
|
|
111
|
+
const children = batch.data.children.map((child, index) => replaceData(child, table.schema.fields[index], fields[index]));
|
|
75
112
|
offset += batch.numRows;
|
|
76
|
-
return new arrow_1.RecordBatch(schema,
|
|
113
|
+
return new arrow_1.RecordBatch(schema, batch.data.clone(new arrow_1.Struct(fields), undefined, undefined, undefined, undefined, children));
|
|
77
114
|
});
|
|
78
115
|
return new arrow_1.Table(schema, batches);
|
|
79
116
|
}
|
|
@@ -259,7 +296,7 @@ class QueryBase {
|
|
|
259
296
|
const snapshot = await context.table.querySnapshot();
|
|
260
297
|
const version = await snapshot.version();
|
|
261
298
|
const sources = blobSources(await snapshot.blobColumns(), context.projection);
|
|
262
|
-
if (sources.
|
|
299
|
+
if (sources.length === 0) {
|
|
263
300
|
return this.collect(options, false);
|
|
264
301
|
}
|
|
265
302
|
const addRowId = !context.withRowId;
|
package/dist/table.d.ts
CHANGED
|
@@ -842,7 +842,11 @@ export declare abstract class Table {
|
|
|
842
842
|
*
|
|
843
843
|
* Model-backed tokenizers such as `jieba/*` and `lindera/*` are rebuilt in
|
|
844
844
|
* the client process from index metadata. For remote tables, this means the
|
|
845
|
-
* same tokenizer model files must also exist locally
|
|
845
|
+
* same tokenizer model files must also exist locally (under
|
|
846
|
+
* `LANCE_LANGUAGE_MODEL_HOME`) and must match the files the server uses. A
|
|
847
|
+
* mismatch cannot be detected: the returned tokens may differ from what the
|
|
848
|
+
* server's index produces. If the model files are missing, an error naming
|
|
849
|
+
* the tokenizer is raised.
|
|
846
850
|
*/
|
|
847
851
|
abstract tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
|
|
848
852
|
/** Return the table as an arrow table */
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.41.0-beta.
|
|
14
|
+
"version": "0.41.0-beta.15",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
"postdocs": "node typedoc_post_process.js",
|
|
98
98
|
"lint": "biome check . && biome format .",
|
|
99
99
|
"lint-fix": "biome check --write . && biome format --write .",
|
|
100
|
-
"
|
|
100
|
+
"check:native-symbols": "node scripts/check-native-symbols.js",
|
|
101
|
+
"prepublishOnly": "pnpm check:native-symbols && napi prepublish -t npm",
|
|
101
102
|
"test": "jest --verbose",
|
|
102
103
|
"integration": "S3_TEST=1 pnpm test",
|
|
103
104
|
"universal": "napi universalize",
|
|
@@ -110,13 +111,13 @@
|
|
|
110
111
|
"optionalDependencies": {
|
|
111
112
|
"@huggingface/transformers": "3.0.2",
|
|
112
113
|
"openai": "4.29.2",
|
|
113
|
-
"@lancedb/lancedb-darwin-arm64": "0.41.0-beta.
|
|
114
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.41.0-beta.
|
|
115
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.41.0-beta.
|
|
116
|
-
"@lancedb/lancedb-linux-x64-musl": "0.41.0-beta.
|
|
117
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.41.0-beta.
|
|
118
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.41.0-beta.
|
|
119
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.41.0-beta.
|
|
114
|
+
"@lancedb/lancedb-darwin-arm64": "0.41.0-beta.15",
|
|
115
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.41.0-beta.15",
|
|
116
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.41.0-beta.15",
|
|
117
|
+
"@lancedb/lancedb-linux-x64-musl": "0.41.0-beta.15",
|
|
118
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.41.0-beta.15",
|
|
119
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.41.0-beta.15",
|
|
120
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.41.0-beta.15"
|
|
120
121
|
},
|
|
121
122
|
"peerDependencies": {
|
|
122
123
|
"@types/node": ">=22",
|