@lancedb/lancedb 0.38.0-beta.0 → 0.38.0-beta.13
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 +4 -1
- package/dist/arrow.js +35 -282
- package/dist/arrow_type.d.ts +9 -0
- package/dist/arrow_type.js +29 -0
- package/dist/connection.d.ts +96 -2
- package/dist/connection.js +23 -0
- package/dist/embedding/index.d.ts +11 -1
- package/dist/embedding/index.js +24 -17
- package/dist/embedding/openai.js +3 -15
- package/dist/embedding/registry.d.ts +21 -1
- package/dist/embedding/registry.js +76 -20
- package/dist/embedding/transformers.js +3 -15
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -1
- package/dist/materialized_view.d.ts +69 -0
- package/dist/materialized_view.js +112 -0
- package/dist/native.d.ts +115 -1
- package/dist/native.js +52 -52
- package/dist/query.d.ts +38 -2
- package/dist/query.js +154 -101
- package/dist/sanitize.js +10 -4
- package/dist/schema.d.ts +16 -0
- package/dist/schema.js +387 -0
- package/dist/table.d.ts +156 -23
- package/dist/table.js +55 -15
- package/package.json +10 -10
package/dist/table.js
CHANGED
|
@@ -51,8 +51,9 @@ class LocalTable extends Table {
|
|
|
51
51
|
display() {
|
|
52
52
|
return this.inner.display();
|
|
53
53
|
}
|
|
54
|
-
async getEmbeddingFunctions() {
|
|
55
|
-
const
|
|
54
|
+
async getEmbeddingFunctions(inner = this.inner) {
|
|
55
|
+
const schemaBuf = await inner.schema();
|
|
56
|
+
const schema = (0, arrow_1.tableFromIPC)(schemaBuf).schema;
|
|
56
57
|
const registry = (0, registry_1.getRegistry)();
|
|
57
58
|
return registry.parseFunctions(schema.metadata);
|
|
58
59
|
}
|
|
@@ -193,12 +194,24 @@ class LocalTable extends Table {
|
|
|
193
194
|
columns: ftsColumns,
|
|
194
195
|
});
|
|
195
196
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
197
|
+
if (queryType === "auto") {
|
|
198
|
+
if ((0, query_1.instanceOfFullTextQuery)(query)) {
|
|
199
|
+
return this.query().fullTextSearch(query, {
|
|
200
|
+
columns: ftsColumns,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
const columns = typeof ftsColumns === "string" ? [ftsColumns] : (ftsColumns ?? null);
|
|
204
|
+
return (0, query_1.createAutoQuery)(this.inner, query, columns, async (metadata) => {
|
|
205
|
+
const functions = await (0, registry_1.getRegistry)().parseFunctions(new Map([["embedding_functions", metadata]]));
|
|
206
|
+
// TODO: Support multiple embedding functions
|
|
207
|
+
const embeddingFunc = functions
|
|
208
|
+
.values()
|
|
209
|
+
.next().value;
|
|
210
|
+
// The route only calls this callback when embedding metadata exists.
|
|
211
|
+
// parseFunctions either yields a provider or reports malformed metadata.
|
|
212
|
+
if (!embeddingFunc)
|
|
213
|
+
throw new Error("Invalid embedding function metadata");
|
|
214
|
+
return await embeddingFunc.function.computeQueryEmbeddings(query);
|
|
202
215
|
});
|
|
203
216
|
}
|
|
204
217
|
const queryPromise = this.getEmbeddingFunctions().then(async (functions) => {
|
|
@@ -225,6 +238,12 @@ class LocalTable extends Table {
|
|
|
225
238
|
}
|
|
226
239
|
// TODO: Support BatchUDF
|
|
227
240
|
async addColumns(newColumnTransforms) {
|
|
241
|
+
// Columns defined by an expression are declared, not materialized here.
|
|
242
|
+
if (typeof newColumnTransforms === "object" &&
|
|
243
|
+
!Array.isArray(newColumnTransforms) &&
|
|
244
|
+
"computed" in newColumnTransforms) {
|
|
245
|
+
return await this.inner.addComputedColumns(newColumnTransforms.computed);
|
|
246
|
+
}
|
|
228
247
|
// Handle single Field -> convert to array of Fields
|
|
229
248
|
if (newColumnTransforms instanceof arrow_1.Field) {
|
|
230
249
|
newColumnTransforms = [newColumnTransforms];
|
|
@@ -250,6 +269,15 @@ class LocalTable extends Table {
|
|
|
250
269
|
}
|
|
251
270
|
throw new Error("Invalid input type for addColumns");
|
|
252
271
|
}
|
|
272
|
+
async refreshColumn(column) {
|
|
273
|
+
return await this.inner.refreshColumn(column);
|
|
274
|
+
}
|
|
275
|
+
async refreshColumnAsync(column) {
|
|
276
|
+
return await this.inner.refreshColumnAsync(column);
|
|
277
|
+
}
|
|
278
|
+
async refreshMaterializedView(full, sourceVersion) {
|
|
279
|
+
return await this.inner.refreshMaterializedView(full, sourceVersion);
|
|
280
|
+
}
|
|
253
281
|
async alterColumns(columnAlterations) {
|
|
254
282
|
const processedAlterations = columnAlterations.map((alteration) => {
|
|
255
283
|
if (typeof alteration.dataType === "string") {
|
|
@@ -299,6 +327,18 @@ class LocalTable extends Table {
|
|
|
299
327
|
async closeLsmWriters() {
|
|
300
328
|
return await this.inner.closeLsmWriters();
|
|
301
329
|
}
|
|
330
|
+
async flushLsm() {
|
|
331
|
+
return await this.inner.flushLsm();
|
|
332
|
+
}
|
|
333
|
+
async compactLsm() {
|
|
334
|
+
return await this.inner.compactLsm();
|
|
335
|
+
}
|
|
336
|
+
async checkpointLsm() {
|
|
337
|
+
return await this.inner.checkpointLsm();
|
|
338
|
+
}
|
|
339
|
+
async getLsmStats(includeGenerationRows = false) {
|
|
340
|
+
return (await this.inner.getLsmStats(includeGenerationRows)) ?? undefined;
|
|
341
|
+
}
|
|
302
342
|
async version() {
|
|
303
343
|
return await this.inner.version();
|
|
304
344
|
}
|
|
@@ -443,16 +483,16 @@ class Branches {
|
|
|
443
483
|
return (await this.#inner.diff(fromBranch));
|
|
444
484
|
}
|
|
445
485
|
/**
|
|
446
|
-
*
|
|
486
|
+
* Cherry-pick a branch onto main.
|
|
447
487
|
*
|
|
448
|
-
* Set `dryRun` to `true` to preview
|
|
449
|
-
* with `status: "
|
|
488
|
+
* Set `dryRun` to `true` to preview. A failed cherry-pick resolves
|
|
489
|
+
* with `status: "failed"` instead of throwing.
|
|
450
490
|
*
|
|
451
|
-
* @param fromBranch Branch to
|
|
452
|
-
* @param dryRun When true, only preview
|
|
491
|
+
* @param fromBranch Branch to cherry-pick from.
|
|
492
|
+
* @param dryRun When true, only preview. Defaults to false.
|
|
453
493
|
*/
|
|
454
|
-
async
|
|
455
|
-
return (await this.#inner.
|
|
494
|
+
async cherryPick(fromBranch, dryRun = false) {
|
|
495
|
+
return (await this.#inner.cherryPick(fromBranch, dryRun));
|
|
456
496
|
}
|
|
457
497
|
}
|
|
458
498
|
exports.Branches = Branches;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.38.0-beta.
|
|
14
|
+
"version": "0.38.0-beta.13",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"timeout": "3m"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
|
-
"node": ">=
|
|
70
|
+
"node": ">= 22"
|
|
71
71
|
},
|
|
72
72
|
"packageManager": "pnpm@11.1.1",
|
|
73
73
|
"cpu": [
|
|
@@ -106,16 +106,16 @@
|
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"@huggingface/transformers": "3.0.2",
|
|
108
108
|
"openai": "4.29.2",
|
|
109
|
-
"@lancedb/lancedb-darwin-arm64": "0.38.0-beta.
|
|
110
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.38.0-beta.
|
|
111
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.38.0-beta.
|
|
112
|
-
"@lancedb/lancedb-linux-x64-musl": "0.38.0-beta.
|
|
113
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.38.0-beta.
|
|
114
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.38.0-beta.
|
|
115
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.38.0-beta.
|
|
109
|
+
"@lancedb/lancedb-darwin-arm64": "0.38.0-beta.13",
|
|
110
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.38.0-beta.13",
|
|
111
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.38.0-beta.13",
|
|
112
|
+
"@lancedb/lancedb-linux-x64-musl": "0.38.0-beta.13",
|
|
113
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.38.0-beta.13",
|
|
114
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.38.0-beta.13",
|
|
115
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.38.0-beta.13"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
|
-
"@types/node": ">=
|
|
118
|
+
"@types/node": ">=22",
|
|
119
119
|
"apache-arrow": ">=15.0.0 <=18.1.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependenciesMeta": {
|