@lancedb/lancedb 0.32.0-beta.1 → 0.33.0-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/dist/index.d.ts +39 -3
- package/dist/index.js +10 -0
- package/dist/indices.d.ts +6 -1
- package/dist/native.d.ts +16 -3
- package/dist/native.js +53 -52
- package/dist/query.d.ts +4 -1
- package/dist/query.js +6 -3
- package/dist/sanitize.js +4 -3
- package/dist/table.d.ts +101 -0
- package/dist/table.js +19 -0
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Connection } from "./connection";
|
|
2
2
|
import { ConnectNamespaceOptions, ConnectionOptions, Session } from "./native.js";
|
|
3
3
|
import { HeaderProvider } from "./header";
|
|
4
|
+
import type { BaseTokenizer } from "./indices";
|
|
5
|
+
import type { FtsToken } from "./table";
|
|
4
6
|
export { JsHeaderProvider as NativeJsHeaderProvider } from "./native.js";
|
|
5
7
|
export { instrumentLanceDbMetrics } from "./otel";
|
|
6
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";
|
|
7
9
|
export { makeArrowTable, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
|
|
8
10
|
export { Connection, CreateTableOptions, TableNamesOptions, OpenTableOptions, ListNamespacesOptions, CreateNamespaceOptions, DropNamespaceOptions, ListNamespacesResponse, CreateNamespaceResponse, DropNamespaceResponse, DescribeNamespaceResponse, RenameTableOptions, } from "./connection";
|
|
9
11
|
export { Session } from "./native.js";
|
|
10
|
-
export { ExecutableQuery, Query, QueryBase, VectorQuery, TakeQuery, QueryExecutionOptions, ColumnOrdering, FullTextSearchOptions, RecordBatchIterator, FullTextQuery, MatchQuery, PhraseQuery, BoostQuery, MultiMatchQuery, BooleanQuery, FullTextQueryType, Operator, Occur, } from "./query";
|
|
11
|
-
export { Index, IndexOptions, IvfPqOptions, IvfRqOptions, IvfFlatOptions, HnswPqOptions, HnswSqOptions, FtsOptions, } from "./indices";
|
|
12
|
-
export { Table, Branches, AddDataOptions, UpdateOptions, OptimizeOptions, Version, WriteProgress, LsmWriteSpec, ColumnAlteration, FieldMetadataUpdate, } from "./table";
|
|
12
|
+
export { ExecutableQuery, Query, QueryBase, VectorQuery, TakeQuery, AnalyzePlanDistributedMetrics, QueryExecutionOptions, ColumnOrdering, FullTextSearchOptions, RecordBatchIterator, FullTextQuery, MatchQuery, PhraseQuery, BoostQuery, MultiMatchQuery, BooleanQuery, FullTextQueryType, Operator, Occur, } from "./query";
|
|
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";
|
|
13
15
|
export { HeaderProvider, StaticHeaderProvider, OAuthHeaderProvider, TokenResponse, } from "./header";
|
|
14
16
|
export { OAuthConfig, OAuthFlowType } from "./oauth";
|
|
15
17
|
export { MergeInsertBuilder, WriteExecutionOptions } from "./merge";
|
|
@@ -19,6 +21,40 @@ export { Scannable, ScannableOptions } from "./scannable";
|
|
|
19
21
|
export * as rerankers from "./rerankers";
|
|
20
22
|
export { SchemaLike, TableLike, FieldLike, RecordBatchLike, DataLike, IntoVector, MultiVector, } from "./arrow";
|
|
21
23
|
export { IntoSql, packBits } from "./util";
|
|
24
|
+
/**
|
|
25
|
+
* Options for tokenizing a full-text search query without a table index.
|
|
26
|
+
*/
|
|
27
|
+
export interface TokenizeOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The tokenizer to use. The default is "simple".
|
|
30
|
+
*/
|
|
31
|
+
baseTokenizer?: BaseTokenizer;
|
|
32
|
+
/** Language for stemming and stop words. */
|
|
33
|
+
language?: string;
|
|
34
|
+
/** Maximum token length; tokens longer than this are ignored. */
|
|
35
|
+
maxTokenLength?: number;
|
|
36
|
+
/** Whether to lowercase tokens. */
|
|
37
|
+
lowercase?: boolean;
|
|
38
|
+
/** Whether to stem tokens. */
|
|
39
|
+
stem?: boolean;
|
|
40
|
+
/** Whether to remove stop words. */
|
|
41
|
+
removeStopWords?: boolean;
|
|
42
|
+
/** Whether to fold ASCII characters. */
|
|
43
|
+
asciiFolding?: boolean;
|
|
44
|
+
/** N-gram minimum length. */
|
|
45
|
+
ngramMinLength?: number;
|
|
46
|
+
/** N-gram maximum length. */
|
|
47
|
+
ngramMaxLength?: number;
|
|
48
|
+
/** Whether to only emit token prefixes for the n-gram tokenizer. */
|
|
49
|
+
prefixOnly?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Tokenize a full-text search query using an explicit tokenizer.
|
|
53
|
+
*
|
|
54
|
+
* This does not require a table or FTS index. The tokenizer options match
|
|
55
|
+
* {@link Index.fts}.
|
|
56
|
+
*/
|
|
57
|
+
export declare function tokenize(query: string, options?: Partial<TokenizeOptions>): Promise<FtsToken[]>;
|
|
22
58
|
/**
|
|
23
59
|
* Connect to a LanceDB instance at the given URI.
|
|
24
60
|
*
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.packBits = exports.rerankers = exports.Scannable = exports.PermutationBuilder = exports.permutationBuilder = exports.embedding = exports.MergeInsertBuilder = exports.OAuthFlowType = exports.OAuthHeaderProvider = exports.StaticHeaderProvider = exports.HeaderProvider = exports.Branches = exports.Table = exports.Index = exports.Occur = exports.Operator = exports.FullTextQueryType = exports.BooleanQuery = exports.MultiMatchQuery = exports.BoostQuery = exports.PhraseQuery = exports.MatchQuery = exports.RecordBatchIterator = exports.TakeQuery = exports.VectorQuery = exports.QueryBase = exports.Query = exports.Session = exports.Connection = exports.VectorColumnOptions = exports.MakeArrowTableOptions = exports.makeArrowTable = exports.BranchContents = exports.TagContents = exports.Tags = exports.instrumentLanceDbMetrics = exports.NativeJsHeaderProvider = void 0;
|
|
6
|
+
exports.tokenize = tokenize;
|
|
6
7
|
exports.connect = connect;
|
|
7
8
|
exports.connectNamespace = connectNamespace;
|
|
8
9
|
const connection_1 = require("./connection");
|
|
@@ -63,6 +64,15 @@ Object.defineProperty(exports, "Scannable", { enumerable: true, get: function ()
|
|
|
63
64
|
exports.rerankers = require("./rerankers");
|
|
64
65
|
var util_1 = require("./util");
|
|
65
66
|
Object.defineProperty(exports, "packBits", { enumerable: true, get: function () { return util_1.packBits; } });
|
|
67
|
+
/**
|
|
68
|
+
* Tokenize a full-text search query using an explicit tokenizer.
|
|
69
|
+
*
|
|
70
|
+
* This does not require a table or FTS index. The tokenizer options match
|
|
71
|
+
* {@link Index.fts}.
|
|
72
|
+
*/
|
|
73
|
+
async function tokenize(query, options) {
|
|
74
|
+
return await (0, native_js_1.tokenize)(query, options?.baseTokenizer, options?.language, options?.maxTokenLength, options?.lowercase, options?.stem, options?.removeStopWords, options?.asciiFolding, options?.ngramMinLength, options?.ngramMaxLength, options?.prefixOnly);
|
|
75
|
+
}
|
|
66
76
|
async function connect(uriOrOptions, optionsOrSession, sessionOrHeaderProvider, headerProvider) {
|
|
67
77
|
let uri;
|
|
68
78
|
let finalOptions = {};
|
package/dist/indices.d.ts
CHANGED
|
@@ -453,6 +453,7 @@ export interface IvfFlatOptions {
|
|
|
453
453
|
*/
|
|
454
454
|
sampleRate?: number;
|
|
455
455
|
}
|
|
456
|
+
export type BaseTokenizer = "simple" | "whitespace" | "raw" | "ngram" | "icu" | "icu/split" | `jieba/${string}` | `lindera/${string}`;
|
|
456
457
|
/**
|
|
457
458
|
* Options to create a full text search index
|
|
458
459
|
*/
|
|
@@ -475,8 +476,12 @@ export interface FtsOptions {
|
|
|
475
476
|
* "whitespace" - Whitespace tokenizer. This tokenizer splits the text into tokens using whitespace as a delimiter.
|
|
476
477
|
*
|
|
477
478
|
* "raw" - Raw tokenizer. This tokenizer does not split the text into tokens and indexes the entire text as a single token.
|
|
479
|
+
*
|
|
480
|
+
* "icu" - ICU dictionary-based word segmentation.
|
|
481
|
+
*
|
|
482
|
+
* "icu/split" - ICU segmentation with simple-style delimiter splitting.
|
|
478
483
|
*/
|
|
479
|
-
baseTokenizer?:
|
|
484
|
+
baseTokenizer?: BaseTokenizer;
|
|
480
485
|
/**
|
|
481
486
|
* language for stemming and stop words
|
|
482
487
|
* this is only used when `stem` or `remove_stop_words` is true
|
package/dist/native.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare class Branches {
|
|
|
11
11
|
create(name: string, fromRef?: string | undefined | null, fromVersion?: number | undefined | null): Promise<Table>
|
|
12
12
|
checkout(name: string, version?: number | undefined | null): Promise<Table>
|
|
13
13
|
delete(name: string): Promise<void>
|
|
14
|
+
diff(fromBranch: string): Promise<Record<string, unknown>>
|
|
15
|
+
merge(fromBranch: string, dryRun?: boolean | undefined | null): Promise<Record<string, unknown>>
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export declare class Connection {
|
|
@@ -154,7 +156,7 @@ export declare class Query {
|
|
|
154
156
|
outputSchema(): Promise<Buffer>
|
|
155
157
|
execute(maxBatchLength?: number | undefined | null, timeoutMs?: number | undefined | null): Promise<RecordBatchIterator>
|
|
156
158
|
explainPlan(verbose: boolean): Promise<string>
|
|
157
|
-
analyzePlan(): Promise<string>
|
|
159
|
+
analyzePlan(distributedMetrics?: string | undefined | null): Promise<string>
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
/** Typescript-style Async Iterator over RecordBatches */
|
|
@@ -249,6 +251,7 @@ export declare class Table {
|
|
|
249
251
|
currentBranch(): string | null
|
|
250
252
|
optimize(olderThanMs?: number | undefined | null, deleteUnverified?: boolean | undefined | null): Promise<OptimizeStats>
|
|
251
253
|
listIndices(): Promise<Array<IndexConfig>>
|
|
254
|
+
tokenize(query: string, column?: string | undefined | null, indexName?: string | undefined | null): Promise<Array<FtsToken>>
|
|
252
255
|
indexStats(indexName: string): Promise<IndexStatistics | null>
|
|
253
256
|
mergeInsert(on: Array<string>): NativeMergeInsertBuilder
|
|
254
257
|
usesV2ManifestPaths(): Promise<boolean>
|
|
@@ -275,7 +278,7 @@ export declare class TakeQuery {
|
|
|
275
278
|
outputSchema(): Promise<Buffer>
|
|
276
279
|
execute(maxBatchLength?: number | undefined | null, timeoutMs?: number | undefined | null): Promise<RecordBatchIterator>
|
|
277
280
|
explainPlan(verbose: boolean): Promise<string>
|
|
278
|
-
analyzePlan(): Promise<string>
|
|
281
|
+
analyzePlan(distributedMetrics?: string | undefined | null): Promise<string>
|
|
279
282
|
}
|
|
280
283
|
|
|
281
284
|
export declare class VectorQuery {
|
|
@@ -304,7 +307,7 @@ export declare class VectorQuery {
|
|
|
304
307
|
outputSchema(): Promise<Buffer>
|
|
305
308
|
execute(maxBatchLength?: number | undefined | null, timeoutMs?: number | undefined | null): Promise<RecordBatchIterator>
|
|
306
309
|
explainPlan(verbose: boolean): Promise<string>
|
|
307
|
-
analyzePlan(): Promise<string>
|
|
310
|
+
analyzePlan(distributedMetrics?: string | undefined | null): Promise<string>
|
|
308
311
|
}
|
|
309
312
|
|
|
310
313
|
export interface AddColumnsResult {
|
|
@@ -554,6 +557,14 @@ export interface FragmentSummaryStats {
|
|
|
554
557
|
p99: number
|
|
555
558
|
}
|
|
556
559
|
|
|
560
|
+
/** A token produced by the tokenizer configured on a full-text search index. */
|
|
561
|
+
export interface FtsToken {
|
|
562
|
+
/** The token text after the index tokenizer has applied its filters. */
|
|
563
|
+
text: string
|
|
564
|
+
/** The token position used by full-text query matching. */
|
|
565
|
+
position: number
|
|
566
|
+
}
|
|
567
|
+
|
|
557
568
|
/** A description of an index currently configured on a column */
|
|
558
569
|
export interface IndexConfig {
|
|
559
570
|
/** The name of the index */
|
|
@@ -925,6 +936,8 @@ export interface TlsConfig {
|
|
|
925
936
|
assertHostname?: boolean
|
|
926
937
|
}
|
|
927
938
|
|
|
939
|
+
export declare function tokenize(query: string, baseTokenizer?: string | undefined | null, language?: string | undefined | null, maxTokenLength?: number | undefined | null, lowerCase?: boolean | undefined | null, stem?: boolean | undefined | null, removeStopWords?: boolean | undefined | null, asciiFolding?: boolean | undefined | null, ngramMinLength?: number | undefined | null, ngramMaxLength?: number | undefined | null, prefixOnly?: boolean | undefined | null): Array<FtsToken>
|
|
940
|
+
|
|
928
941
|
export interface UpdateFieldMetadataResult {
|
|
929
942
|
version: number
|
|
930
943
|
}
|
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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 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.33.0-beta.0' && 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.33.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
|
@@ -684,3 +684,4 @@ module.exports.lancedbMetricsCatalog = nativeBinding.lancedbMetricsCatalog;
|
|
|
684
684
|
module.exports.permutationBuilder = nativeBinding.permutationBuilder;
|
|
685
685
|
module.exports.registerLancedbMetricsRecorder = nativeBinding.registerLancedbMetricsRecorder;
|
|
686
686
|
module.exports.snapshotLancedbMetrics = nativeBinding.snapshotLancedbMetrics;
|
|
687
|
+
module.exports.tokenize = nativeBinding.tokenize;
|
package/dist/query.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface QueryExecutionOptions {
|
|
|
19
19
|
*/
|
|
20
20
|
timeoutMs?: number;
|
|
21
21
|
}
|
|
22
|
+
export type AnalyzePlanDistributedMetrics = "aggregate" | "per_worker" | "full";
|
|
22
23
|
export interface ColumnOrdering {
|
|
23
24
|
columnName: string;
|
|
24
25
|
ascending?: boolean;
|
|
@@ -158,9 +159,11 @@ export declare class QueryBase<NativeQueryType extends NativeQuery | NativeVecto
|
|
|
158
159
|
* KNNVectorDistance: metric=l2, metrics=[output_rows=1, elapsed_compute=114.333µs, output_batches=1]
|
|
159
160
|
* LanceScan: uri=/path/to/data, projection=[vector], row_id=true, row_addr=false, ordered=false, metrics=[output_rows=1, elapsed_compute=103.626µs, bytes_read=549, iops=2, requests=2]
|
|
160
161
|
*
|
|
162
|
+
* @param distributedMetrics - How distributed worker metrics are displayed for remote query plans.
|
|
163
|
+
* Defaults to `"aggregate"`.
|
|
161
164
|
* @returns A query execution plan with runtime metrics for each step.
|
|
162
165
|
*/
|
|
163
|
-
analyzePlan(): Promise<string>;
|
|
166
|
+
analyzePlan(distributedMetrics?: AnalyzePlanDistributedMetrics): Promise<string>;
|
|
164
167
|
/**
|
|
165
168
|
* Returns the schema of the output that will be returned by this query.
|
|
166
169
|
*
|
package/dist/query.js
CHANGED
|
@@ -231,14 +231,17 @@ class QueryBase {
|
|
|
231
231
|
* KNNVectorDistance: metric=l2, metrics=[output_rows=1, elapsed_compute=114.333µs, output_batches=1]
|
|
232
232
|
* LanceScan: uri=/path/to/data, projection=[vector], row_id=true, row_addr=false, ordered=false, metrics=[output_rows=1, elapsed_compute=103.626µs, bytes_read=549, iops=2, requests=2]
|
|
233
233
|
*
|
|
234
|
+
* @param distributedMetrics - How distributed worker metrics are displayed for remote query plans.
|
|
235
|
+
* Defaults to `"aggregate"`.
|
|
234
236
|
* @returns A query execution plan with runtime metrics for each step.
|
|
235
237
|
*/
|
|
236
|
-
async analyzePlan() {
|
|
238
|
+
async analyzePlan(distributedMetrics) {
|
|
239
|
+
const distributedMetricsMode = distributedMetrics ?? "aggregate";
|
|
237
240
|
if (this.inner instanceof Promise) {
|
|
238
|
-
return this.inner.then((inner) => inner.analyzePlan());
|
|
241
|
+
return this.inner.then((inner) => inner.analyzePlan(distributedMetricsMode));
|
|
239
242
|
}
|
|
240
243
|
else {
|
|
241
|
-
return this.inner.analyzePlan();
|
|
244
|
+
return this.inner.analyzePlan(distributedMetricsMode);
|
|
242
245
|
}
|
|
243
246
|
}
|
|
244
247
|
/**
|
package/dist/sanitize.js
CHANGED
|
@@ -178,9 +178,10 @@ function sanitizeMap(typeLike) {
|
|
|
178
178
|
if (!("keysSorted" in typeLike) || typeof typeLike.keysSorted !== "boolean") {
|
|
179
179
|
throw Error("Expected a Map type to have a `keysSorted` property");
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
if (typeLike.children.length !== 1) {
|
|
182
|
+
throw Error("Expected a Map type to have exactly one child");
|
|
183
|
+
}
|
|
184
|
+
return new arrow_1.Map_(sanitizeField(typeLike.children[0]), typeLike.keysSorted);
|
|
184
185
|
}
|
|
185
186
|
function sanitizeDuration(typeLike) {
|
|
186
187
|
if (!("unit" in typeLike) || typeof typeLike.unit !== "number") {
|
package/dist/table.d.ts
CHANGED
|
@@ -108,6 +108,22 @@ export interface Version {
|
|
|
108
108
|
timestamp: Date;
|
|
109
109
|
metadata: Record<string, string>;
|
|
110
110
|
}
|
|
111
|
+
/** Token produced by the tokenizer configured on a full-text search index. */
|
|
112
|
+
export interface FtsToken {
|
|
113
|
+
/** Token text after tokenizer filters have been applied. */
|
|
114
|
+
text: string;
|
|
115
|
+
/** Token position used by full-text query matching. */
|
|
116
|
+
position: number;
|
|
117
|
+
}
|
|
118
|
+
export type TokenizeTableOptions = {
|
|
119
|
+
/** FTS-indexed column whose tokenizer should be used. */
|
|
120
|
+
column: string;
|
|
121
|
+
indexName?: never;
|
|
122
|
+
} | {
|
|
123
|
+
/** Name of the FTS index whose tokenizer should be used. */
|
|
124
|
+
indexName: string;
|
|
125
|
+
column?: never;
|
|
126
|
+
};
|
|
111
127
|
/**
|
|
112
128
|
* Specification selecting Lance's MemWAL LSM-style write path for
|
|
113
129
|
* `mergeInsert`.
|
|
@@ -616,6 +632,16 @@ export declare abstract class Table {
|
|
|
616
632
|
abstract optimize(options?: Partial<OptimizeOptions>): Promise<OptimizeStats>;
|
|
617
633
|
/** List all indices that have been created with {@link Table.createIndex} */
|
|
618
634
|
abstract listIndices(): Promise<IndexConfig[]>;
|
|
635
|
+
/**
|
|
636
|
+
* Tokenize a full-text search query using the tokenizer configured on an FTS index.
|
|
637
|
+
*
|
|
638
|
+
* Specify exactly one of `column` or `indexName`.
|
|
639
|
+
*
|
|
640
|
+
* Model-backed tokenizers such as `jieba/*` and `lindera/*` are rebuilt in
|
|
641
|
+
* the client process from index metadata. For remote tables, this means the
|
|
642
|
+
* same tokenizer model files must also exist locally.
|
|
643
|
+
*/
|
|
644
|
+
abstract tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
|
|
619
645
|
/** Return the table as an arrow table */
|
|
620
646
|
abstract toArrow(): Promise<ArrowTable>;
|
|
621
647
|
abstract mergeInsert(on: string | string[]): MergeInsertBuilder;
|
|
@@ -704,6 +730,7 @@ export declare class LocalTable extends Table {
|
|
|
704
730
|
currentBranch(): string | null;
|
|
705
731
|
optimize(options?: Partial<OptimizeOptions>): Promise<OptimizeStats>;
|
|
706
732
|
listIndices(): Promise<IndexConfig[]>;
|
|
733
|
+
tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
|
|
707
734
|
toArrow(): Promise<ArrowTable>;
|
|
708
735
|
indexStats(name: string): Promise<IndexStatistics | undefined>;
|
|
709
736
|
stats(): Promise<TableStatistics>;
|
|
@@ -781,6 +808,68 @@ export interface FieldMetadataUpdate {
|
|
|
781
808
|
/** If true, replace the field's entire metadata map instead of merging. */
|
|
782
809
|
replace?: boolean;
|
|
783
810
|
}
|
|
811
|
+
/** Summary of a column in a branch diff. */
|
|
812
|
+
export interface BranchColumnSummary {
|
|
813
|
+
name: string;
|
|
814
|
+
dataType: string;
|
|
815
|
+
nullable: boolean;
|
|
816
|
+
}
|
|
817
|
+
/** A column whose definition differs between main and the branch. */
|
|
818
|
+
export interface BranchColumnChange {
|
|
819
|
+
name: string;
|
|
820
|
+
main: BranchColumnSummary;
|
|
821
|
+
branch: BranchColumnSummary;
|
|
822
|
+
}
|
|
823
|
+
/** Summary of an index in a branch diff. */
|
|
824
|
+
export interface BranchIndexSummary {
|
|
825
|
+
indexName: string;
|
|
826
|
+
columns: string[];
|
|
827
|
+
indexType?: string;
|
|
828
|
+
status: string;
|
|
829
|
+
}
|
|
830
|
+
/** Row-level comparison between main and the branch. */
|
|
831
|
+
export interface BranchRowCountSummary {
|
|
832
|
+
unchanged: number;
|
|
833
|
+
newOnBase: number;
|
|
834
|
+
newOnBranch: number;
|
|
835
|
+
staleRecompute: number;
|
|
836
|
+
inputsChanged: number;
|
|
837
|
+
deltaAvailable: boolean;
|
|
838
|
+
}
|
|
839
|
+
/** A reason why a branch cannot currently be merged. */
|
|
840
|
+
export interface MergeBlocker {
|
|
841
|
+
code: string;
|
|
842
|
+
message: string;
|
|
843
|
+
}
|
|
844
|
+
/** Read-only comparison of a branch against main. */
|
|
845
|
+
export interface BranchDiff {
|
|
846
|
+
fromBranch: string;
|
|
847
|
+
parentVersion: number;
|
|
848
|
+
mainVersion: number;
|
|
849
|
+
branchVersion: number;
|
|
850
|
+
baseMoved: boolean;
|
|
851
|
+
rowCountMain: number;
|
|
852
|
+
rowCountBranch: number;
|
|
853
|
+
rowSummary: BranchRowCountSummary;
|
|
854
|
+
addedColumns: BranchColumnSummary[];
|
|
855
|
+
removedColumns: BranchColumnSummary[];
|
|
856
|
+
changedColumns: BranchColumnChange[];
|
|
857
|
+
addedIndexes: BranchIndexSummary[];
|
|
858
|
+
removedIndexes: BranchIndexSummary[];
|
|
859
|
+
mergeable: boolean;
|
|
860
|
+
mergeBlockers: MergeBlocker[];
|
|
861
|
+
}
|
|
862
|
+
/** Changes that would be, or were, promoted by a branch merge. */
|
|
863
|
+
export interface MergePreview {
|
|
864
|
+
promotedColumns: string[];
|
|
865
|
+
}
|
|
866
|
+
/** Result of previewing or attempting a branch merge. */
|
|
867
|
+
export interface MergeBranchResult {
|
|
868
|
+
status: "ready" | "rejected" | "notImplemented" | "merged" | "unknown";
|
|
869
|
+
diff: BranchDiff;
|
|
870
|
+
preview: MergePreview;
|
|
871
|
+
mainVersionAfter?: number;
|
|
872
|
+
}
|
|
784
873
|
/**
|
|
785
874
|
* Branch manager for a {@link Table}.
|
|
786
875
|
*
|
|
@@ -814,4 +903,16 @@ export declare class Branches {
|
|
|
814
903
|
checkout(name: string, version?: number): Promise<Table>;
|
|
815
904
|
/** Delete a branch. */
|
|
816
905
|
delete(name: string): Promise<void>;
|
|
906
|
+
/** Compare a branch against main without modifying either branch. */
|
|
907
|
+
diff(fromBranch: string): Promise<BranchDiff>;
|
|
908
|
+
/**
|
|
909
|
+
* Merge a branch into main.
|
|
910
|
+
*
|
|
911
|
+
* Set `dryRun` to `true` to preview the merge. A rejected merge resolves
|
|
912
|
+
* with `status: "rejected"` instead of throwing.
|
|
913
|
+
*
|
|
914
|
+
* @param fromBranch Branch to merge from.
|
|
915
|
+
* @param dryRun When true, only preview the merge. Defaults to false.
|
|
916
|
+
*/
|
|
917
|
+
merge(fromBranch: string, dryRun?: boolean): Promise<MergeBranchResult>;
|
|
817
918
|
}
|
package/dist/table.js
CHANGED
|
@@ -337,6 +337,9 @@ class LocalTable extends Table {
|
|
|
337
337
|
async listIndices() {
|
|
338
338
|
return await this.inner.listIndices();
|
|
339
339
|
}
|
|
340
|
+
async tokenize(query, options) {
|
|
341
|
+
return await this.inner.tokenize(query, options?.column, options?.indexName);
|
|
342
|
+
}
|
|
340
343
|
async toArrow() {
|
|
341
344
|
return await this.query().toArrow();
|
|
342
345
|
}
|
|
@@ -430,5 +433,21 @@ class Branches {
|
|
|
430
433
|
async delete(name) {
|
|
431
434
|
return await this.#inner.delete(name);
|
|
432
435
|
}
|
|
436
|
+
/** Compare a branch against main without modifying either branch. */
|
|
437
|
+
async diff(fromBranch) {
|
|
438
|
+
return (await this.#inner.diff(fromBranch));
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Merge a branch into main.
|
|
442
|
+
*
|
|
443
|
+
* Set `dryRun` to `true` to preview the merge. A rejected merge resolves
|
|
444
|
+
* with `status: "rejected"` instead of throwing.
|
|
445
|
+
*
|
|
446
|
+
* @param fromBranch Branch to merge from.
|
|
447
|
+
* @param dryRun When true, only preview the merge. Defaults to false.
|
|
448
|
+
*/
|
|
449
|
+
async merge(fromBranch, dryRun = false) {
|
|
450
|
+
return (await this.#inner.merge(fromBranch, dryRun));
|
|
451
|
+
}
|
|
433
452
|
}
|
|
434
453
|
exports.Branches = Branches;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.33.0-beta.0",
|
|
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.33.0-beta.0",
|
|
110
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.33.0-beta.0",
|
|
111
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.33.0-beta.0",
|
|
112
|
+
"@lancedb/lancedb-linux-x64-musl": "0.33.0-beta.0",
|
|
113
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.33.0-beta.0",
|
|
114
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.33.0-beta.0",
|
|
115
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.33.0-beta.0"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"apache-arrow": ">=15.0.0 <=18.1.0"
|