@dengxifeng/lancedb 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -0
- package/CONTRIBUTING.md +76 -0
- package/README.md +37 -0
- package/dist/arrow.d.ts +279 -0
- package/dist/arrow.js +1316 -0
- package/dist/connection.d.ts +259 -0
- package/dist/connection.js +224 -0
- package/dist/embedding/embedding_function.d.ts +103 -0
- package/dist/embedding/embedding_function.js +192 -0
- package/dist/embedding/index.d.ts +27 -0
- package/dist/embedding/index.js +101 -0
- package/dist/embedding/openai.d.ts +16 -0
- package/dist/embedding/openai.js +93 -0
- package/dist/embedding/registry.d.ts +74 -0
- package/dist/embedding/registry.js +165 -0
- package/dist/embedding/transformers.d.ts +36 -0
- package/dist/embedding/transformers.js +122 -0
- package/dist/header.d.ts +162 -0
- package/dist/header.js +217 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +106 -0
- package/dist/indices.d.ts +692 -0
- package/dist/indices.js +156 -0
- package/dist/merge.d.ts +80 -0
- package/dist/merge.js +92 -0
- package/dist/native.d.ts +585 -0
- package/dist/native.js +339 -0
- package/dist/permutation.d.ts +143 -0
- package/dist/permutation.js +184 -0
- package/dist/query.d.ts +581 -0
- package/dist/query.js +853 -0
- package/dist/rerankers/index.d.ts +5 -0
- package/dist/rerankers/index.js +19 -0
- package/dist/rerankers/rrf.d.ts +14 -0
- package/dist/rerankers/rrf.js +28 -0
- package/dist/sanitize.d.ts +32 -0
- package/dist/sanitize.js +473 -0
- package/dist/table.d.ts +581 -0
- package/dist/table.js +321 -0
- package/dist/util.d.ts +14 -0
- package/dist/util.js +77 -0
- package/license_header.txt +2 -0
- package/package.json +122 -0
package/dist/table.js
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
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.LocalTable = exports.Table = void 0;
|
|
6
|
+
const arrow_1 = require("./arrow");
|
|
7
|
+
const registry_1 = require("./embedding/registry");
|
|
8
|
+
const merge_1 = require("./merge");
|
|
9
|
+
const query_1 = require("./query");
|
|
10
|
+
const sanitize_1 = require("./sanitize");
|
|
11
|
+
const util_1 = require("./util");
|
|
12
|
+
/**
|
|
13
|
+
* A Table is a collection of Records in a LanceDB Database.
|
|
14
|
+
*
|
|
15
|
+
* A Table object is expected to be long lived and reused for multiple operations.
|
|
16
|
+
* Table objects will cache a certain amount of index data in memory. This cache
|
|
17
|
+
* will be freed when the Table is garbage collected. To eagerly free the cache you
|
|
18
|
+
* can call the `close` method. Once the Table is closed, it cannot be used for any
|
|
19
|
+
* further operations.
|
|
20
|
+
*
|
|
21
|
+
* Tables are created using the methods {@link Connection#createTable}
|
|
22
|
+
* and {@link Connection#createEmptyTable}. Existing tables are opened
|
|
23
|
+
* using {@link Connection#openTable}.
|
|
24
|
+
*
|
|
25
|
+
* Closing a table is optional. It not closed, it will be closed when it is garbage
|
|
26
|
+
* collected.
|
|
27
|
+
*
|
|
28
|
+
* @hideconstructor
|
|
29
|
+
*/
|
|
30
|
+
class Table {
|
|
31
|
+
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
32
|
+
return this.display();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.Table = Table;
|
|
36
|
+
class LocalTable extends Table {
|
|
37
|
+
inner;
|
|
38
|
+
constructor(inner) {
|
|
39
|
+
super();
|
|
40
|
+
this.inner = inner;
|
|
41
|
+
}
|
|
42
|
+
get name() {
|
|
43
|
+
return this.inner.name;
|
|
44
|
+
}
|
|
45
|
+
isOpen() {
|
|
46
|
+
return this.inner.isOpen();
|
|
47
|
+
}
|
|
48
|
+
close() {
|
|
49
|
+
this.inner.close();
|
|
50
|
+
}
|
|
51
|
+
display() {
|
|
52
|
+
return this.inner.display();
|
|
53
|
+
}
|
|
54
|
+
async getEmbeddingFunctions() {
|
|
55
|
+
const schema = await this.schema();
|
|
56
|
+
const registry = (0, registry_1.getRegistry)();
|
|
57
|
+
return registry.parseFunctions(schema.metadata);
|
|
58
|
+
}
|
|
59
|
+
/** Get the schema of the table. */
|
|
60
|
+
async schema() {
|
|
61
|
+
const schemaBuf = await this.inner.schema();
|
|
62
|
+
const tbl = (0, arrow_1.tableFromIPC)(schemaBuf);
|
|
63
|
+
return tbl.schema;
|
|
64
|
+
}
|
|
65
|
+
async add(data, options) {
|
|
66
|
+
const mode = options?.mode ?? "append";
|
|
67
|
+
const schema = await this.schema();
|
|
68
|
+
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema);
|
|
69
|
+
return await this.inner.add(buffer, mode);
|
|
70
|
+
}
|
|
71
|
+
async update(optsOrUpdates, options) {
|
|
72
|
+
const isValues = "values" in optsOrUpdates && typeof optsOrUpdates.values !== "string";
|
|
73
|
+
const isValuesSql = "valuesSql" in optsOrUpdates &&
|
|
74
|
+
typeof optsOrUpdates.valuesSql !== "string";
|
|
75
|
+
const isMap = (obj) => {
|
|
76
|
+
return obj instanceof Map;
|
|
77
|
+
};
|
|
78
|
+
let predicate;
|
|
79
|
+
let columns;
|
|
80
|
+
switch (true) {
|
|
81
|
+
case isMap(optsOrUpdates):
|
|
82
|
+
columns = Array.from(optsOrUpdates.entries());
|
|
83
|
+
predicate = options?.where;
|
|
84
|
+
break;
|
|
85
|
+
case isValues && isMap(optsOrUpdates.values):
|
|
86
|
+
columns = Array.from(optsOrUpdates.values.entries()).map(([k, v]) => [
|
|
87
|
+
k,
|
|
88
|
+
(0, util_1.toSQL)(v),
|
|
89
|
+
]);
|
|
90
|
+
predicate = optsOrUpdates.where;
|
|
91
|
+
break;
|
|
92
|
+
case isValues && !isMap(optsOrUpdates.values):
|
|
93
|
+
columns = Object.entries(optsOrUpdates.values).map(([k, v]) => [
|
|
94
|
+
k,
|
|
95
|
+
(0, util_1.toSQL)(v),
|
|
96
|
+
]);
|
|
97
|
+
predicate = optsOrUpdates.where;
|
|
98
|
+
break;
|
|
99
|
+
case isValuesSql && isMap(optsOrUpdates.valuesSql):
|
|
100
|
+
columns = Array.from(optsOrUpdates.valuesSql.entries());
|
|
101
|
+
predicate = optsOrUpdates.where;
|
|
102
|
+
break;
|
|
103
|
+
case isValuesSql && !isMap(optsOrUpdates.valuesSql):
|
|
104
|
+
columns = Object.entries(optsOrUpdates.valuesSql).map(([k, v]) => [
|
|
105
|
+
k,
|
|
106
|
+
v,
|
|
107
|
+
]);
|
|
108
|
+
predicate = optsOrUpdates.where;
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
columns = Object.entries(optsOrUpdates);
|
|
112
|
+
predicate = options?.where;
|
|
113
|
+
}
|
|
114
|
+
return await this.inner.update(predicate, columns);
|
|
115
|
+
}
|
|
116
|
+
async countRows(filter) {
|
|
117
|
+
return await this.inner.countRows(filter);
|
|
118
|
+
}
|
|
119
|
+
async delete(predicate) {
|
|
120
|
+
return await this.inner.delete(predicate);
|
|
121
|
+
}
|
|
122
|
+
async createIndex(column, options) {
|
|
123
|
+
// Bit of a hack to get around the fact that TS has no package-scope.
|
|
124
|
+
// biome-ignore lint/suspicious/noExplicitAny: skip
|
|
125
|
+
const nativeIndex = options?.config?.inner;
|
|
126
|
+
await this.inner.createIndex(nativeIndex, column, options?.replace, options?.waitTimeoutSeconds, options?.name, options?.train);
|
|
127
|
+
}
|
|
128
|
+
async dropIndex(name) {
|
|
129
|
+
await this.inner.dropIndex(name);
|
|
130
|
+
}
|
|
131
|
+
async prewarmIndex(name) {
|
|
132
|
+
await this.inner.prewarmIndex(name);
|
|
133
|
+
}
|
|
134
|
+
async waitForIndex(indexNames, timeoutSeconds) {
|
|
135
|
+
await this.inner.waitForIndex(indexNames, timeoutSeconds);
|
|
136
|
+
}
|
|
137
|
+
takeOffsets(offsets) {
|
|
138
|
+
return new query_1.TakeQuery(this.inner.takeOffsets(offsets));
|
|
139
|
+
}
|
|
140
|
+
takeRowIds(rowIds) {
|
|
141
|
+
const ids = rowIds.map((id) => {
|
|
142
|
+
if (typeof id === "bigint") {
|
|
143
|
+
return id;
|
|
144
|
+
}
|
|
145
|
+
if (!Number.isInteger(id)) {
|
|
146
|
+
throw new Error("Row id must be an integer (or bigint)");
|
|
147
|
+
}
|
|
148
|
+
if (id < 0) {
|
|
149
|
+
throw new Error("Row id cannot be negative");
|
|
150
|
+
}
|
|
151
|
+
if (!Number.isSafeInteger(id)) {
|
|
152
|
+
throw new Error("Row id is too large for number; use bigint instead");
|
|
153
|
+
}
|
|
154
|
+
return BigInt(id);
|
|
155
|
+
});
|
|
156
|
+
return new query_1.TakeQuery(this.inner.takeRowIds(ids));
|
|
157
|
+
}
|
|
158
|
+
query() {
|
|
159
|
+
return new query_1.Query(this.inner);
|
|
160
|
+
}
|
|
161
|
+
search(query, queryType = "auto", ftsColumns) {
|
|
162
|
+
if (typeof query !== "string" && !(0, query_1.instanceOfFullTextQuery)(query)) {
|
|
163
|
+
if (queryType === "fts") {
|
|
164
|
+
throw new Error("Cannot perform full text search on a vector query");
|
|
165
|
+
}
|
|
166
|
+
return this.vectorSearch(query);
|
|
167
|
+
}
|
|
168
|
+
// If the query is a string, we need to determine if it is a vector query or a full text search query
|
|
169
|
+
if (queryType === "fts") {
|
|
170
|
+
return this.query().fullTextSearch(query, {
|
|
171
|
+
columns: ftsColumns,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
// The query type is auto or vector
|
|
175
|
+
// fall back to full text search if no embedding functions are defined and the query is a string
|
|
176
|
+
if (queryType === "auto" &&
|
|
177
|
+
((0, registry_1.getRegistry)().length() === 0 || (0, query_1.instanceOfFullTextQuery)(query))) {
|
|
178
|
+
return this.query().fullTextSearch(query, {
|
|
179
|
+
columns: ftsColumns,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
const queryPromise = this.getEmbeddingFunctions().then(async (functions) => {
|
|
183
|
+
// TODO: Support multiple embedding functions
|
|
184
|
+
const embeddingFunc = functions
|
|
185
|
+
.values()
|
|
186
|
+
.next().value;
|
|
187
|
+
if (!embeddingFunc) {
|
|
188
|
+
return Promise.reject(new Error("No embedding functions are defined in the table"));
|
|
189
|
+
}
|
|
190
|
+
return await embeddingFunc.function.computeQueryEmbeddings(query);
|
|
191
|
+
});
|
|
192
|
+
return this.query().nearestTo(queryPromise);
|
|
193
|
+
}
|
|
194
|
+
vectorSearch(vector) {
|
|
195
|
+
if ((0, arrow_1.isMultiVector)(vector)) {
|
|
196
|
+
const query = this.query().nearestTo(vector[0]);
|
|
197
|
+
for (const v of vector.slice(1)) {
|
|
198
|
+
query.addQueryVector(v);
|
|
199
|
+
}
|
|
200
|
+
return query;
|
|
201
|
+
}
|
|
202
|
+
return this.query().nearestTo(vector);
|
|
203
|
+
}
|
|
204
|
+
// TODO: Support BatchUDF
|
|
205
|
+
async addColumns(newColumnTransforms) {
|
|
206
|
+
return await this.inner.addColumns(newColumnTransforms);
|
|
207
|
+
}
|
|
208
|
+
async alterColumns(columnAlterations) {
|
|
209
|
+
const processedAlterations = columnAlterations.map((alteration) => {
|
|
210
|
+
if (typeof alteration.dataType === "string") {
|
|
211
|
+
return {
|
|
212
|
+
...alteration,
|
|
213
|
+
dataType: JSON.stringify({ type: alteration.dataType }),
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
else if (alteration.dataType === undefined) {
|
|
217
|
+
return {
|
|
218
|
+
...alteration,
|
|
219
|
+
dataType: undefined,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
const dataType = (0, sanitize_1.sanitizeType)(alteration.dataType);
|
|
224
|
+
return {
|
|
225
|
+
...alteration,
|
|
226
|
+
dataType: JSON.stringify((0, arrow_1.dataTypeToJson)(dataType)),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
return await this.inner.alterColumns(processedAlterations);
|
|
231
|
+
}
|
|
232
|
+
async dropColumns(columnNames) {
|
|
233
|
+
return await this.inner.dropColumns(columnNames);
|
|
234
|
+
}
|
|
235
|
+
async version() {
|
|
236
|
+
return await this.inner.version();
|
|
237
|
+
}
|
|
238
|
+
async checkout(version) {
|
|
239
|
+
if (typeof version === "string") {
|
|
240
|
+
return this.inner.checkoutTag(version);
|
|
241
|
+
}
|
|
242
|
+
return this.inner.checkout(version);
|
|
243
|
+
}
|
|
244
|
+
async checkoutLatest() {
|
|
245
|
+
await this.inner.checkoutLatest();
|
|
246
|
+
}
|
|
247
|
+
async listVersions() {
|
|
248
|
+
return (await this.inner.listVersions()).map((version) => ({
|
|
249
|
+
version: version.version,
|
|
250
|
+
timestamp: new Date(version.timestamp / 1000),
|
|
251
|
+
metadata: version.metadata,
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
async restore() {
|
|
255
|
+
await this.inner.restore();
|
|
256
|
+
}
|
|
257
|
+
async tags() {
|
|
258
|
+
return await this.inner.tags();
|
|
259
|
+
}
|
|
260
|
+
async optimize(options) {
|
|
261
|
+
let cleanupOlderThanMs;
|
|
262
|
+
if (options?.cleanupOlderThan !== undefined &&
|
|
263
|
+
options?.cleanupOlderThan !== null) {
|
|
264
|
+
cleanupOlderThanMs =
|
|
265
|
+
new Date().getTime() - options.cleanupOlderThan.getTime();
|
|
266
|
+
}
|
|
267
|
+
return await this.inner.optimize(cleanupOlderThanMs, options?.deleteUnverified);
|
|
268
|
+
}
|
|
269
|
+
async listIndices() {
|
|
270
|
+
return await this.inner.listIndices();
|
|
271
|
+
}
|
|
272
|
+
async toArrow() {
|
|
273
|
+
return await this.query().toArrow();
|
|
274
|
+
}
|
|
275
|
+
async indexStats(name) {
|
|
276
|
+
const stats = await this.inner.indexStats(name);
|
|
277
|
+
if (stats === null) {
|
|
278
|
+
return undefined;
|
|
279
|
+
}
|
|
280
|
+
return stats;
|
|
281
|
+
}
|
|
282
|
+
async stats() {
|
|
283
|
+
return await this.inner.stats();
|
|
284
|
+
}
|
|
285
|
+
async initialStorageOptions() {
|
|
286
|
+
return await this.inner.initialStorageOptions();
|
|
287
|
+
}
|
|
288
|
+
async latestStorageOptions() {
|
|
289
|
+
return await this.inner.latestStorageOptions();
|
|
290
|
+
}
|
|
291
|
+
mergeInsert(on) {
|
|
292
|
+
on = Array.isArray(on) ? on : [on];
|
|
293
|
+
return new merge_1.MergeInsertBuilder(this.inner.mergeInsert(on), this.schema());
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Check if the table uses the new manifest path scheme.
|
|
297
|
+
*
|
|
298
|
+
* This function will return true if the table uses the V2 manifest
|
|
299
|
+
* path scheme.
|
|
300
|
+
*/
|
|
301
|
+
async usesV2ManifestPaths() {
|
|
302
|
+
return await this.inner.usesV2ManifestPaths();
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Migrate the table to use the new manifest path scheme.
|
|
306
|
+
*
|
|
307
|
+
* This function will rename all V1 manifests to V2 manifest paths.
|
|
308
|
+
* These paths provide more efficient opening of datasets with many versions
|
|
309
|
+
* on object stores.
|
|
310
|
+
*
|
|
311
|
+
* This function is idempotent, and can be run multiple times without
|
|
312
|
+
* changing the state of the object store.
|
|
313
|
+
*
|
|
314
|
+
* However, it should not be run while other concurrent operations are happening.
|
|
315
|
+
* And it should also run until completion before resuming other operations.
|
|
316
|
+
*/
|
|
317
|
+
async migrateManifestPathsV2() {
|
|
318
|
+
await this.inner.migrateManifestPathsV2();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
exports.LocalTable = LocalTable;
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type IntoSql = string | number | boolean | null | Date | ArrayBufferLike | Buffer | IntoSql[];
|
|
2
|
+
export declare function toSQL(value: IntoSql): string;
|
|
3
|
+
export declare function packBits(data: Array<number>): Array<number>;
|
|
4
|
+
export declare class TTLCache {
|
|
5
|
+
private readonly ttl;
|
|
6
|
+
private readonly cache;
|
|
7
|
+
/**
|
|
8
|
+
* @param ttl Time to live in milliseconds
|
|
9
|
+
*/
|
|
10
|
+
constructor(ttl: number);
|
|
11
|
+
get(key: string): any | undefined;
|
|
12
|
+
set(key: string, value: any): void;
|
|
13
|
+
delete(key: string): void;
|
|
14
|
+
}
|
package/dist/util.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
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.TTLCache = void 0;
|
|
6
|
+
exports.toSQL = toSQL;
|
|
7
|
+
exports.packBits = packBits;
|
|
8
|
+
function toSQL(value) {
|
|
9
|
+
if (typeof value === "string") {
|
|
10
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
11
|
+
}
|
|
12
|
+
else if (typeof value === "number") {
|
|
13
|
+
return value.toString();
|
|
14
|
+
}
|
|
15
|
+
else if (typeof value === "boolean") {
|
|
16
|
+
return value ? "TRUE" : "FALSE";
|
|
17
|
+
}
|
|
18
|
+
else if (value === null) {
|
|
19
|
+
return "NULL";
|
|
20
|
+
}
|
|
21
|
+
else if (value instanceof Date) {
|
|
22
|
+
return `'${value.toISOString()}'`;
|
|
23
|
+
}
|
|
24
|
+
else if (Array.isArray(value)) {
|
|
25
|
+
return `[${value.map(toSQL).join(", ")}]`;
|
|
26
|
+
}
|
|
27
|
+
else if (Buffer.isBuffer(value)) {
|
|
28
|
+
return `X'${value.toString("hex")}'`;
|
|
29
|
+
}
|
|
30
|
+
else if (value instanceof ArrayBuffer) {
|
|
31
|
+
return `X'${Buffer.from(value).toString("hex")}'`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw new Error(`Unsupported value type: ${typeof value} value: (${value})`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function packBits(data) {
|
|
38
|
+
const packed = Array(data.length >> 3).fill(0);
|
|
39
|
+
for (let i = 0; i < data.length; i++) {
|
|
40
|
+
const byte = i >> 3;
|
|
41
|
+
const bit = i & 7;
|
|
42
|
+
packed[byte] |= data[i] << bit;
|
|
43
|
+
}
|
|
44
|
+
return packed;
|
|
45
|
+
}
|
|
46
|
+
class TTLCache {
|
|
47
|
+
ttl;
|
|
48
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
49
|
+
cache;
|
|
50
|
+
/**
|
|
51
|
+
* @param ttl Time to live in milliseconds
|
|
52
|
+
*/
|
|
53
|
+
constructor(ttl) {
|
|
54
|
+
this.ttl = ttl;
|
|
55
|
+
this.cache = new Map();
|
|
56
|
+
}
|
|
57
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
58
|
+
get(key) {
|
|
59
|
+
const entry = this.cache.get(key);
|
|
60
|
+
if (entry === undefined) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
if (entry.expires < Date.now()) {
|
|
64
|
+
this.cache.delete(key);
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
return entry.value;
|
|
68
|
+
}
|
|
69
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
70
|
+
set(key, value) {
|
|
71
|
+
this.cache.set(key, { value, expires: Date.now() + this.ttl });
|
|
72
|
+
}
|
|
73
|
+
delete(key) {
|
|
74
|
+
this.cache.delete(key);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.TTLCache = TTLCache;
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dengxifeng/lancedb",
|
|
3
|
+
"description": "LanceDB: A serverless, low-latency vector database for AI applications",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"database",
|
|
6
|
+
"lance",
|
|
7
|
+
"lancedb",
|
|
8
|
+
"search",
|
|
9
|
+
"vector",
|
|
10
|
+
"vector database",
|
|
11
|
+
"ann"
|
|
12
|
+
],
|
|
13
|
+
"private": false,
|
|
14
|
+
"version": "0.26.2",
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.js",
|
|
18
|
+
"./embedding": "./dist/embedding/index.js",
|
|
19
|
+
"./embedding/openai": "./dist/embedding/openai.js",
|
|
20
|
+
"./embedding/transformers": "./dist/embedding/transformers.js"
|
|
21
|
+
},
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"napi": {
|
|
24
|
+
"name": "lancedb",
|
|
25
|
+
"triples": {
|
|
26
|
+
"defaults": false,
|
|
27
|
+
"additional": [
|
|
28
|
+
"aarch64-apple-darwin",
|
|
29
|
+
"x86_64-unknown-linux-gnu",
|
|
30
|
+
"aarch64-unknown-linux-gnu",
|
|
31
|
+
"riscv64-unknown-linux-gnu",
|
|
32
|
+
"x86_64-unknown-linux-musl",
|
|
33
|
+
"aarch64-unknown-linux-musl",
|
|
34
|
+
"x86_64-pc-windows-msvc",
|
|
35
|
+
"aarch64-pc-windows-msvc"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"license": "Apache-2.0",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/lancedb/lancedb"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@aws-sdk/client-dynamodb": "^3.33.0",
|
|
46
|
+
"@aws-sdk/client-kms": "^3.33.0",
|
|
47
|
+
"@aws-sdk/client-s3": "^3.33.0",
|
|
48
|
+
"@biomejs/biome": "^1.7.3",
|
|
49
|
+
"@jest/globals": "^29.7.0",
|
|
50
|
+
"@napi-rs/cli": "^2.18.3",
|
|
51
|
+
"@types/axios": "^0.14.0",
|
|
52
|
+
"@types/jest": "^29.1.2",
|
|
53
|
+
"@types/node": "^22.7.4",
|
|
54
|
+
"@types/tmp": "^0.2.6",
|
|
55
|
+
"apache-arrow-15": "npm:apache-arrow@15.0.0",
|
|
56
|
+
"apache-arrow-16": "npm:apache-arrow@16.0.0",
|
|
57
|
+
"apache-arrow-17": "npm:apache-arrow@17.0.0",
|
|
58
|
+
"apache-arrow-18": "npm:apache-arrow@18.0.0",
|
|
59
|
+
"eslint": "^8.57.0",
|
|
60
|
+
"jest": "^29.7.0",
|
|
61
|
+
"shx": "^0.3.4",
|
|
62
|
+
"tmp": "^0.2.3",
|
|
63
|
+
"ts-jest": "^29.1.2",
|
|
64
|
+
"typedoc": "^0.26.4",
|
|
65
|
+
"typedoc-plugin-markdown": "^4.2.1",
|
|
66
|
+
"typescript": "^5.5.4",
|
|
67
|
+
"typescript-eslint": "^7.1.0"
|
|
68
|
+
},
|
|
69
|
+
"ava": {
|
|
70
|
+
"timeout": "3m"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">= 18"
|
|
74
|
+
},
|
|
75
|
+
"cpu": [
|
|
76
|
+
"x64",
|
|
77
|
+
"arm64",
|
|
78
|
+
"riscv64"
|
|
79
|
+
],
|
|
80
|
+
"os": [
|
|
81
|
+
"darwin",
|
|
82
|
+
"linux",
|
|
83
|
+
"win32"
|
|
84
|
+
],
|
|
85
|
+
"scripts": {
|
|
86
|
+
"artifacts": "napi artifacts",
|
|
87
|
+
"build:debug": "napi build --platform --no-const-enum --dts ../lancedb/native.d.ts --js ../lancedb/native.js lancedb",
|
|
88
|
+
"postbuild:debug": "shx mkdir -p dist && shx cp lancedb/*.node dist/",
|
|
89
|
+
"build:release": "napi build --platform --no-const-enum --release --dts ../lancedb/native.d.ts --js ../lancedb/native.js dist/",
|
|
90
|
+
"postbuild:release": "shx mkdir -p dist",
|
|
91
|
+
"build": "npm run build:debug && npm run tsc",
|
|
92
|
+
"build-release": "npm run build:release && npm run tsc",
|
|
93
|
+
"tsc": "tsc -b",
|
|
94
|
+
"posttsc": "shx cp lancedb/native.d.ts dist/native.d.ts",
|
|
95
|
+
"lint-ci": "biome ci .",
|
|
96
|
+
"docs": "typedoc --plugin typedoc-plugin-markdown --treatWarningsAsErrors --out ../docs/src/js lancedb/index.ts",
|
|
97
|
+
"postdocs": "node typedoc_post_process.js",
|
|
98
|
+
"lint": "biome check . && biome format .",
|
|
99
|
+
"lint-fix": "biome check --write . && biome format --write .",
|
|
100
|
+
"prepublishOnly": "napi prepublish -t npm",
|
|
101
|
+
"test": "jest --verbose",
|
|
102
|
+
"integration": "S3_TEST=1 npm run test",
|
|
103
|
+
"universal": "napi universal",
|
|
104
|
+
"version": "napi version"
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"reflect-metadata": "^0.2.2"
|
|
108
|
+
},
|
|
109
|
+
"optionalDependencies": {
|
|
110
|
+
"@lancedb/lancedb-darwin-arm64": "0.26.2",
|
|
111
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.26.2",
|
|
112
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.26.2",
|
|
113
|
+
"@dengxifeng/lancedb-linux-riscv64-gnu": "0.26.2",
|
|
114
|
+
"@lancedb/lancedb-linux-x64-musl": "0.26.2",
|
|
115
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.26.2",
|
|
116
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.26.2",
|
|
117
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.26.2"
|
|
118
|
+
},
|
|
119
|
+
"peerDependencies": {
|
|
120
|
+
"apache-arrow": ">=15.0.0 <=18.1.0"
|
|
121
|
+
}
|
|
122
|
+
}
|