@lancedb/lancedb 0.28.0-beta.9 → 0.29.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -6
- package/CONTRIBUTING.md +15 -13
- package/dist/arrow.d.ts +6 -0
- package/dist/arrow.js +10 -0
- package/dist/connection.d.ts +74 -0
- package/dist/connection.js +15 -0
- package/dist/index.d.ts +118 -5
- package/dist/index.js +48 -1
- package/dist/native.d.ts +122 -0
- package/dist/native.js +53 -52
- package/dist/query.d.ts +10 -0
- package/dist/query.js +14 -0
- package/dist/scannable.d.ts +92 -0
- package/dist/scannable.js +200 -0
- package/dist/table.d.ts +90 -0
- package/dist/table.js +13 -0
- package/package.json +21 -21
- package/pnpm-workspace.yaml +18 -0
|
@@ -0,0 +1,200 @@
|
|
|
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.Scannable = void 0;
|
|
6
|
+
const arrow_1 = require("./arrow");
|
|
7
|
+
const native_js_1 = require("./native.js");
|
|
8
|
+
/**
|
|
9
|
+
* A data source that can be scanned as a stream of Arrow `RecordBatch`es.
|
|
10
|
+
*
|
|
11
|
+
* `Scannable` wraps the schema + optional row count + rescannable flag and
|
|
12
|
+
* a callback that yields batches one at a time. It is passed to consumers
|
|
13
|
+
* (e.g. `Table.add`, `createTable`, `mergeInsert` — follow-up work) that
|
|
14
|
+
* need to pull data without materializing the full dataset in JS memory.
|
|
15
|
+
*
|
|
16
|
+
* Batches cross the JS↔Rust boundary as Arrow IPC Stream messages; a fresh
|
|
17
|
+
* writer serializes each batch, and the Rust side decodes it with
|
|
18
|
+
* `arrow_ipc::reader::StreamReader`. One batch is in flight at a time.
|
|
19
|
+
*/
|
|
20
|
+
class Scannable {
|
|
21
|
+
schema;
|
|
22
|
+
numRows;
|
|
23
|
+
rescannable;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
native;
|
|
26
|
+
constructor(native, schema, numRows, rescannable) {
|
|
27
|
+
this.native = native;
|
|
28
|
+
this.schema = schema;
|
|
29
|
+
this.numRows = numRows;
|
|
30
|
+
this.rescannable = rescannable;
|
|
31
|
+
}
|
|
32
|
+
/** @hidden Access the native handle for passing through to Rust consumers. */
|
|
33
|
+
get inner() {
|
|
34
|
+
return this.native;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build a Scannable from an explicit schema and a factory that returns a
|
|
38
|
+
* fresh batch iterator on each call.
|
|
39
|
+
*
|
|
40
|
+
* The factory is invoked once per scan. Each iterator yields
|
|
41
|
+
* `RecordBatch`es matching the declared schema. Use this when you need
|
|
42
|
+
* direct control over the pull loop — for example, to wrap a streaming
|
|
43
|
+
* source whose batches are produced lazily.
|
|
44
|
+
*
|
|
45
|
+
* @param schema - The Arrow schema of the produced batches.
|
|
46
|
+
* @param factory - Called at the start of each scan to produce a batch
|
|
47
|
+
* iterator. Must be idempotent when `rescannable` is true.
|
|
48
|
+
* @param opts - Optional hints. `rescannable` defaults to `true`; set to
|
|
49
|
+
* `false` if calling `factory()` twice would not reproduce the same data.
|
|
50
|
+
*/
|
|
51
|
+
static async fromFactory(schema, factory, opts = {}) {
|
|
52
|
+
const numRows = opts.numRows ?? null;
|
|
53
|
+
if (numRows != null && !Number.isInteger(numRows)) {
|
|
54
|
+
throw new TypeError("numRows must be an integer");
|
|
55
|
+
}
|
|
56
|
+
const rescannable = opts.rescannable ?? true;
|
|
57
|
+
let iter = null;
|
|
58
|
+
const getNextBatch = async (isStart) => {
|
|
59
|
+
// `isStart` is true on the first pull of every new scan_as_stream.
|
|
60
|
+
// Drop any cached iterator so factory() is re-invoked for the next scan
|
|
61
|
+
if (isStart) {
|
|
62
|
+
iter = null;
|
|
63
|
+
}
|
|
64
|
+
if (iter === null) {
|
|
65
|
+
iter = normalizeIterator(factory());
|
|
66
|
+
}
|
|
67
|
+
const result = await iter.next();
|
|
68
|
+
if (result.done) {
|
|
69
|
+
iter = null;
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return (0, arrow_1.fromRecordBatchToStreamBuffer)(result.value);
|
|
73
|
+
};
|
|
74
|
+
const schemaBuf = await (0, arrow_1.fromTableToBuffer)((0, arrow_1.makeEmptyTable)(schema));
|
|
75
|
+
const native = new native_js_1.NapiScannable(schemaBuf, numRows, rescannable, getNextBatch);
|
|
76
|
+
return new Scannable(native, schema, numRows, rescannable);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build a Scannable from an in-memory Arrow `Table`. Always rescannable;
|
|
80
|
+
* the table's batches are replayed on each scan.
|
|
81
|
+
*
|
|
82
|
+
* The table's row count is authoritative: `opts.numRows` must either be
|
|
83
|
+
* omitted or equal to `table.numRows`. `opts.rescannable` of `false` is
|
|
84
|
+
* rejected because in-memory Tables are always rescannable.
|
|
85
|
+
*/
|
|
86
|
+
static async fromTable(table, opts = {}) {
|
|
87
|
+
if (opts.numRows != null && opts.numRows !== table.numRows) {
|
|
88
|
+
throw new TypeError(`opts.numRows (${opts.numRows}) does not match table.numRows (${table.numRows}). ` +
|
|
89
|
+
`The table's row count is authoritative; omit numRows or pass the matching value.`);
|
|
90
|
+
}
|
|
91
|
+
if (opts.rescannable === false) {
|
|
92
|
+
throw new TypeError(`fromTable does not accept rescannable: false. ` +
|
|
93
|
+
`In-memory Arrow Tables are always rescannable; omit the option or pass true.`);
|
|
94
|
+
}
|
|
95
|
+
return Scannable.fromFactory(table.schema, () => table.batches, {
|
|
96
|
+
numRows: table.numRows,
|
|
97
|
+
rescannable: true,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Build a Scannable from an iterable of `RecordBatch`es. `rescannable`
|
|
102
|
+
* defaults to `false`. Pass an explicit schema so the consumer can
|
|
103
|
+
* validate before any batch is pulled.
|
|
104
|
+
*
|
|
105
|
+
* `opts.rescannable: true` is honest for replayable iterables (Arrays,
|
|
106
|
+
* Sets, or custom iterables whose `[Symbol.iterator]()` returns a fresh
|
|
107
|
+
* iterator each call). It is rejected for one-shot iterables (generators,
|
|
108
|
+
* async generators, or already-an-iterator inputs) because their
|
|
109
|
+
* `[Symbol.iterator]()` returns the same exhausted object on the second
|
|
110
|
+
* scan. For replayable sources outside this shape, use
|
|
111
|
+
* `fromFactory(schema, () => createIter(), { rescannable: true })`.
|
|
112
|
+
*
|
|
113
|
+
* Note: when `opts.rescannable` is `true`, the constructor calls
|
|
114
|
+
* `[Symbol.iterator]()` once on the input to perform the structural check.
|
|
115
|
+
*/
|
|
116
|
+
static async fromIterable(schema, iter, opts = {}) {
|
|
117
|
+
if (opts.rescannable === true && isOneShotIterable(iter)) {
|
|
118
|
+
throw new TypeError(`fromIterable: rescannable: true is not honest for one-shot iterables ` +
|
|
119
|
+
`(generators, async generators, or iterators where [Symbol.iterator]() ` +
|
|
120
|
+
`returns the same object). The source would be exhausted after the first scan. ` +
|
|
121
|
+
`Use fromFactory(schema, () => createIter(), { rescannable: true }) for sources ` +
|
|
122
|
+
`where each call mints a fresh iterator.`);
|
|
123
|
+
}
|
|
124
|
+
return Scannable.fromFactory(schema, () => iter, {
|
|
125
|
+
numRows: opts.numRows,
|
|
126
|
+
rescannable: opts.rescannable ?? false,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Build a Scannable from an Arrow `RecordBatchReader`. A reader can only
|
|
131
|
+
* be consumed once; `rescannable` defaults to `false`.
|
|
132
|
+
*
|
|
133
|
+
* The reader must already be opened (via `.open()`) so its `.schema` is
|
|
134
|
+
* populated. `RecordBatchReader.from(...)` returns an unopened reader.
|
|
135
|
+
*
|
|
136
|
+
* `opts.rescannable: true` is rejected because `RecordBatchReader` is a
|
|
137
|
+
* self-iterator (its `[Symbol.iterator]()` returns itself), and this
|
|
138
|
+
* constructor does not call `reader.reset()` between scans, so a second
|
|
139
|
+
* scan would always see an exhausted reader. For genuinely replayable
|
|
140
|
+
* sources, use
|
|
141
|
+
* `fromFactory(schema, () => openReader(), { rescannable: true })`,
|
|
142
|
+
* which mints a fresh reader on each scan.
|
|
143
|
+
*/
|
|
144
|
+
static async fromRecordBatchReader(reader, opts = {}) {
|
|
145
|
+
if (opts.rescannable === true) {
|
|
146
|
+
throw new TypeError(`fromRecordBatchReader does not accept rescannable: true. ` +
|
|
147
|
+
`RecordBatchReader is a self-iterator (its [Symbol.iterator]() ` +
|
|
148
|
+
`returns itself) and would be exhausted after the first scan. ` +
|
|
149
|
+
`Use fromFactory(schema, () => openReader(), { rescannable: true }) ` +
|
|
150
|
+
`for sources where each call mints a fresh reader.`);
|
|
151
|
+
}
|
|
152
|
+
return Scannable.fromFactory(reader.schema, () => reader, {
|
|
153
|
+
numRows: opts.numRows,
|
|
154
|
+
rescannable: false,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.Scannable = Scannable;
|
|
159
|
+
function normalizeIterator(source) {
|
|
160
|
+
if (source == null) {
|
|
161
|
+
throw new TypeError("Scannable factory returned null/undefined");
|
|
162
|
+
}
|
|
163
|
+
if (typeof source[Symbol.asyncIterator] === "function") {
|
|
164
|
+
return source[Symbol.asyncIterator]();
|
|
165
|
+
}
|
|
166
|
+
if (typeof source[Symbol.iterator] === "function") {
|
|
167
|
+
return source[Symbol.iterator]();
|
|
168
|
+
}
|
|
169
|
+
// Already an iterator (has `.next`).
|
|
170
|
+
if (typeof source.next === "function") {
|
|
171
|
+
return source;
|
|
172
|
+
}
|
|
173
|
+
throw new TypeError("Scannable factory returned a non-iterable value");
|
|
174
|
+
}
|
|
175
|
+
// A "self-iterator" returns the same object from `[Symbol.iterator]()` /
|
|
176
|
+
// `[Symbol.asyncIterator]()`. Generators behave this way, so they exhaust
|
|
177
|
+
// after one pass. Replayable iterables (Array, Set, custom) return a fresh
|
|
178
|
+
// iterator each call. Detection mirrors `normalizeIterator`'s ordering so
|
|
179
|
+
// classification matches scan-time behavior.
|
|
180
|
+
function isOneShotIterable(source) {
|
|
181
|
+
// null/undefined are not one-shot in any meaningful sense; let
|
|
182
|
+
// `normalizeIterator` raise the actual error at scan time.
|
|
183
|
+
if (source == null)
|
|
184
|
+
return false;
|
|
185
|
+
const ref = source;
|
|
186
|
+
if (typeof source[Symbol.asyncIterator] ===
|
|
187
|
+
"function") {
|
|
188
|
+
const it = source[Symbol.asyncIterator]();
|
|
189
|
+
return it === ref;
|
|
190
|
+
}
|
|
191
|
+
if (typeof source[Symbol.iterator] === "function") {
|
|
192
|
+
const it = source[Symbol.iterator]();
|
|
193
|
+
return it === ref;
|
|
194
|
+
}
|
|
195
|
+
// Already-an-iterator (has `.next` but no `Symbol.iterator`) is by
|
|
196
|
+
// definition one-shot.
|
|
197
|
+
if (typeof source.next === "function")
|
|
198
|
+
return true;
|
|
199
|
+
return false;
|
|
200
|
+
}
|
package/dist/table.d.ts
CHANGED
|
@@ -61,6 +61,26 @@ export interface Version {
|
|
|
61
61
|
timestamp: Date;
|
|
62
62
|
metadata: Record<string, string>;
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Specification selecting Lance's MemWAL LSM-style write path for
|
|
66
|
+
* `mergeInsert`.
|
|
67
|
+
*
|
|
68
|
+
* `specType` is `"bucket"`, `"identity"`, or `"unsharded"`. For `"bucket"`,
|
|
69
|
+
* `column` and `numBuckets` are required; for `"identity"`, `column` is
|
|
70
|
+
* required.
|
|
71
|
+
*/
|
|
72
|
+
export interface LsmWriteSpec {
|
|
73
|
+
/** One of `"bucket"`, `"identity"`, or `"unsharded"`. */
|
|
74
|
+
specType: "bucket" | "identity" | "unsharded";
|
|
75
|
+
/** Bucket and identity variants: the sharding column. */
|
|
76
|
+
column?: string;
|
|
77
|
+
/** Bucket variant: the number of buckets, in `[1, 1024]`. */
|
|
78
|
+
numBuckets?: number;
|
|
79
|
+
/** Names of indexes the MemWAL should keep up to date during writes. */
|
|
80
|
+
maintainedIndexes?: string[];
|
|
81
|
+
/** Default `ShardWriter` configuration recorded in the MemWAL index. */
|
|
82
|
+
writerConfigDefaults?: Record<string, string>;
|
|
83
|
+
}
|
|
64
84
|
/**
|
|
65
85
|
* A Table is a collection of Records in a LanceDB Database.
|
|
66
86
|
*
|
|
@@ -219,6 +239,24 @@ export declare abstract class Table {
|
|
|
219
239
|
* wasteful.
|
|
220
240
|
*/
|
|
221
241
|
abstract prewarmIndex(name: string): Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* Prewarm one or more columns of data in the table.
|
|
244
|
+
*
|
|
245
|
+
* @param columns The columns to prewarm. If undefined, all columns are prewarmed.
|
|
246
|
+
*
|
|
247
|
+
* This will load the column data into the page cache so that future queries that
|
|
248
|
+
* read those columns avoid the initial cold-start latency. This call initiates
|
|
249
|
+
* prewarming and returns once the request is accepted; the warming itself may
|
|
250
|
+
* continue in the background. Calling it on already-prewarmed columns is a
|
|
251
|
+
* no-op on the server.
|
|
252
|
+
*
|
|
253
|
+
* Prewarming is generally useful for columns used in filters or projections.
|
|
254
|
+
* Large columns (e.g. high-dimensional vectors or binary data) may not be
|
|
255
|
+
* practical to prewarm.
|
|
256
|
+
*
|
|
257
|
+
* This feature is currently only supported on remote tables.
|
|
258
|
+
*/
|
|
259
|
+
abstract prewarmData(columns?: string[]): Promise<void>;
|
|
222
260
|
/**
|
|
223
261
|
* Waits for asynchronous indexing to complete on the table.
|
|
224
262
|
*
|
|
@@ -348,6 +386,54 @@ export declare abstract class Table {
|
|
|
348
386
|
* containing the new version number of the table after dropping the columns.
|
|
349
387
|
*/
|
|
350
388
|
abstract dropColumns(columnNames: string[]): Promise<DropColumnsResult>;
|
|
389
|
+
/**
|
|
390
|
+
* Set the unenforced primary key for this table to a single column.
|
|
391
|
+
*
|
|
392
|
+
* "Unenforced" means LanceDB does not check uniqueness on writes; the
|
|
393
|
+
* column is recorded in the schema as the primary key for use by features
|
|
394
|
+
* such as `merge_insert`. Only single-column primary keys are supported,
|
|
395
|
+
* and the key cannot be changed once set.
|
|
396
|
+
* @param {string | string[]} columns The primary key column. A one-element
|
|
397
|
+
* array is also accepted; passing more than one column is rejected.
|
|
398
|
+
* @returns {Promise<void>}
|
|
399
|
+
*/
|
|
400
|
+
abstract setUnenforcedPrimaryKey(columns: string | string[]): Promise<void>;
|
|
401
|
+
/**
|
|
402
|
+
* Install an {@link LsmWriteSpec} on this table, selecting Lance's MemWAL
|
|
403
|
+
* LSM-style write path for future `mergeInsert` calls.
|
|
404
|
+
*
|
|
405
|
+
* `LsmWriteSpec` chooses one of three sharding strategies via `specType`:
|
|
406
|
+
*
|
|
407
|
+
* - `"bucket"` — hash-bucket writes by the single-column unenforced primary
|
|
408
|
+
* key (`column` and `numBuckets` required).
|
|
409
|
+
* - `"identity"` — shard by the raw value of a scalar `column`.
|
|
410
|
+
* - `"unsharded"` — route every write to a single shard.
|
|
411
|
+
*
|
|
412
|
+
* All variants require the table to have an unenforced primary key
|
|
413
|
+
* ({@link Table#setUnenforcedPrimaryKey}); bucket sharding additionally
|
|
414
|
+
* requires it to be the single column being bucketed.
|
|
415
|
+
* @param {LsmWriteSpec} spec The sharding spec to install.
|
|
416
|
+
* @returns {Promise<void>}
|
|
417
|
+
* @example
|
|
418
|
+
* ```ts
|
|
419
|
+
* await table.setUnenforcedPrimaryKey("id");
|
|
420
|
+
* await table.setLsmWriteSpec({
|
|
421
|
+
* specType: "bucket",
|
|
422
|
+
* column: "id",
|
|
423
|
+
* numBuckets: 16,
|
|
424
|
+
* maintainedIndexes: ["id_idx"],
|
|
425
|
+
* });
|
|
426
|
+
* ```
|
|
427
|
+
*/
|
|
428
|
+
abstract setLsmWriteSpec(spec: LsmWriteSpec): Promise<void>;
|
|
429
|
+
/**
|
|
430
|
+
* Remove the {@link LsmWriteSpec} from this table, reverting to the standard
|
|
431
|
+
* `mergeInsert` write path.
|
|
432
|
+
*
|
|
433
|
+
* Errors if no spec is currently set.
|
|
434
|
+
* @returns {Promise<void>}
|
|
435
|
+
*/
|
|
436
|
+
abstract unsetLsmWriteSpec(): Promise<void>;
|
|
351
437
|
/** Retrieve the version of the table */
|
|
352
438
|
abstract version(): Promise<number>;
|
|
353
439
|
/**
|
|
@@ -499,6 +585,7 @@ export declare class LocalTable extends Table {
|
|
|
499
585
|
createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
|
|
500
586
|
dropIndex(name: string): Promise<void>;
|
|
501
587
|
prewarmIndex(name: string): Promise<void>;
|
|
588
|
+
prewarmData(columns?: string[]): Promise<void>;
|
|
502
589
|
waitForIndex(indexNames: string[], timeoutSeconds: number): Promise<void>;
|
|
503
590
|
takeOffsets(offsets: number[]): TakeQuery;
|
|
504
591
|
takeRowIds(rowIds: readonly (bigint | number)[]): TakeQuery;
|
|
@@ -508,6 +595,9 @@ export declare class LocalTable extends Table {
|
|
|
508
595
|
addColumns(newColumnTransforms: AddColumnsSql[] | Field | Field[] | Schema): Promise<AddColumnsResult>;
|
|
509
596
|
alterColumns(columnAlterations: ColumnAlteration[]): Promise<AlterColumnsResult>;
|
|
510
597
|
dropColumns(columnNames: string[]): Promise<DropColumnsResult>;
|
|
598
|
+
setUnenforcedPrimaryKey(columns: string | string[]): Promise<void>;
|
|
599
|
+
setLsmWriteSpec(spec: LsmWriteSpec): Promise<void>;
|
|
600
|
+
unsetLsmWriteSpec(): Promise<void>;
|
|
511
601
|
version(): Promise<number>;
|
|
512
602
|
checkout(version: number | string): Promise<void>;
|
|
513
603
|
checkoutLatest(): Promise<void>;
|
package/dist/table.js
CHANGED
|
@@ -131,6 +131,9 @@ class LocalTable extends Table {
|
|
|
131
131
|
async prewarmIndex(name) {
|
|
132
132
|
await this.inner.prewarmIndex(name);
|
|
133
133
|
}
|
|
134
|
+
async prewarmData(columns) {
|
|
135
|
+
await this.inner.prewarmData(columns);
|
|
136
|
+
}
|
|
134
137
|
async waitForIndex(indexNames, timeoutSeconds) {
|
|
135
138
|
await this.inner.waitForIndex(indexNames, timeoutSeconds);
|
|
136
139
|
}
|
|
@@ -255,6 +258,16 @@ class LocalTable extends Table {
|
|
|
255
258
|
async dropColumns(columnNames) {
|
|
256
259
|
return await this.inner.dropColumns(columnNames);
|
|
257
260
|
}
|
|
261
|
+
async setUnenforcedPrimaryKey(columns) {
|
|
262
|
+
const cols = typeof columns === "string" ? [columns] : columns;
|
|
263
|
+
return await this.inner.setUnenforcedPrimaryKey(cols);
|
|
264
|
+
}
|
|
265
|
+
async setLsmWriteSpec(spec) {
|
|
266
|
+
return await this.inner.setLsmWriteSpec(spec);
|
|
267
|
+
}
|
|
268
|
+
async unsetLsmWriteSpec() {
|
|
269
|
+
return await this.inner.unsetLsmWriteSpec();
|
|
270
|
+
}
|
|
258
271
|
async version() {
|
|
259
272
|
return await this.inner.version();
|
|
260
273
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.29.1-beta.0",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"url": "https://github.com/lancedb/lancedb"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@aws-sdk/client-dynamodb": "
|
|
42
|
-
"@aws-sdk/client-kms": "
|
|
43
|
-
"@aws-sdk/client-s3": "
|
|
41
|
+
"@aws-sdk/client-dynamodb": "3.1003.0",
|
|
42
|
+
"@aws-sdk/client-kms": "3.1003.0",
|
|
43
|
+
"@aws-sdk/client-s3": "3.1003.0",
|
|
44
44
|
"@biomejs/biome": "^1.7.3",
|
|
45
45
|
"@jest/globals": "^29.7.0",
|
|
46
|
-
"@napi-rs/cli": "
|
|
46
|
+
"@napi-rs/cli": "3.5.1",
|
|
47
47
|
"@types/axios": "^0.14.0",
|
|
48
48
|
"@types/jest": "^29.1.2",
|
|
49
|
-
"@types/node": "
|
|
49
|
+
"@types/node": "22.7.4",
|
|
50
50
|
"@types/tmp": "^0.2.6",
|
|
51
51
|
"apache-arrow-15": "npm:apache-arrow@15.0.0",
|
|
52
52
|
"apache-arrow-16": "npm:apache-arrow@16.0.0",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"shx": "^0.3.4",
|
|
58
58
|
"tmp": "^0.2.3",
|
|
59
59
|
"ts-jest": "^29.1.2",
|
|
60
|
-
"typedoc": "
|
|
61
|
-
"typedoc-plugin-markdown": "
|
|
62
|
-
"typescript": "
|
|
60
|
+
"typedoc": "0.26.4",
|
|
61
|
+
"typedoc-plugin-markdown": "4.2.1",
|
|
62
|
+
"typescript": "5.5.4",
|
|
63
63
|
"typescript-eslint": "^7.1.0"
|
|
64
64
|
},
|
|
65
65
|
"ava": {
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">= 18"
|
|
70
70
|
},
|
|
71
|
+
"packageManager": "pnpm@11.1.1",
|
|
71
72
|
"cpu": [
|
|
72
73
|
"x64",
|
|
73
74
|
"arm64"
|
|
@@ -80,11 +81,10 @@
|
|
|
80
81
|
"scripts": {
|
|
81
82
|
"artifacts": "napi artifacts",
|
|
82
83
|
"build:debug": "napi build --platform --dts ../lancedb/native.d.ts --js ../lancedb/native.js --output-dir lancedb",
|
|
83
|
-
"postbuild:debug": "shx mkdir -p dist && shx cp lancedb/*.node dist/",
|
|
84
|
+
"postbuild:debug": "shx mkdir -p dist && shx cp lancedb/*.node dist/ && node -e \"require('fs').writeFileSync('dist/package.json', JSON.stringify({name:'@lancedb/lancedb',type:'commonjs'}))\"",
|
|
84
85
|
"build:release": "napi build --platform --release --dts ../lancedb/native.d.ts --js ../lancedb/native.js --output-dir dist",
|
|
85
|
-
"
|
|
86
|
-
"build": "
|
|
87
|
-
"build-release": "npm run build:release && npm run tsc",
|
|
86
|
+
"build": "pnpm build:debug && pnpm tsc",
|
|
87
|
+
"build-release": "pnpm build:release && pnpm tsc",
|
|
88
88
|
"tsc": "tsc -b",
|
|
89
89
|
"posttsc": "shx cp lancedb/native.d.ts dist/native.d.ts",
|
|
90
90
|
"lint-ci": "biome ci .",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"lint-fix": "biome check --write . && biome format --write .",
|
|
95
95
|
"prepublishOnly": "napi prepublish -t npm",
|
|
96
96
|
"test": "jest --verbose",
|
|
97
|
-
"integration": "S3_TEST=1
|
|
97
|
+
"integration": "S3_TEST=1 pnpm test",
|
|
98
98
|
"universal": "napi universalize",
|
|
99
99
|
"version": "napi version"
|
|
100
100
|
},
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
"reflect-metadata": "^0.2.2"
|
|
103
103
|
},
|
|
104
104
|
"optionalDependencies": {
|
|
105
|
-
"@lancedb/lancedb-darwin-arm64": "0.
|
|
106
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.
|
|
107
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.
|
|
108
|
-
"@lancedb/lancedb-linux-x64-musl": "0.
|
|
109
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.
|
|
110
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.
|
|
111
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.
|
|
105
|
+
"@lancedb/lancedb-darwin-arm64": "0.29.1-beta.0",
|
|
106
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.29.1-beta.0",
|
|
107
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.29.1-beta.0",
|
|
108
|
+
"@lancedb/lancedb-linux-x64-musl": "0.29.1-beta.0",
|
|
109
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.29.1-beta.0",
|
|
110
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.29.1-beta.0",
|
|
111
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.29.1-beta.0"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
114
|
"apache-arrow": ">=15.0.0 <=18.1.0"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Flat node_modules layout. The @napi-rs/cli build step fails to locate
|
|
2
|
+
# the cdylib artifact under pnpm's isolated layout; the hoisted linker
|
|
3
|
+
# mirrors npm's structure and unblocks the native build.
|
|
4
|
+
nodeLinker: hoisted
|
|
5
|
+
|
|
6
|
+
# Block resolution of versions less than 24h old (Shai-Hulud window).
|
|
7
|
+
# This is the pnpm 11 default but pinned here so it's visible to
|
|
8
|
+
# reviewers and survives a future pnpm major flipping the default.
|
|
9
|
+
minimumReleaseAge: 1440
|
|
10
|
+
|
|
11
|
+
# Fail install if a transitive dep tries to run an unapproved script.
|
|
12
|
+
strictDepBuilds: true
|
|
13
|
+
|
|
14
|
+
allowBuilds:
|
|
15
|
+
'@biomejs/biome': true
|
|
16
|
+
onnxruntime-node: true
|
|
17
|
+
protobufjs: true
|
|
18
|
+
sharp: true
|