@lancedb/lancedb 0.37.1 → 0.38.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection.d.ts +8 -0
- package/dist/connection.js +3 -0
- package/dist/index.d.ts +2 -2
- package/dist/native.d.ts +98 -1
- package/dist/native.js +52 -52
- package/dist/table.d.ts +129 -7
- package/dist/table.js +24 -0
- package/package.json +8 -8
package/dist/connection.d.ts
CHANGED
|
@@ -246,6 +246,13 @@ export declare abstract class Connection {
|
|
|
246
246
|
* @param {string[]} namespacePath The namespace path of the table (defaults to root namespace).
|
|
247
247
|
*/
|
|
248
248
|
abstract dropTable(name: string, namespacePath?: string[]): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Start dropping a table and return its cleanup job.
|
|
251
|
+
*
|
|
252
|
+
* The table may become unavailable before its data files are removed. Wait
|
|
253
|
+
* on the returned job to know when cleanup has finished.
|
|
254
|
+
*/
|
|
255
|
+
abstract dropTableAsync(name: string, namespacePath?: string[]): Promise<Job>;
|
|
249
256
|
/**
|
|
250
257
|
* Drop all tables in the database.
|
|
251
258
|
* @param {string[]} namespacePath The namespace path to drop tables from (defaults to root namespace).
|
|
@@ -388,6 +395,7 @@ export declare class LocalConnection extends Connection {
|
|
|
388
395
|
private _createTableImpl;
|
|
389
396
|
createEmptyTable(name: string, schema: import("./arrow").SchemaLike, namespacePathOrOptions?: string[] | Partial<CreateTableOptions>, options?: Partial<CreateTableOptions>): Promise<Table>;
|
|
390
397
|
dropTable(name: string, namespacePath?: string[]): Promise<void>;
|
|
398
|
+
dropTableAsync(name: string, namespacePath?: string[]): Promise<Job>;
|
|
391
399
|
dropAllTables(namespacePath?: string[]): Promise<void>;
|
|
392
400
|
describeNamespace(namespacePath: string[]): Promise<DescribeNamespaceResponse>;
|
|
393
401
|
listNamespaces(namespacePath?: string[], options?: Partial<ListNamespacesOptions>): Promise<ListNamespacesResponse>;
|
package/dist/connection.js
CHANGED
|
@@ -174,6 +174,9 @@ class LocalConnection extends Connection {
|
|
|
174
174
|
async dropTable(name, namespacePath) {
|
|
175
175
|
return this.inner.dropTable(name, namespacePath ?? []);
|
|
176
176
|
}
|
|
177
|
+
async dropTableAsync(name, namespacePath) {
|
|
178
|
+
return this.inner.dropTableAsync(name, namespacePath ?? []);
|
|
179
|
+
}
|
|
177
180
|
async dropAllTables(namespacePath) {
|
|
178
181
|
return this.inner.dropAllTables(namespacePath ?? []);
|
|
179
182
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ import type { BaseTokenizer } from "./indices";
|
|
|
5
5
|
import type { FtsToken } from "./table";
|
|
6
6
|
export { JsHeaderProvider as NativeJsHeaderProvider } from "./native.js";
|
|
7
7
|
export { instrumentLanceDbMetrics } from "./otel";
|
|
8
|
-
export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
|
|
8
|
+
export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, RefreshColumnResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
|
|
9
9
|
export { makeArrowTable, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
|
|
10
10
|
export { Connection, CreateTableOptions, TableNamesOptions, OpenTableOptions, ListNamespacesOptions, CreateNamespaceOptions, DropNamespaceOptions, ListNamespacesResponse, CreateNamespaceResponse, DropNamespaceResponse, DescribeNamespaceResponse, RenameTableOptions, } from "./connection";
|
|
11
11
|
export { Job, JobDescription, JobFailureInfo, JobInfo, Session, } from "./native.js";
|
|
12
12
|
export { ExecutableQuery, Query, QueryBase, VectorQuery, TakeQuery, AnalyzePlanDistributedMetrics, QueryExecutionOptions, ColumnOrdering, FullTextSearchOptions, RecordBatchIterator, FullTextQuery, MatchQuery, PhraseQuery, BoostQuery, MultiMatchQuery, BooleanQuery, FullTextQueryType, Operator, Occur, } from "./query";
|
|
13
13
|
export { Index, IndexOptions, IvfPqOptions, IvfRqOptions, IvfFlatOptions, HnswPqOptions, HnswSqOptions, FtsOptions, BaseTokenizer, } from "./indices";
|
|
14
|
-
export { Table, Branches, BranchColumnSummary, BranchColumnChange, BranchIndexSummary, BranchRowCountSummary, MergeBlocker, BranchDiff, MergePreview, MergeBranchResult, AddDataOptions, UpdateOptions, OptimizeOptions, Version, WriteProgress, FtsToken, TokenizeTableOptions, LsmWriteSpec, ColumnAlteration, FieldMetadataUpdate, } from "./table";
|
|
14
|
+
export { Table, Branches, BranchColumnSummary, BranchColumnChange, BranchIndexSummary, BranchRowCountSummary, MergeBlocker, BranchDiff, MergePreview, MergeBranchResult, AddDataOptions, UpdateOptions, OptimizeOptions, Version, WriteProgress, FtsToken, TokenizeTableOptions, LsmWriteSpec, LsmStats, BucketStats, GenerationStats, MemtableStats, ColumnAlteration, FieldMetadataUpdate, } from "./table";
|
|
15
15
|
export { HeaderProvider, StaticHeaderProvider, OAuthHeaderProvider, TokenResponse, } from "./header";
|
|
16
16
|
export { OAuthConfig, OAuthFlowType } from "./oauth";
|
|
17
17
|
export { MergeInsertBuilder, WriteExecutionOptions } from "./merge";
|
package/dist/native.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export declare class Connection {
|
|
|
38
38
|
cloneTable(targetTableName: string, sourceUri: string, targetNamespacePath: Array<string> | undefined | null, sourceVersion: number | undefined | null, sourceTag: string | undefined | null, isShallow: boolean): Promise<Table>
|
|
39
39
|
/** Drop table with the name. Or raise an error if the table does not exist. */
|
|
40
40
|
dropTable(name: string, namespacePath?: Array<string> | undefined | null): Promise<void>
|
|
41
|
+
/** Start dropping a table and return its cleanup job. */
|
|
42
|
+
dropTableAsync(name: string, namespacePath?: Array<string> | undefined | null): Promise<Job>
|
|
41
43
|
dropAllTables(namespacePath?: Array<string> | undefined | null): Promise<void>
|
|
42
44
|
/**
|
|
43
45
|
* A `Job` handle for a server-side job by id.
|
|
@@ -279,6 +281,9 @@ export declare class Table {
|
|
|
279
281
|
takeRowIds(rowIds: Array<bigint>): TakeQuery
|
|
280
282
|
vectorSearch(vector: Float32Array): VectorQuery
|
|
281
283
|
addColumns(transforms: Array<AddColumnsSql>): Promise<AddColumnsResult>
|
|
284
|
+
addComputedColumns(columns: Array<AddColumnsSql>): Promise<AddColumnsResult>
|
|
285
|
+
refreshColumn(column: string): Promise<RefreshColumnResult>
|
|
286
|
+
refreshColumnAsync(column: string): Promise<Job>
|
|
282
287
|
addColumnsWithSchema(schemaBuf: Buffer): Promise<AddColumnsResult>
|
|
283
288
|
alterColumns(alterations: Array<ColumnAlteration>): Promise<AlterColumnsResult>
|
|
284
289
|
updateFieldMetadata(updates: Array<FieldMetadataUpdate>): Promise<UpdateFieldMetadataResult>
|
|
@@ -288,6 +293,10 @@ export declare class Table {
|
|
|
288
293
|
unsetLsmWriteSpec(): Promise<void>
|
|
289
294
|
getLsmWriteSpec(): Promise<LsmWriteSpec | null>
|
|
290
295
|
closeLsmWriters(): Promise<void>
|
|
296
|
+
flushLsm(): Promise<void>
|
|
297
|
+
compactLsm(): Promise<void>
|
|
298
|
+
checkpointLsm(): Promise<void>
|
|
299
|
+
getLsmStats(includeGenerationRows: boolean): Promise<LsmStats | null>
|
|
291
300
|
version(): Promise<number>
|
|
292
301
|
checkout(version: number): Promise<void>
|
|
293
302
|
checkoutTag(tag: string): Promise<void>
|
|
@@ -384,6 +393,45 @@ export interface AlterColumnsResult {
|
|
|
384
393
|
version: number
|
|
385
394
|
}
|
|
386
395
|
|
|
396
|
+
/**
|
|
397
|
+
* Live state of one bucket. A table is N buckets on one node; flattening to a
|
|
398
|
+
* single number hides the one hot bucket that is usually why someone opened
|
|
399
|
+
* this endpoint.
|
|
400
|
+
*/
|
|
401
|
+
export interface BucketStats {
|
|
402
|
+
/** The shard this bucket writes. */
|
|
403
|
+
shardId: string
|
|
404
|
+
/** `"Active"` or `"Sealed"` (drop-table 2PC in flight). */
|
|
405
|
+
status: string
|
|
406
|
+
/** Epoch of the writer that currently owns the shard. */
|
|
407
|
+
writerEpoch: number
|
|
408
|
+
/** Version of the shard manifest these numbers were read from. */
|
|
409
|
+
manifestVersion: number
|
|
410
|
+
/** The generation the active memtable will become. */
|
|
411
|
+
currentGeneration: number
|
|
412
|
+
/** WAL position replay resumes from. */
|
|
413
|
+
replayAfterWalEntryPosition: number
|
|
414
|
+
/**
|
|
415
|
+
* Highest WAL position the writer has seen. The difference against
|
|
416
|
+
* `replayAfterWalEntryPosition` is the WAL lag.
|
|
417
|
+
*/
|
|
418
|
+
walEntryPositionLastSeen: number
|
|
419
|
+
/** Flushed L0 generations not yet merged into the base table. */
|
|
420
|
+
generations: Array<GenerationStats>
|
|
421
|
+
/**
|
|
422
|
+
* Whether a pass owns this bucket's compaction latch right now. Says *a*
|
|
423
|
+
* driver is running, not *whose*, and the latch is held from dispatch —
|
|
424
|
+
* including while the pass queues for a pod-wide compactor permit. Read it
|
|
425
|
+
* as "do not pile on", never as "mine is progressing".
|
|
426
|
+
*/
|
|
427
|
+
compacting: boolean
|
|
428
|
+
/**
|
|
429
|
+
* Oldest first, active last. Absent for a `"Sealed"` bucket, whose
|
|
430
|
+
* in-memory state is torn down.
|
|
431
|
+
*/
|
|
432
|
+
memtables?: Array<MemtableStats>
|
|
433
|
+
}
|
|
434
|
+
|
|
387
435
|
export interface ClientConfig {
|
|
388
436
|
userAgent?: string
|
|
389
437
|
retryConfig?: RetryConfig
|
|
@@ -616,6 +664,19 @@ export interface FtsToken {
|
|
|
616
664
|
position: number
|
|
617
665
|
}
|
|
618
666
|
|
|
667
|
+
/** One flushed L0 generation. */
|
|
668
|
+
export interface GenerationStats {
|
|
669
|
+
/** The generation number. Increases as memtables are sealed into L0. */
|
|
670
|
+
generation: number
|
|
671
|
+
/** On-disk size of the generation. */
|
|
672
|
+
bytes: number
|
|
673
|
+
/**
|
|
674
|
+
* Present only when `includeGenerationRows` was requested. Off by default
|
|
675
|
+
* because each count opens an uncached Lance dataset.
|
|
676
|
+
*/
|
|
677
|
+
rows?: number
|
|
678
|
+
}
|
|
679
|
+
|
|
619
680
|
/** A description of an index currently configured on a column */
|
|
620
681
|
export interface IndexConfig {
|
|
621
682
|
/** The name of the index */
|
|
@@ -751,6 +812,17 @@ export interface ListNamespacesResponse {
|
|
|
751
812
|
pageToken?: string
|
|
752
813
|
}
|
|
753
814
|
|
|
815
|
+
/**
|
|
816
|
+
* Live per-bucket LSM state, as returned by `Table#getLsmStats`.
|
|
817
|
+
*
|
|
818
|
+
* Nothing here is derived: sums and differences (total L0 bytes, WAL lag) are
|
|
819
|
+
* the caller's to compute.
|
|
820
|
+
*/
|
|
821
|
+
export interface LsmStats {
|
|
822
|
+
/** One entry per bucket backing this table. */
|
|
823
|
+
buckets: Array<BucketStats>
|
|
824
|
+
}
|
|
825
|
+
|
|
754
826
|
/**
|
|
755
827
|
* Specification selecting Lance's MemWAL LSM-style write path for
|
|
756
828
|
* `mergeInsert`.
|
|
@@ -766,12 +838,32 @@ export interface LsmWriteSpec {
|
|
|
766
838
|
column?: string
|
|
767
839
|
/** Bucket variant: the number of buckets, in `[1, 1024]`. */
|
|
768
840
|
numBuckets?: number
|
|
769
|
-
/**
|
|
841
|
+
/**
|
|
842
|
+
* Indexes the MemWAL keeps up to date. Omitted resolves every
|
|
843
|
+
* maintainable index on install; an empty array means none.
|
|
844
|
+
*/
|
|
770
845
|
maintainedIndexes?: Array<string>
|
|
771
846
|
/** Default `ShardWriter` configuration recorded in the MemWAL index. */
|
|
772
847
|
writerConfigDefaults?: Record<string, string>
|
|
773
848
|
}
|
|
774
849
|
|
|
850
|
+
/** One in-memory memtable. */
|
|
851
|
+
export interface MemtableStats {
|
|
852
|
+
/** The generation this memtable will become once sealed. */
|
|
853
|
+
generation: number
|
|
854
|
+
/** Rows currently buffered. */
|
|
855
|
+
rows: number
|
|
856
|
+
/** Estimated in-memory size. */
|
|
857
|
+
bytes: number
|
|
858
|
+
/** Record batches currently buffered. */
|
|
859
|
+
batches: number
|
|
860
|
+
/**
|
|
861
|
+
* Names of the indexes this memtable carries. An absent name is the whole
|
|
862
|
+
* answer to "why is my fresh-tier search on that column brute-force".
|
|
863
|
+
*/
|
|
864
|
+
indexes: Array<string>
|
|
865
|
+
}
|
|
866
|
+
|
|
775
867
|
export interface MergeResult {
|
|
776
868
|
version: number
|
|
777
869
|
numInsertedRows: number
|
|
@@ -862,6 +954,11 @@ export interface OptimizeStats {
|
|
|
862
954
|
/** Create a permutation builder for the given table */
|
|
863
955
|
export declare function permutationBuilder(table: Table): PermutationBuilder
|
|
864
956
|
|
|
957
|
+
export interface RefreshColumnResult {
|
|
958
|
+
rowsFilled: number
|
|
959
|
+
version: number
|
|
960
|
+
}
|
|
961
|
+
|
|
865
962
|
/**
|
|
866
963
|
* Install the LanceDB metrics recorder as the process-global `metrics` recorder.
|
|
867
964
|
*
|
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.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
79
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
80
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
81
81
|
}
|
|
82
82
|
return binding;
|
|
83
83
|
}
|
|
@@ -95,8 +95,8 @@ function requireNative() {
|
|
|
95
95
|
try {
|
|
96
96
|
const binding = require('@lancedb/lancedb-android-arm-eabi');
|
|
97
97
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm-eabi/package.json').version;
|
|
98
|
-
if (bindingPackageVersion !== '0.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
98
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
99
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
100
100
|
}
|
|
101
101
|
return binding;
|
|
102
102
|
}
|
|
@@ -120,8 +120,8 @@ function requireNative() {
|
|
|
120
120
|
try {
|
|
121
121
|
const binding = require('@lancedb/lancedb-win32-x64-gnu');
|
|
122
122
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-gnu/package.json').version;
|
|
123
|
-
if (bindingPackageVersion !== '0.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
123
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
124
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
125
125
|
}
|
|
126
126
|
return binding;
|
|
127
127
|
}
|
|
@@ -139,8 +139,8 @@ function requireNative() {
|
|
|
139
139
|
try {
|
|
140
140
|
const binding = require('@lancedb/lancedb-win32-x64-msvc');
|
|
141
141
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-msvc/package.json').version;
|
|
142
|
-
if (bindingPackageVersion !== '0.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
142
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
143
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
144
144
|
}
|
|
145
145
|
return binding;
|
|
146
146
|
}
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('@lancedb/lancedb-win32-ia32-msvc');
|
|
161
161
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-ia32-msvc/package.json').version;
|
|
162
|
-
if (bindingPackageVersion !== '0.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
162
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
163
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
164
164
|
}
|
|
165
165
|
return binding;
|
|
166
166
|
}
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@lancedb/lancedb-win32-arm64-msvc');
|
|
180
180
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-arm64-msvc/package.json').version;
|
|
181
|
-
if (bindingPackageVersion !== '0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
183
183
|
}
|
|
184
184
|
return binding;
|
|
185
185
|
}
|
|
@@ -201,8 +201,8 @@ function requireNative() {
|
|
|
201
201
|
try {
|
|
202
202
|
const binding = require('@lancedb/lancedb-darwin-universal');
|
|
203
203
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-universal/package.json').version;
|
|
204
|
-
if (bindingPackageVersion !== '0.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
204
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
205
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
206
206
|
}
|
|
207
207
|
return binding;
|
|
208
208
|
}
|
|
@@ -219,8 +219,8 @@ function requireNative() {
|
|
|
219
219
|
try {
|
|
220
220
|
const binding = require('@lancedb/lancedb-darwin-x64');
|
|
221
221
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-x64/package.json').version;
|
|
222
|
-
if (bindingPackageVersion !== '0.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
222
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
224
224
|
}
|
|
225
225
|
return binding;
|
|
226
226
|
}
|
|
@@ -238,8 +238,8 @@ function requireNative() {
|
|
|
238
238
|
try {
|
|
239
239
|
const binding = require('@lancedb/lancedb-darwin-arm64');
|
|
240
240
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-arm64/package.json').version;
|
|
241
|
-
if (bindingPackageVersion !== '0.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
241
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
243
243
|
}
|
|
244
244
|
return binding;
|
|
245
245
|
}
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('@lancedb/lancedb-freebsd-x64');
|
|
264
264
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-x64/package.json').version;
|
|
265
|
-
if (bindingPackageVersion !== '0.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
265
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
266
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
267
267
|
}
|
|
268
268
|
return binding;
|
|
269
269
|
}
|
|
@@ -281,8 +281,8 @@ function requireNative() {
|
|
|
281
281
|
try {
|
|
282
282
|
const binding = require('@lancedb/lancedb-freebsd-arm64');
|
|
283
283
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-arm64/package.json').version;
|
|
284
|
-
if (bindingPackageVersion !== '0.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
284
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
285
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
286
286
|
}
|
|
287
287
|
return binding;
|
|
288
288
|
}
|
|
@@ -306,8 +306,8 @@ function requireNative() {
|
|
|
306
306
|
try {
|
|
307
307
|
const binding = require('@lancedb/lancedb-linux-x64-musl');
|
|
308
308
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-musl/package.json').version;
|
|
309
|
-
if (bindingPackageVersion !== '0.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
309
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
311
311
|
}
|
|
312
312
|
return binding;
|
|
313
313
|
}
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@lancedb/lancedb-linux-x64-gnu');
|
|
327
327
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-gnu/package.json').version;
|
|
328
|
-
if (bindingPackageVersion !== '0.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
328
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
330
330
|
}
|
|
331
331
|
return binding;
|
|
332
332
|
}
|
|
@@ -346,8 +346,8 @@ function requireNative() {
|
|
|
346
346
|
try {
|
|
347
347
|
const binding = require('@lancedb/lancedb-linux-arm64-musl');
|
|
348
348
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-musl/package.json').version;
|
|
349
|
-
if (bindingPackageVersion !== '0.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
349
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
350
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
}
|
|
352
352
|
return binding;
|
|
353
353
|
}
|
|
@@ -365,8 +365,8 @@ function requireNative() {
|
|
|
365
365
|
try {
|
|
366
366
|
const binding = require('@lancedb/lancedb-linux-arm64-gnu');
|
|
367
367
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-gnu/package.json').version;
|
|
368
|
-
if (bindingPackageVersion !== '0.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
368
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
369
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
370
370
|
}
|
|
371
371
|
return binding;
|
|
372
372
|
}
|
|
@@ -386,8 +386,8 @@ function requireNative() {
|
|
|
386
386
|
try {
|
|
387
387
|
const binding = require('@lancedb/lancedb-linux-arm-musleabihf');
|
|
388
388
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-musleabihf/package.json').version;
|
|
389
|
-
if (bindingPackageVersion !== '0.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
389
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
390
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
391
391
|
}
|
|
392
392
|
return binding;
|
|
393
393
|
}
|
|
@@ -405,8 +405,8 @@ function requireNative() {
|
|
|
405
405
|
try {
|
|
406
406
|
const binding = require('@lancedb/lancedb-linux-arm-gnueabihf');
|
|
407
407
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-gnueabihf/package.json').version;
|
|
408
|
-
if (bindingPackageVersion !== '0.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
408
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
409
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
410
410
|
}
|
|
411
411
|
return binding;
|
|
412
412
|
}
|
|
@@ -426,8 +426,8 @@ function requireNative() {
|
|
|
426
426
|
try {
|
|
427
427
|
const binding = require('@lancedb/lancedb-linux-loong64-musl');
|
|
428
428
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-musl/package.json').version;
|
|
429
|
-
if (bindingPackageVersion !== '0.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
429
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
430
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
431
431
|
}
|
|
432
432
|
return binding;
|
|
433
433
|
}
|
|
@@ -445,8 +445,8 @@ function requireNative() {
|
|
|
445
445
|
try {
|
|
446
446
|
const binding = require('@lancedb/lancedb-linux-loong64-gnu');
|
|
447
447
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-gnu/package.json').version;
|
|
448
|
-
if (bindingPackageVersion !== '0.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
448
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
449
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
450
450
|
}
|
|
451
451
|
return binding;
|
|
452
452
|
}
|
|
@@ -466,8 +466,8 @@ function requireNative() {
|
|
|
466
466
|
try {
|
|
467
467
|
const binding = require('@lancedb/lancedb-linux-riscv64-musl');
|
|
468
468
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-musl/package.json').version;
|
|
469
|
-
if (bindingPackageVersion !== '0.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
469
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
470
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
471
471
|
}
|
|
472
472
|
return binding;
|
|
473
473
|
}
|
|
@@ -485,8 +485,8 @@ function requireNative() {
|
|
|
485
485
|
try {
|
|
486
486
|
const binding = require('@lancedb/lancedb-linux-riscv64-gnu');
|
|
487
487
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-gnu/package.json').version;
|
|
488
|
-
if (bindingPackageVersion !== '0.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
488
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
489
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
490
490
|
}
|
|
491
491
|
return binding;
|
|
492
492
|
}
|
|
@@ -505,8 +505,8 @@ function requireNative() {
|
|
|
505
505
|
try {
|
|
506
506
|
const binding = require('@lancedb/lancedb-linux-ppc64-gnu');
|
|
507
507
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-ppc64-gnu/package.json').version;
|
|
508
|
-
if (bindingPackageVersion !== '0.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
508
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
509
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
510
510
|
}
|
|
511
511
|
return binding;
|
|
512
512
|
}
|
|
@@ -524,8 +524,8 @@ function requireNative() {
|
|
|
524
524
|
try {
|
|
525
525
|
const binding = require('@lancedb/lancedb-linux-s390x-gnu');
|
|
526
526
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-s390x-gnu/package.json').version;
|
|
527
|
-
if (bindingPackageVersion !== '0.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
527
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
528
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
529
529
|
}
|
|
530
530
|
return binding;
|
|
531
531
|
}
|
|
@@ -548,8 +548,8 @@ function requireNative() {
|
|
|
548
548
|
try {
|
|
549
549
|
const binding = require('@lancedb/lancedb-openharmony-arm64');
|
|
550
550
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm64/package.json').version;
|
|
551
|
-
if (bindingPackageVersion !== '0.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
551
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
552
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
553
553
|
}
|
|
554
554
|
return binding;
|
|
555
555
|
}
|
|
@@ -567,8 +567,8 @@ function requireNative() {
|
|
|
567
567
|
try {
|
|
568
568
|
const binding = require('@lancedb/lancedb-openharmony-x64');
|
|
569
569
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-x64/package.json').version;
|
|
570
|
-
if (bindingPackageVersion !== '0.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
570
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
571
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
572
572
|
}
|
|
573
573
|
return binding;
|
|
574
574
|
}
|
|
@@ -586,8 +586,8 @@ function requireNative() {
|
|
|
586
586
|
try {
|
|
587
587
|
const binding = require('@lancedb/lancedb-openharmony-arm');
|
|
588
588
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm/package.json').version;
|
|
589
|
-
if (bindingPackageVersion !== '0.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
589
|
+
if (bindingPackageVersion !== '0.38.0-beta.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
590
|
+
throw new Error(`Native binding package version mismatch, expected 0.38.0-beta.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
package/dist/table.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Table as ArrowTable, Data, DataType, Field, IntoVector, MultiVector, Schema } from "./arrow";
|
|
2
2
|
import { IndexOptions } from "./indices";
|
|
3
3
|
import { MergeInsertBuilder } from "./merge";
|
|
4
|
-
import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, IndexConfig, IndexStatistics, Job, Branches as NativeBranches, OptimizeStats, TableStatistics, Tags, UpdateFieldMetadataResult, UpdateResult, Table as _NativeTable } from "./native";
|
|
4
|
+
import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, IndexConfig, IndexStatistics, Job, LsmStats, Branches as NativeBranches, OptimizeStats, RefreshColumnResult, TableStatistics, Tags, UpdateFieldMetadataResult, UpdateResult, Table as _NativeTable } from "./native";
|
|
5
5
|
import { FullTextQuery, Query, TakeQuery, VectorQuery } from "./query";
|
|
6
6
|
import { IntoSql } from "./util";
|
|
7
7
|
export { IndexConfig } from "./native";
|
|
8
|
+
export { BucketStats, GenerationStats, LsmStats, MemtableStats, } from "./native";
|
|
8
9
|
/**
|
|
9
10
|
* Progress snapshot for a write operation, delivered to the `progress`
|
|
10
11
|
* callback passed to {@link Table.add}.
|
|
@@ -142,7 +143,11 @@ export interface LsmWriteSpec {
|
|
|
142
143
|
column?: string;
|
|
143
144
|
/** Bucket variant: the number of buckets, in `[1, 1024]`. */
|
|
144
145
|
numBuckets?: number;
|
|
145
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* Indexes the MemWAL keeps up to date. Omit to maintain every supported
|
|
148
|
+
* index, resolved on install — a snapshot, so indexes created later are not
|
|
149
|
+
* maintained. Pass `[]` for none.
|
|
150
|
+
*/
|
|
146
151
|
maintainedIndexes?: string[];
|
|
147
152
|
/** Default `ShardWriter` configuration recorded in the MemWAL index. */
|
|
148
153
|
writerConfigDefaults?: Record<string, string>;
|
|
@@ -428,15 +433,67 @@ export declare abstract class Table {
|
|
|
428
433
|
abstract vectorSearch(vector: IntoVector | MultiVector): VectorQuery;
|
|
429
434
|
/**
|
|
430
435
|
* Add new columns with defined values.
|
|
436
|
+
*
|
|
437
|
+
* The `{ computed }` form stores the expression rather than evaluating it
|
|
438
|
+
* now: the column is committed with no values, and rows get them from
|
|
439
|
+
* {@link Table#refreshColumn}. Declaring one therefore costs the same on a
|
|
440
|
+
* large table as on an empty one.
|
|
441
|
+
*
|
|
442
|
+
* A refresh does not revisit rows it has already filled, so mutating an
|
|
443
|
+
* input leaves the value computed at fill time; recomputing means dropping
|
|
444
|
+
* the column and declaring it again. While a declaration reads a column,
|
|
445
|
+
* that column cannot be renamed, retyped or dropped.
|
|
446
|
+
*
|
|
447
|
+
* On LanceDB Cloud and Enterprise the expression is planned by the
|
|
448
|
+
* server, and the refresh runs as a server job -- see
|
|
449
|
+
* {@link Table#refreshColumnAsync}.
|
|
431
450
|
* @param {AddColumnsSql[] | Field | Field[] | Schema} newColumnTransforms Either:
|
|
432
451
|
* - An array of objects with column names and SQL expressions to calculate values
|
|
433
452
|
* - A single Arrow Field defining one column with its data type (column will be initialized with null values)
|
|
434
453
|
* - An array of Arrow Fields defining columns with their data types (columns will be initialized with null values)
|
|
435
454
|
* - An Arrow Schema defining columns with their data types (columns will be initialized with null values)
|
|
455
|
+
* - `{ computed }`, declaring columns defined by a SQL expression whose type and inputs are derived from it
|
|
436
456
|
* @returns {Promise<AddColumnsResult>} A promise that resolves to an object
|
|
437
457
|
* containing the new version number of the table after adding the columns.
|
|
458
|
+
* @example
|
|
459
|
+
* ```ts
|
|
460
|
+
* await table.addColumns({ computed: [{ name: "doubled", valueSql: "x * 2" }] });
|
|
461
|
+
* const { rowsFilled } = await table.refreshColumn("doubled");
|
|
462
|
+
* ```
|
|
463
|
+
*/
|
|
464
|
+
abstract addColumns(newColumnTransforms: AddColumnsSql[] | Field | Field[] | Schema | {
|
|
465
|
+
computed: AddColumnsSql[];
|
|
466
|
+
}): Promise<AddColumnsResult>;
|
|
467
|
+
/**
|
|
468
|
+
* Fill the rows of a computed column that hold no value yet.
|
|
469
|
+
*
|
|
470
|
+
* Rows appended since the last refresh are filled by the next one; rows
|
|
471
|
+
* already filled are left as they are, so the call is idempotent and does
|
|
472
|
+
* not observe a mutated input. Local tables only: a remote refresh runs
|
|
473
|
+
* as a server job, through {@link Table#refreshColumnAsync}.
|
|
474
|
+
* @param {string} column The name of the computed column to fill.
|
|
475
|
+
* @returns {Promise<RefreshColumnResult>} A promise that resolves to the
|
|
476
|
+
* number of rows filled and the new version number of the table.
|
|
438
477
|
*/
|
|
439
|
-
abstract
|
|
478
|
+
abstract refreshColumn(column: string): Promise<RefreshColumnResult>;
|
|
479
|
+
/**
|
|
480
|
+
* Like {@link Table#refreshColumn}, but returns a handle to the refresh
|
|
481
|
+
* job instead of blocking until it completes.
|
|
482
|
+
*
|
|
483
|
+
* The job may already be complete when returned; callers must not assume
|
|
484
|
+
* the column is filled until {@link Job.wait} resolves. Invalid input --
|
|
485
|
+
* an unknown column, or one that is not computed -- rejects here rather
|
|
486
|
+
* than failing the job. On local tables the job runs in-process; on
|
|
487
|
+
* LanceDB Cloud and Enterprise it is the server's backfill job.
|
|
488
|
+
* @param {string} column The name of the computed column to fill.
|
|
489
|
+
* @example
|
|
490
|
+
* ```ts
|
|
491
|
+
* const job = await table.refreshColumnAsync("doubled");
|
|
492
|
+
* await job.wait();
|
|
493
|
+
* console.log(await job.status()); // "finished"
|
|
494
|
+
* ```
|
|
495
|
+
*/
|
|
496
|
+
abstract refreshColumnAsync(column: string): Promise<Job>;
|
|
440
497
|
/**
|
|
441
498
|
* Alter the name or nullability of columns.
|
|
442
499
|
* @param {ColumnAlteration[]} columnAlterations One or more alterations to
|
|
@@ -493,6 +550,11 @@ export declare abstract class Table {
|
|
|
493
550
|
* All variants require the table to have an unenforced primary key
|
|
494
551
|
* ({@link Table#setUnenforcedPrimaryKey}); bucket sharding additionally
|
|
495
552
|
* requires it to be the single column being bucketed.
|
|
553
|
+
*
|
|
554
|
+
* Omitting `maintainedIndexes` maintains every index on the table, resolved
|
|
555
|
+
* here, failing if one cannot be maintained — name them to install anyway.
|
|
556
|
+
* Naming them pins an exact set, and a still-building index is rejected
|
|
557
|
+
* rather than quietly omitted.
|
|
496
558
|
* @param {LsmWriteSpec} spec The sharding spec to install.
|
|
497
559
|
* @returns {Promise<void>}
|
|
498
560
|
* @example
|
|
@@ -520,9 +582,10 @@ export declare abstract class Table {
|
|
|
520
582
|
*
|
|
521
583
|
* Resolves to `undefined` when the MemWAL LSM write path is not enabled (no
|
|
522
584
|
* spec has been set, or it was removed with {@link Table#unsetLsmWriteSpec}).
|
|
523
|
-
* The returned spec
|
|
524
|
-
*
|
|
525
|
-
*
|
|
585
|
+
* The returned spec mirrors what was passed to
|
|
586
|
+
* {@link Table#setLsmWriteSpec}, except that `maintainedIndexes` always
|
|
587
|
+
* reports the concrete list resolved when the spec was set — `undefined`
|
|
588
|
+
* never round-trips.
|
|
526
589
|
* @returns {Promise<LsmWriteSpec | undefined>}
|
|
527
590
|
*/
|
|
528
591
|
abstract getLsmWriteSpec(): Promise<LsmWriteSpec | undefined>;
|
|
@@ -536,6 +599,57 @@ export declare abstract class Table {
|
|
|
536
599
|
* @returns {Promise<void>}
|
|
537
600
|
*/
|
|
538
601
|
abstract closeLsmWriters(): Promise<void>;
|
|
602
|
+
/**
|
|
603
|
+
* Seal every bucket's active memtable into a new L0 generation.
|
|
604
|
+
*
|
|
605
|
+
* Returns once the seal is committed. Sealing an empty memtable is a no-op,
|
|
606
|
+
* so this is safe to call repeatedly.
|
|
607
|
+
* @returns {Promise<void>}
|
|
608
|
+
*/
|
|
609
|
+
abstract flushLsm(): Promise<void>;
|
|
610
|
+
/**
|
|
611
|
+
* Trigger a background L0 → base compaction pass per bucket.
|
|
612
|
+
*
|
|
613
|
+
* Returns once the passes are *dispatched*, not once they finish — watch
|
|
614
|
+
* {@link Table#getLsmStats} for progress, or use
|
|
615
|
+
* {@link Table#checkpointLsm} to wait for convergence.
|
|
616
|
+
* @returns {Promise<void>}
|
|
617
|
+
*/
|
|
618
|
+
abstract compactLsm(): Promise<void>;
|
|
619
|
+
/**
|
|
620
|
+
* Converge this table's LSM write path into its base table.
|
|
621
|
+
*
|
|
622
|
+
* Seals once, then triggers compaction and polls until the L0 that existed
|
|
623
|
+
* at the start is gone. The target set is fixed at the start, so
|
|
624
|
+
* generations created *during* the checkpoint are ignored — that is what
|
|
625
|
+
* lets it terminate under write load, and what makes it best-effort: it
|
|
626
|
+
* converges the fresh tier as of some instant. Idempotent, abandonable at
|
|
627
|
+
* any point, and safe to run on a cadence.
|
|
628
|
+
*
|
|
629
|
+
* There is no liveness bound — the compactor pool is shared across tables,
|
|
630
|
+
* so a checkpoint queued behind unrelated work looks exactly like one that
|
|
631
|
+
* is merging. The caller owns the deadline.
|
|
632
|
+
* @returns {Promise<void>}
|
|
633
|
+
* @example
|
|
634
|
+
* ```ts
|
|
635
|
+
* const before = await table.getLsmStats();
|
|
636
|
+
* await table.checkpointLsm();
|
|
637
|
+
* const after = await table.getLsmStats();
|
|
638
|
+
* ```
|
|
639
|
+
*/
|
|
640
|
+
abstract checkpointLsm(): Promise<void>;
|
|
641
|
+
/**
|
|
642
|
+
* Read live per-bucket LSM state.
|
|
643
|
+
*
|
|
644
|
+
* Answers "how far behind is my fresh tier", "which bucket is hot", and
|
|
645
|
+
* "why is my fresh-tier vector search brute-force". Mutates no table state.
|
|
646
|
+
*
|
|
647
|
+
* Resolves to `undefined` only when the LSM write path is not enabled.
|
|
648
|
+
* @param {boolean} includeGenerationRows Also count rows per L0 generation.
|
|
649
|
+
* Off by default because each count opens an uncached Lance dataset.
|
|
650
|
+
* @returns {Promise<LsmStats | undefined>}
|
|
651
|
+
*/
|
|
652
|
+
abstract getLsmStats(includeGenerationRows?: boolean): Promise<LsmStats | undefined>;
|
|
539
653
|
/** Retrieve the version of the table */
|
|
540
654
|
abstract version(): Promise<number>;
|
|
541
655
|
/**
|
|
@@ -719,7 +833,11 @@ export declare class LocalTable extends Table {
|
|
|
719
833
|
query(): Query;
|
|
720
834
|
search(query: string | IntoVector | MultiVector | FullTextQuery, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query;
|
|
721
835
|
vectorSearch(vector: IntoVector | MultiVector): VectorQuery;
|
|
722
|
-
addColumns(newColumnTransforms: AddColumnsSql[] | Field | Field[] | Schema
|
|
836
|
+
addColumns(newColumnTransforms: AddColumnsSql[] | Field | Field[] | Schema | {
|
|
837
|
+
computed: AddColumnsSql[];
|
|
838
|
+
}): Promise<AddColumnsResult>;
|
|
839
|
+
refreshColumn(column: string): Promise<RefreshColumnResult>;
|
|
840
|
+
refreshColumnAsync(column: string): Promise<Job>;
|
|
723
841
|
alterColumns(columnAlterations: ColumnAlteration[]): Promise<AlterColumnsResult>;
|
|
724
842
|
updateFieldMetadata(updates: FieldMetadataUpdate[]): Promise<UpdateFieldMetadataResult>;
|
|
725
843
|
dropColumns(columnNames: string[]): Promise<DropColumnsResult>;
|
|
@@ -728,6 +846,10 @@ export declare class LocalTable extends Table {
|
|
|
728
846
|
unsetLsmWriteSpec(): Promise<void>;
|
|
729
847
|
getLsmWriteSpec(): Promise<LsmWriteSpec | undefined>;
|
|
730
848
|
closeLsmWriters(): Promise<void>;
|
|
849
|
+
flushLsm(): Promise<void>;
|
|
850
|
+
compactLsm(): Promise<void>;
|
|
851
|
+
checkpointLsm(): Promise<void>;
|
|
852
|
+
getLsmStats(includeGenerationRows?: boolean): Promise<LsmStats | undefined>;
|
|
731
853
|
version(): Promise<number>;
|
|
732
854
|
checkout(version: number | string): Promise<void>;
|
|
733
855
|
checkoutLatest(): Promise<void>;
|
package/dist/table.js
CHANGED
|
@@ -225,6 +225,12 @@ class LocalTable extends Table {
|
|
|
225
225
|
}
|
|
226
226
|
// TODO: Support BatchUDF
|
|
227
227
|
async addColumns(newColumnTransforms) {
|
|
228
|
+
// Columns defined by an expression are declared, not materialized here.
|
|
229
|
+
if (typeof newColumnTransforms === "object" &&
|
|
230
|
+
!Array.isArray(newColumnTransforms) &&
|
|
231
|
+
"computed" in newColumnTransforms) {
|
|
232
|
+
return await this.inner.addComputedColumns(newColumnTransforms.computed);
|
|
233
|
+
}
|
|
228
234
|
// Handle single Field -> convert to array of Fields
|
|
229
235
|
if (newColumnTransforms instanceof arrow_1.Field) {
|
|
230
236
|
newColumnTransforms = [newColumnTransforms];
|
|
@@ -250,6 +256,12 @@ class LocalTable extends Table {
|
|
|
250
256
|
}
|
|
251
257
|
throw new Error("Invalid input type for addColumns");
|
|
252
258
|
}
|
|
259
|
+
async refreshColumn(column) {
|
|
260
|
+
return await this.inner.refreshColumn(column);
|
|
261
|
+
}
|
|
262
|
+
async refreshColumnAsync(column) {
|
|
263
|
+
return await this.inner.refreshColumnAsync(column);
|
|
264
|
+
}
|
|
253
265
|
async alterColumns(columnAlterations) {
|
|
254
266
|
const processedAlterations = columnAlterations.map((alteration) => {
|
|
255
267
|
if (typeof alteration.dataType === "string") {
|
|
@@ -299,6 +311,18 @@ class LocalTable extends Table {
|
|
|
299
311
|
async closeLsmWriters() {
|
|
300
312
|
return await this.inner.closeLsmWriters();
|
|
301
313
|
}
|
|
314
|
+
async flushLsm() {
|
|
315
|
+
return await this.inner.flushLsm();
|
|
316
|
+
}
|
|
317
|
+
async compactLsm() {
|
|
318
|
+
return await this.inner.compactLsm();
|
|
319
|
+
}
|
|
320
|
+
async checkpointLsm() {
|
|
321
|
+
return await this.inner.checkpointLsm();
|
|
322
|
+
}
|
|
323
|
+
async getLsmStats(includeGenerationRows = false) {
|
|
324
|
+
return (await this.inner.getLsmStats(includeGenerationRows)) ?? undefined;
|
|
325
|
+
}
|
|
302
326
|
async version() {
|
|
303
327
|
return await this.inner.version();
|
|
304
328
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.38.0-beta.3",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -106,13 +106,13 @@
|
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"@huggingface/transformers": "3.0.2",
|
|
108
108
|
"openai": "4.29.2",
|
|
109
|
-
"@lancedb/lancedb-darwin-arm64": "0.
|
|
110
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.
|
|
111
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.
|
|
112
|
-
"@lancedb/lancedb-linux-x64-musl": "0.
|
|
113
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.
|
|
114
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.
|
|
115
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.
|
|
109
|
+
"@lancedb/lancedb-darwin-arm64": "0.38.0-beta.3",
|
|
110
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.38.0-beta.3",
|
|
111
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.38.0-beta.3",
|
|
112
|
+
"@lancedb/lancedb-linux-x64-musl": "0.38.0-beta.3",
|
|
113
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.38.0-beta.3",
|
|
114
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.38.0-beta.3",
|
|
115
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.38.0-beta.3"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"@types/node": ">=18",
|