@lancedb/lancedb 0.37.1-beta.0 → 0.37.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1 -1
- package/dist/connection.d.ts +36 -1
- package/dist/connection.js +20 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +3 -2
- package/dist/indices.d.ts +9 -0
- package/dist/indices.js +1 -1
- package/dist/native.d.ts +96 -3
- package/dist/native.js +53 -52
- package/dist/sanitize.d.ts +1 -1
- package/dist/sanitize.js +89 -25
- package/dist/table.d.ts +9 -1
- package/dist/table.js +5 -0
- package/package.json +14 -8
package/CONTRIBUTING.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Contributing to LanceDB Typescript
|
|
2
2
|
|
|
3
3
|
This document outlines the process for contributing to LanceDB Typescript.
|
|
4
|
-
For general contribution guidelines, see [CONTRIBUTING.md](
|
|
4
|
+
For general contribution guidelines, see [CONTRIBUTING.md](https://github.com/lancedb/lancedb/blob/main/CONTRIBUTING.md).
|
|
5
5
|
|
|
6
6
|
## Project layout
|
|
7
7
|
|
package/dist/connection.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Data, SchemaLike, TableLike } from "./arrow";
|
|
2
|
+
import { Table as ArrowTable } from "./arrow";
|
|
2
3
|
import { EmbeddingFunctionConfig } from "./embedding/registry";
|
|
3
4
|
import { Connection as LanceDbConnection } from "./native";
|
|
4
|
-
import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, ListNamespacesResponse } from "./native";
|
|
5
|
+
import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, Job, JobDescription, JobInfo, ListNamespacesResponse } from "./native";
|
|
5
6
|
export type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, ListNamespacesResponse, };
|
|
6
7
|
import { Table } from "./table";
|
|
7
8
|
export interface CreateTableOptions {
|
|
@@ -333,6 +334,35 @@ export declare abstract class Connection {
|
|
|
333
334
|
* `newNamespacePath` is omitted the table stays in `namespacePath`.
|
|
334
335
|
*/
|
|
335
336
|
abstract renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
|
|
337
|
+
/**
|
|
338
|
+
* A {@link Job} handle for a server-side job by id.
|
|
339
|
+
*
|
|
340
|
+
* The handle is constructed without a server round trip; an unknown id
|
|
341
|
+
* surfaces when the handle is used. Dropping the handle has no effect on
|
|
342
|
+
* the job itself.
|
|
343
|
+
*/
|
|
344
|
+
abstract job(jobId: string): Job;
|
|
345
|
+
/** List server-side jobs across the database's tables. */
|
|
346
|
+
abstract listJobs(): Promise<JobInfo[]>;
|
|
347
|
+
/**
|
|
348
|
+
* Describe a single server-side job by id.
|
|
349
|
+
*
|
|
350
|
+
* Resolves to `null` when the server has no such job.
|
|
351
|
+
*/
|
|
352
|
+
abstract getJob(jobId: string): Promise<JobDescription | null>;
|
|
353
|
+
/**
|
|
354
|
+
* Request cancellation of a server-side job by id.
|
|
355
|
+
*
|
|
356
|
+
* Resolves to true if the server accepted the cancellation, false if no
|
|
357
|
+
* such job exists. Cancelling an already-terminal job is a no-op success.
|
|
358
|
+
*/
|
|
359
|
+
abstract cancelJob(jobId: string): Promise<boolean>;
|
|
360
|
+
/**
|
|
361
|
+
* The lifecycle event history of a server-side job, as an Arrow table.
|
|
362
|
+
*
|
|
363
|
+
* Lists history across all jobs when `jobId` is omitted.
|
|
364
|
+
*/
|
|
365
|
+
abstract jobHistory(jobId?: string): Promise<ArrowTable>;
|
|
336
366
|
}
|
|
337
367
|
/** @hideconstructor */
|
|
338
368
|
export declare class LocalConnection extends Connection {
|
|
@@ -364,6 +394,11 @@ export declare class LocalConnection extends Connection {
|
|
|
364
394
|
createNamespace(namespacePath: string[], options?: Partial<CreateNamespaceOptions>): Promise<CreateNamespaceResponse>;
|
|
365
395
|
dropNamespace(namespacePath: string[], options?: Partial<DropNamespaceOptions>): Promise<DropNamespaceResponse>;
|
|
366
396
|
renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
|
|
397
|
+
job(jobId: string): Job;
|
|
398
|
+
listJobs(): Promise<JobInfo[]>;
|
|
399
|
+
getJob(jobId: string): Promise<JobDescription | null>;
|
|
400
|
+
cancelJob(jobId: string): Promise<boolean>;
|
|
401
|
+
jobHistory(jobId?: string): Promise<ArrowTable>;
|
|
367
402
|
}
|
|
368
403
|
/**
|
|
369
404
|
* Takes storage options and makes all the keys snake case.
|
package/dist/connection.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.LocalConnection = exports.Connection = void 0;
|
|
6
6
|
exports.cleanseStorageOptions = cleanseStorageOptions;
|
|
7
|
+
const apache_arrow_1 = require("apache-arrow");
|
|
7
8
|
const arrow_1 = require("./arrow");
|
|
8
9
|
const arrow_2 = require("./arrow");
|
|
9
10
|
const registry_1 = require("./embedding/registry");
|
|
@@ -191,6 +192,25 @@ class LocalConnection extends Connection {
|
|
|
191
192
|
async renameTable(currentName, newName, options) {
|
|
192
193
|
return this.inner.renameTable(currentName, newName, options?.namespacePath ?? [], options?.newNamespacePath);
|
|
193
194
|
}
|
|
195
|
+
job(jobId) {
|
|
196
|
+
return this.inner.job(jobId);
|
|
197
|
+
}
|
|
198
|
+
async listJobs() {
|
|
199
|
+
return this.inner.listJobs();
|
|
200
|
+
}
|
|
201
|
+
async getJob(jobId) {
|
|
202
|
+
return this.inner.getJob(jobId);
|
|
203
|
+
}
|
|
204
|
+
async cancelJob(jobId) {
|
|
205
|
+
return this.inner.cancelJob(jobId);
|
|
206
|
+
}
|
|
207
|
+
async jobHistory(jobId) {
|
|
208
|
+
const buf = await this.inner.jobHistory(jobId);
|
|
209
|
+
if (buf.length === 0) {
|
|
210
|
+
return new arrow_2.Table();
|
|
211
|
+
}
|
|
212
|
+
return (0, apache_arrow_1.tableFromIPC)(buf);
|
|
213
|
+
}
|
|
194
214
|
}
|
|
195
215
|
exports.LocalConnection = LocalConnection;
|
|
196
216
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { instrumentLanceDbMetrics } from "./otel";
|
|
|
8
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";
|
|
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
|
-
export { Session } from "./native.js";
|
|
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
14
|
export { Table, Branches, BranchColumnSummary, BranchColumnChange, BranchIndexSummary, BranchRowCountSummary, MergeBlocker, BranchDiff, MergePreview, MergeBranchResult, AddDataOptions, UpdateOptions, OptimizeOptions, Version, WriteProgress, FtsToken, TokenizeTableOptions, LsmWriteSpec, ColumnAlteration, FieldMetadataUpdate, } from "./table";
|
|
@@ -39,6 +39,15 @@ export interface TokenizeOptions {
|
|
|
39
39
|
stem?: boolean;
|
|
40
40
|
/** Whether to remove stop words. */
|
|
41
41
|
removeStopWords?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Custom stop words that replace the built-in list for `language`.
|
|
44
|
+
*
|
|
45
|
+
* This option only affects tokenization when `removeStopWords` is true.
|
|
46
|
+
*
|
|
47
|
+
* `undefined` keeps the built-in language list. An empty array explicitly
|
|
48
|
+
* replaces it with no stop words.
|
|
49
|
+
*/
|
|
50
|
+
customStopWords?: string[];
|
|
42
51
|
/** Whether to fold ASCII characters. */
|
|
43
52
|
asciiFolding?: boolean;
|
|
44
53
|
/** N-gram minimum length. */
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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.Job = exports.Connection = exports.VectorColumnOptions = exports.MakeArrowTableOptions = exports.makeArrowTable = exports.BranchContents = exports.TagContents = exports.Tags = exports.instrumentLanceDbMetrics = exports.NativeJsHeaderProvider = void 0;
|
|
6
6
|
exports.tokenize = tokenize;
|
|
7
7
|
exports.connect = connect;
|
|
8
8
|
exports.connectNamespace = connectNamespace;
|
|
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "VectorColumnOptions", { enumerable: true, get: f
|
|
|
27
27
|
var connection_2 = require("./connection");
|
|
28
28
|
Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_2.Connection; } });
|
|
29
29
|
var native_js_4 = require("./native.js");
|
|
30
|
+
Object.defineProperty(exports, "Job", { enumerable: true, get: function () { return native_js_4.Job; } });
|
|
30
31
|
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return native_js_4.Session; } });
|
|
31
32
|
var query_1 = require("./query");
|
|
32
33
|
Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return query_1.Query; } });
|
|
@@ -71,7 +72,7 @@ Object.defineProperty(exports, "packBits", { enumerable: true, get: function ()
|
|
|
71
72
|
* {@link Index.fts}.
|
|
72
73
|
*/
|
|
73
74
|
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
|
+
return await (0, native_js_1.tokenize)(query, options?.baseTokenizer, options?.language, options?.maxTokenLength, options?.lowercase, options?.stem, options?.removeStopWords, options?.customStopWords, options?.asciiFolding, options?.ngramMinLength, options?.ngramMaxLength, options?.prefixOnly);
|
|
75
76
|
}
|
|
76
77
|
async function connect(uriOrOptions, optionsOrSession, sessionOrHeaderProvider, headerProvider) {
|
|
77
78
|
let uri;
|
package/dist/indices.d.ts
CHANGED
|
@@ -504,6 +504,15 @@ export interface FtsOptions {
|
|
|
504
504
|
* whether to remove stop words
|
|
505
505
|
*/
|
|
506
506
|
removeStopWords?: boolean;
|
|
507
|
+
/**
|
|
508
|
+
* Custom stop words that replace the built-in list for `language`.
|
|
509
|
+
*
|
|
510
|
+
* This option only affects tokenization when `removeStopWords` is true.
|
|
511
|
+
*
|
|
512
|
+
* `undefined` keeps the built-in language list. An empty array explicitly
|
|
513
|
+
* replaces it with no stop words.
|
|
514
|
+
*/
|
|
515
|
+
customStopWords?: string[];
|
|
507
516
|
/**
|
|
508
517
|
* whether to remove punctuation
|
|
509
518
|
*/
|
package/dist/indices.js
CHANGED
|
@@ -136,7 +136,7 @@ class Index {
|
|
|
136
136
|
* You can combine filters with full text search.
|
|
137
137
|
*/
|
|
138
138
|
static fts(options) {
|
|
139
|
-
return new Index(native_1.Index.fts(options?.withPosition, options?.baseTokenizer, options?.language, options?.maxTokenLength, options?.lowercase, options?.stem, options?.removeStopWords, options?.asciiFolding, options?.ngramMinLength, options?.ngramMaxLength, options?.prefixOnly, options?.blockSize));
|
|
139
|
+
return new Index(native_1.Index.fts(options?.withPosition, options?.baseTokenizer, options?.language, options?.maxTokenLength, options?.lowercase, options?.stem, options?.removeStopWords, options?.customStopWords, options?.asciiFolding, options?.ngramMinLength, options?.ngramMaxLength, options?.prefixOnly, options?.blockSize));
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
*
|
package/dist/native.d.ts
CHANGED
|
@@ -39,6 +39,31 @@ export declare class Connection {
|
|
|
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
41
|
dropAllTables(namespacePath?: Array<string> | undefined | null): Promise<void>
|
|
42
|
+
/**
|
|
43
|
+
* A `Job` handle for a server-side job by id.
|
|
44
|
+
*
|
|
45
|
+
* The handle is constructed without a server round trip; an unknown id
|
|
46
|
+
* surfaces when the handle is used.
|
|
47
|
+
*/
|
|
48
|
+
job(jobId: string): Job
|
|
49
|
+
/** List server-side jobs across the database's tables. */
|
|
50
|
+
listJobs(): Promise<Array<JobInfo>>
|
|
51
|
+
/**
|
|
52
|
+
* Describe a single server-side job by id. `null` when the server has
|
|
53
|
+
* no such job.
|
|
54
|
+
*/
|
|
55
|
+
getJob(jobId: string): Promise<JobDescription | null>
|
|
56
|
+
/**
|
|
57
|
+
* Request cancellation of a server-side job by id. Returns true if the
|
|
58
|
+
* server accepted the cancellation, false if no such job exists.
|
|
59
|
+
*/
|
|
60
|
+
cancelJob(jobId: string): Promise<boolean>
|
|
61
|
+
/**
|
|
62
|
+
* The lifecycle event history of a server-side job (all jobs when
|
|
63
|
+
* `job_id` is null), as an Arrow IPC stream buffer. Empty when there is
|
|
64
|
+
* no history.
|
|
65
|
+
*/
|
|
66
|
+
jobHistory(jobId?: string | undefined | null): Promise<Buffer>
|
|
42
67
|
/** Describe a namespace and return its properties. */
|
|
43
68
|
describeNamespace(namespacePath: Array<string>): Promise<DescribeNamespaceResponse>
|
|
44
69
|
/** List child namespaces under the given namespace path */
|
|
@@ -63,11 +88,33 @@ export declare class Index {
|
|
|
63
88
|
static bitmap(): Index
|
|
64
89
|
static labelList(): Index
|
|
65
90
|
static fm(): Index
|
|
66
|
-
static fts(withPosition?: boolean | undefined | null, 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, blockSize?: number | undefined | null): Index
|
|
91
|
+
static fts(withPosition?: boolean | undefined | null, baseTokenizer?: string | undefined | null, language?: string | undefined | null, maxTokenLength?: number | undefined | null, lowerCase?: boolean | undefined | null, stem?: boolean | undefined | null, removeStopWords?: boolean | undefined | null, customStopWords?: Array<string> | undefined | null, asciiFolding?: boolean | undefined | null, ngramMinLength?: number | undefined | null, ngramMaxLength?: number | undefined | null, prefixOnly?: boolean | undefined | null, blockSize?: number | undefined | null): Index
|
|
67
92
|
static hnswPq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, numSubVectors?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, m?: number | undefined | null, efConstruction?: number | undefined | null): Index
|
|
68
93
|
static hnswSq(distanceType?: string | undefined | null, numPartitions?: number | undefined | null, maxIterations?: number | undefined | null, sampleRate?: number | undefined | null, m?: number | undefined | null, efConstruction?: number | undefined | null): Index
|
|
69
94
|
}
|
|
70
95
|
|
|
96
|
+
/** A handle to an operation that may still be running. */
|
|
97
|
+
export declare class Job {
|
|
98
|
+
/**
|
|
99
|
+
* Identifies the operation on the server that is running it. Operations
|
|
100
|
+
* that run in this process have no server id. The value is opaque.
|
|
101
|
+
*/
|
|
102
|
+
get id(): string | null
|
|
103
|
+
/**
|
|
104
|
+
* The operation's current lifecycle state: "running", "finished",
|
|
105
|
+
* "failed", or "cancelled".
|
|
106
|
+
*
|
|
107
|
+
* A point snapshot; unlike {@link Job.wait} it does not block or reject
|
|
108
|
+
* on a terminal failure state. States a newer server reports that this
|
|
109
|
+
* client version does not know pass through as-is.
|
|
110
|
+
*/
|
|
111
|
+
status(): Promise<string>
|
|
112
|
+
/** Wait until the operation reaches a terminal state. */
|
|
113
|
+
wait(): Promise<void>
|
|
114
|
+
/** Request cancellation. Cancelling a finished operation is a no-op. */
|
|
115
|
+
cancel(): Promise<void>
|
|
116
|
+
}
|
|
117
|
+
|
|
71
118
|
export declare class JsFullTextQuery {
|
|
72
119
|
static matchQuery(query: string, column: string, boost: number, fuzziness: number | undefined | null, maxExpansions: number, operator: string, prefixLength: number): JsFullTextQuery
|
|
73
120
|
static phraseQuery(query: string, column: string, slop: number): JsFullTextQuery
|
|
@@ -218,6 +265,7 @@ export declare class Table {
|
|
|
218
265
|
countRows(filter?: string | undefined | null): Promise<number>
|
|
219
266
|
delete(predicate: string): Promise<DeleteResult>
|
|
220
267
|
createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null, waitTimeoutS?: number | undefined | null, name?: string | undefined | null, train?: boolean | undefined | null): Promise<void>
|
|
268
|
+
createIndexAsync(index: Index | undefined | null, column: string, replace?: boolean | undefined | null, waitTimeoutS?: number | undefined | null, name?: string | undefined | null, train?: boolean | undefined | null): Promise<Job>
|
|
221
269
|
dropIndex(indexName: string): Promise<void>
|
|
222
270
|
prewarmIndex(indexName: string): Promise<void>
|
|
223
271
|
prewarmData(columns?: Array<string> | undefined | null): Promise<void>
|
|
@@ -655,6 +703,46 @@ export interface IndexStatistics {
|
|
|
655
703
|
numIndices?: number
|
|
656
704
|
}
|
|
657
705
|
|
|
706
|
+
/** A described job from `Connection.getJob`. */
|
|
707
|
+
export interface JobDescription {
|
|
708
|
+
jobId: string
|
|
709
|
+
jobType: string
|
|
710
|
+
/** Lifecycle state: "running", "finished", "failed", or "cancelled". */
|
|
711
|
+
state: string
|
|
712
|
+
/** When the job was created, in milliseconds since the epoch. */
|
|
713
|
+
creationMs: number
|
|
714
|
+
/** The job-type-specific specification as a JSON string, when present. */
|
|
715
|
+
specJson?: string
|
|
716
|
+
/**
|
|
717
|
+
* Why the job failed, when the job is failed and the server reports a
|
|
718
|
+
* reason.
|
|
719
|
+
*/
|
|
720
|
+
failure?: JobFailureInfo
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/** The server's account of why a job failed. */
|
|
724
|
+
export interface JobFailureInfo {
|
|
725
|
+
phase?: string
|
|
726
|
+
message?: string
|
|
727
|
+
retryable?: boolean
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/** A row from `Connection.listJobs`: one server-side job. */
|
|
731
|
+
export interface JobInfo {
|
|
732
|
+
/**
|
|
733
|
+
* The job id -- what `Connection.getJob` and `Connection.cancelJob`
|
|
734
|
+
* accept.
|
|
735
|
+
*/
|
|
736
|
+
jobId: string
|
|
737
|
+
/** The table the job runs against, without URI or namespace. */
|
|
738
|
+
table: string
|
|
739
|
+
jobType: string
|
|
740
|
+
/** Lifecycle state: "running", "finished", "failed", or "cancelled". */
|
|
741
|
+
state: string
|
|
742
|
+
/** When the job was created, in milliseconds since the epoch. */
|
|
743
|
+
createdAtMillis: number
|
|
744
|
+
}
|
|
745
|
+
|
|
658
746
|
/** The catalog of described LanceDB metrics. Empty until the recorder is installed. */
|
|
659
747
|
export declare function lancedbMetricsCatalog(): Array<MetricDescription>
|
|
660
748
|
|
|
@@ -886,7 +974,12 @@ export interface SplitSequentialOptions {
|
|
|
886
974
|
}
|
|
887
975
|
|
|
888
976
|
export interface TableStatistics {
|
|
889
|
-
/**
|
|
977
|
+
/**
|
|
978
|
+
* The total size, in bytes, of the table's data files, index files, and
|
|
979
|
+
* overlay files
|
|
980
|
+
*
|
|
981
|
+
* Read from the manifest, so this excludes deletion files and manifests.
|
|
982
|
+
*/
|
|
890
983
|
totalBytes: number
|
|
891
984
|
/** The number of rows in the table */
|
|
892
985
|
numRows: number
|
|
@@ -939,7 +1032,7 @@ export interface TlsConfig {
|
|
|
939
1032
|
assertHostname?: boolean
|
|
940
1033
|
}
|
|
941
1034
|
|
|
942
|
-
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>
|
|
1035
|
+
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, customStopWords?: Array<string> | undefined | null, asciiFolding?: boolean | undefined | null, ngramMinLength?: number | undefined | null, ngramMaxLength?: number | undefined | null, prefixOnly?: boolean | undefined | null): Array<FtsToken>
|
|
943
1036
|
|
|
944
1037
|
export interface UpdateFieldMetadataResult {
|
|
945
1038
|
version: number
|
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.37.1-beta.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
79
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
98
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
123
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
142
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
162
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
181
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
204
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
222
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
241
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
265
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
284
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
309
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
328
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
349
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
368
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
389
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
408
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
429
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
448
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
469
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
488
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
508
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
527
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
551
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
570
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 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.37.1-beta.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.37.1-beta.
|
|
589
|
+
if (bindingPackageVersion !== '0.37.1-beta.2' && 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.37.1-beta.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
|
@@ -665,6 +665,7 @@ module.exports.BranchContents = nativeBinding.BranchContents;
|
|
|
665
665
|
module.exports.Branches = nativeBinding.Branches;
|
|
666
666
|
module.exports.Connection = nativeBinding.Connection;
|
|
667
667
|
module.exports.Index = nativeBinding.Index;
|
|
668
|
+
module.exports.Job = nativeBinding.Job;
|
|
668
669
|
module.exports.JsFullTextQuery = nativeBinding.JsFullTextQuery;
|
|
669
670
|
module.exports.JsHeaderProvider = nativeBinding.JsHeaderProvider;
|
|
670
671
|
module.exports.NapiScannable = nativeBinding.NapiScannable;
|
package/dist/sanitize.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function sanitizeFixedSizeBinary(typeLike: object): FixedSizeBina
|
|
|
17
17
|
export declare function sanitizeFixedSizeList(typeLike: object): FixedSizeList<any>;
|
|
18
18
|
export declare function sanitizeMap(typeLike: object): Map_<any, any>;
|
|
19
19
|
export declare function sanitizeDuration(typeLike: object): Duration<Type.Duration | Type.DurationSecond | Type.DurationMillisecond | Type.DurationMicrosecond | Type.DurationNanosecond>;
|
|
20
|
-
export declare function sanitizeDictionary(typeLike: object): Dictionary<DataType<
|
|
20
|
+
export declare function sanitizeDictionary(typeLike: object): Dictionary<DataType<Type, any>, TKeys>;
|
|
21
21
|
export declare function sanitizeType(typeLike: unknown): DataType<any>;
|
|
22
22
|
export declare function sanitizeField(fieldLike: unknown): Field;
|
|
23
23
|
/**
|
package/dist/sanitize.js
CHANGED
|
@@ -34,6 +34,13 @@ exports.dataTypeFromName = dataTypeFromName;
|
|
|
34
34
|
// and so we must sanitize the input to ensure that it is compatible.
|
|
35
35
|
const apache_arrow_1 = require("apache-arrow");
|
|
36
36
|
const arrow_1 = require("./arrow");
|
|
37
|
+
function createSanitizationContext() {
|
|
38
|
+
return {
|
|
39
|
+
types: new WeakMap(),
|
|
40
|
+
vectors: new WeakMap(),
|
|
41
|
+
data: new WeakMap(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
37
44
|
function sanitizeMetadata(metadataLike) {
|
|
38
45
|
if (metadataLike === undefined || metadataLike === null) {
|
|
39
46
|
return undefined;
|
|
@@ -115,21 +122,30 @@ function sanitizeInterval(typeLike) {
|
|
|
115
122
|
return new arrow_1.Interval(typeLike.unit);
|
|
116
123
|
}
|
|
117
124
|
function sanitizeList(typeLike) {
|
|
125
|
+
return sanitizeListWithContext(typeLike, createSanitizationContext());
|
|
126
|
+
}
|
|
127
|
+
function sanitizeListWithContext(typeLike, context) {
|
|
118
128
|
if (!("children" in typeLike) || !Array.isArray(typeLike.children)) {
|
|
119
129
|
throw Error("Expected a List type to have an array-like `children` property");
|
|
120
130
|
}
|
|
121
131
|
if (typeLike.children.length !== 1) {
|
|
122
132
|
throw Error("Expected a List type to have exactly one child");
|
|
123
133
|
}
|
|
124
|
-
return new arrow_1.List(
|
|
134
|
+
return new arrow_1.List(sanitizeFieldWithContext(typeLike.children[0], context));
|
|
125
135
|
}
|
|
126
136
|
function sanitizeStruct(typeLike) {
|
|
137
|
+
return sanitizeStructWithContext(typeLike, createSanitizationContext());
|
|
138
|
+
}
|
|
139
|
+
function sanitizeStructWithContext(typeLike, context) {
|
|
127
140
|
if (!("children" in typeLike) || !Array.isArray(typeLike.children)) {
|
|
128
141
|
throw Error("Expected a Struct type to have an array-like `children` property");
|
|
129
142
|
}
|
|
130
|
-
return new arrow_1.Struct(typeLike.children.map((child) =>
|
|
143
|
+
return new arrow_1.Struct(typeLike.children.map((child) => sanitizeFieldWithContext(child, context)));
|
|
131
144
|
}
|
|
132
145
|
function sanitizeUnion(typeLike) {
|
|
146
|
+
return sanitizeUnionWithContext(typeLike, createSanitizationContext());
|
|
147
|
+
}
|
|
148
|
+
function sanitizeUnionWithContext(typeLike, context) {
|
|
133
149
|
if (!("typeIds" in typeLike) ||
|
|
134
150
|
!("mode" in typeLike) ||
|
|
135
151
|
typeof typeLike.mode !== "number") {
|
|
@@ -140,18 +156,23 @@ function sanitizeUnion(typeLike) {
|
|
|
140
156
|
}
|
|
141
157
|
return new arrow_1.Union(typeLike.mode,
|
|
142
158
|
// biome-ignore lint/suspicious/noExplicitAny: skip
|
|
143
|
-
typeLike.typeIds, typeLike.children.map((child) =>
|
|
159
|
+
typeLike.typeIds, typeLike.children.map((child) => sanitizeFieldWithContext(child, context)));
|
|
144
160
|
}
|
|
145
161
|
function sanitizeTypedUnion(typeLike,
|
|
146
162
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
147
163
|
UnionType) {
|
|
164
|
+
return sanitizeTypedUnionWithContext(typeLike, UnionType, createSanitizationContext());
|
|
165
|
+
}
|
|
166
|
+
function sanitizeTypedUnionWithContext(typeLike,
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
168
|
+
UnionType, context) {
|
|
148
169
|
if (!("typeIds" in typeLike)) {
|
|
149
170
|
throw Error("Expected a DenseUnion/SparseUnion type to have a `typeIds` property");
|
|
150
171
|
}
|
|
151
172
|
if (!("children" in typeLike) || !Array.isArray(typeLike.children)) {
|
|
152
173
|
throw Error("Expected a DenseUnion/SparseUnion type to have an array-like `children` property");
|
|
153
174
|
}
|
|
154
|
-
return new UnionType(typeLike.typeIds, typeLike.children.map((child) =>
|
|
175
|
+
return new UnionType(typeLike.typeIds, typeLike.children.map((child) => sanitizeFieldWithContext(child, context)));
|
|
155
176
|
}
|
|
156
177
|
function sanitizeFixedSizeBinary(typeLike) {
|
|
157
178
|
if (!("byteWidth" in typeLike) || typeof typeLike.byteWidth !== "number") {
|
|
@@ -160,6 +181,9 @@ function sanitizeFixedSizeBinary(typeLike) {
|
|
|
160
181
|
return new arrow_1.FixedSizeBinary(typeLike.byteWidth);
|
|
161
182
|
}
|
|
162
183
|
function sanitizeFixedSizeList(typeLike) {
|
|
184
|
+
return sanitizeFixedSizeListWithContext(typeLike, createSanitizationContext());
|
|
185
|
+
}
|
|
186
|
+
function sanitizeFixedSizeListWithContext(typeLike, context) {
|
|
163
187
|
if (!("listSize" in typeLike) || typeof typeLike.listSize !== "number") {
|
|
164
188
|
throw Error("Expected a FixedSizeList type to have a `listSize` property");
|
|
165
189
|
}
|
|
@@ -169,9 +193,12 @@ function sanitizeFixedSizeList(typeLike) {
|
|
|
169
193
|
if (typeLike.children.length !== 1) {
|
|
170
194
|
throw Error("Expected a FixedSizeList type to have exactly one child");
|
|
171
195
|
}
|
|
172
|
-
return new arrow_1.FixedSizeList(typeLike.listSize,
|
|
196
|
+
return new arrow_1.FixedSizeList(typeLike.listSize, sanitizeFieldWithContext(typeLike.children[0], context));
|
|
173
197
|
}
|
|
174
198
|
function sanitizeMap(typeLike) {
|
|
199
|
+
return sanitizeMapWithContext(typeLike, createSanitizationContext());
|
|
200
|
+
}
|
|
201
|
+
function sanitizeMapWithContext(typeLike, context) {
|
|
175
202
|
if (!("children" in typeLike) || !Array.isArray(typeLike.children)) {
|
|
176
203
|
throw Error("Expected a Map type to have an array-like `children` property");
|
|
177
204
|
}
|
|
@@ -181,7 +208,7 @@ function sanitizeMap(typeLike) {
|
|
|
181
208
|
if (typeLike.children.length !== 1) {
|
|
182
209
|
throw Error("Expected a Map type to have exactly one child");
|
|
183
210
|
}
|
|
184
|
-
return new arrow_1.Map_(
|
|
211
|
+
return new arrow_1.Map_(sanitizeFieldWithContext(typeLike.children[0], context), typeLike.keysSorted);
|
|
185
212
|
}
|
|
186
213
|
function sanitizeDuration(typeLike) {
|
|
187
214
|
if (!("unit" in typeLike) || typeof typeLike.unit !== "number") {
|
|
@@ -190,6 +217,9 @@ function sanitizeDuration(typeLike) {
|
|
|
190
217
|
return new arrow_1.Duration(typeLike.unit);
|
|
191
218
|
}
|
|
192
219
|
function sanitizeDictionary(typeLike) {
|
|
220
|
+
return sanitizeDictionaryWithContext(typeLike, createSanitizationContext());
|
|
221
|
+
}
|
|
222
|
+
function sanitizeDictionaryWithContext(typeLike, context) {
|
|
193
223
|
if (!("id" in typeLike) || typeof typeLike.id !== "number") {
|
|
194
224
|
throw Error("Expected a Dictionary type to have an `id` property");
|
|
195
225
|
}
|
|
@@ -202,16 +232,23 @@ function sanitizeDictionary(typeLike) {
|
|
|
202
232
|
if (!("isOrdered" in typeLike) || typeof typeLike.isOrdered !== "boolean") {
|
|
203
233
|
throw Error("Expected a Dictionary type to have an `isOrdered` property");
|
|
204
234
|
}
|
|
205
|
-
return new arrow_1.Dictionary(
|
|
235
|
+
return new arrow_1.Dictionary(sanitizeTypeWithContext(typeLike.dictionary, context), sanitizeTypeWithContext(typeLike.indices, context), typeLike.id, typeLike.isOrdered);
|
|
206
236
|
}
|
|
207
237
|
// biome-ignore lint/suspicious/noExplicitAny: skip
|
|
208
238
|
function sanitizeType(typeLike) {
|
|
239
|
+
return sanitizeTypeWithContext(typeLike, createSanitizationContext());
|
|
240
|
+
}
|
|
241
|
+
function sanitizeTypeWithContext(typeLike, context) {
|
|
209
242
|
if (typeof typeLike === "string") {
|
|
210
243
|
return dataTypeFromName(typeLike);
|
|
211
244
|
}
|
|
212
245
|
if (typeof typeLike !== "object" || typeLike === null) {
|
|
213
246
|
throw Error("Expected a Type but object was null/undefined");
|
|
214
247
|
}
|
|
248
|
+
const cached = context.types.get(typeLike);
|
|
249
|
+
if (cached !== undefined) {
|
|
250
|
+
return cached;
|
|
251
|
+
}
|
|
215
252
|
if (!("typeId" in typeLike) ||
|
|
216
253
|
!(typeof typeLike.typeId !== "function" ||
|
|
217
254
|
typeof typeLike.typeId !== "number")) {
|
|
@@ -227,6 +264,11 @@ function sanitizeType(typeLike) {
|
|
|
227
264
|
else {
|
|
228
265
|
throw Error("Type's typeId property was not a function or number");
|
|
229
266
|
}
|
|
267
|
+
const type = sanitizeTypeById(typeLike, typeId, context);
|
|
268
|
+
context.types.set(typeLike, type);
|
|
269
|
+
return type;
|
|
270
|
+
}
|
|
271
|
+
function sanitizeTypeById(typeLike, typeId, context) {
|
|
230
272
|
switch (typeId) {
|
|
231
273
|
case arrow_1.Type.NONE:
|
|
232
274
|
throw Error("Received a Type with a typeId of NONE");
|
|
@@ -253,21 +295,21 @@ function sanitizeType(typeLike) {
|
|
|
253
295
|
case arrow_1.Type.Interval:
|
|
254
296
|
return sanitizeInterval(typeLike);
|
|
255
297
|
case arrow_1.Type.List:
|
|
256
|
-
return
|
|
298
|
+
return sanitizeListWithContext(typeLike, context);
|
|
257
299
|
case arrow_1.Type.Struct:
|
|
258
|
-
return
|
|
300
|
+
return sanitizeStructWithContext(typeLike, context);
|
|
259
301
|
case arrow_1.Type.Union:
|
|
260
|
-
return
|
|
302
|
+
return sanitizeUnionWithContext(typeLike, context);
|
|
261
303
|
case arrow_1.Type.FixedSizeBinary:
|
|
262
304
|
return sanitizeFixedSizeBinary(typeLike);
|
|
263
305
|
case arrow_1.Type.FixedSizeList:
|
|
264
|
-
return
|
|
306
|
+
return sanitizeFixedSizeListWithContext(typeLike, context);
|
|
265
307
|
case arrow_1.Type.Map:
|
|
266
|
-
return
|
|
308
|
+
return sanitizeMapWithContext(typeLike, context);
|
|
267
309
|
case arrow_1.Type.Duration:
|
|
268
310
|
return sanitizeDuration(typeLike);
|
|
269
311
|
case arrow_1.Type.Dictionary:
|
|
270
|
-
return
|
|
312
|
+
return sanitizeDictionaryWithContext(typeLike, context);
|
|
271
313
|
case arrow_1.Type.Int8:
|
|
272
314
|
return new arrow_1.Int8();
|
|
273
315
|
case arrow_1.Type.Int16:
|
|
@@ -311,9 +353,9 @@ function sanitizeType(typeLike) {
|
|
|
311
353
|
case arrow_1.Type.TimestampSecond:
|
|
312
354
|
return sanitizeTypedTimestamp(typeLike, arrow_1.TimestampSecond);
|
|
313
355
|
case arrow_1.Type.DenseUnion:
|
|
314
|
-
return
|
|
356
|
+
return sanitizeTypedUnionWithContext(typeLike, arrow_1.DenseUnion, context);
|
|
315
357
|
case arrow_1.Type.SparseUnion:
|
|
316
|
-
return
|
|
358
|
+
return sanitizeTypedUnionWithContext(typeLike, arrow_1.SparseUnion, context);
|
|
317
359
|
case arrow_1.Type.IntervalDayTime:
|
|
318
360
|
return new arrow_1.IntervalDayTime();
|
|
319
361
|
case arrow_1.Type.IntervalYearMonth:
|
|
@@ -331,6 +373,9 @@ function sanitizeType(typeLike) {
|
|
|
331
373
|
}
|
|
332
374
|
}
|
|
333
375
|
function sanitizeField(fieldLike) {
|
|
376
|
+
return sanitizeFieldWithContext(fieldLike, createSanitizationContext());
|
|
377
|
+
}
|
|
378
|
+
function sanitizeFieldWithContext(fieldLike, context) {
|
|
334
379
|
if (fieldLike instanceof arrow_1.Field) {
|
|
335
380
|
return fieldLike;
|
|
336
381
|
}
|
|
@@ -344,7 +389,7 @@ function sanitizeField(fieldLike) {
|
|
|
344
389
|
}
|
|
345
390
|
let type;
|
|
346
391
|
try {
|
|
347
|
-
type =
|
|
392
|
+
type = sanitizeTypeWithContext(fieldLike.type, context);
|
|
348
393
|
}
|
|
349
394
|
catch (error) {
|
|
350
395
|
throw Error(`Unable to sanitize type for field: ${fieldLike.name} due to error: ${error}`, { cause: error });
|
|
@@ -371,6 +416,9 @@ function sanitizeField(fieldLike) {
|
|
|
371
416
|
* than lancedb is using.
|
|
372
417
|
*/
|
|
373
418
|
function sanitizeSchema(schemaLike) {
|
|
419
|
+
return sanitizeSchemaWithContext(schemaLike, createSanitizationContext());
|
|
420
|
+
}
|
|
421
|
+
function sanitizeSchemaWithContext(schemaLike, context) {
|
|
374
422
|
if (schemaLike instanceof arrow_1.Schema) {
|
|
375
423
|
return schemaLike;
|
|
376
424
|
}
|
|
@@ -387,7 +435,7 @@ function sanitizeSchema(schemaLike) {
|
|
|
387
435
|
if (!Array.isArray(schemaLike.fields)) {
|
|
388
436
|
throw Error("The schema passed in had a 'fields' property but it was not an array");
|
|
389
437
|
}
|
|
390
|
-
const sanitizedFields = schemaLike.fields.map((field) =>
|
|
438
|
+
const sanitizedFields = schemaLike.fields.map((field) => sanitizeFieldWithContext(field, context));
|
|
391
439
|
return new arrow_1.Schema(sanitizedFields, metadata);
|
|
392
440
|
}
|
|
393
441
|
function sanitizeTable(tableLike) {
|
|
@@ -403,11 +451,12 @@ function sanitizeTable(tableLike) {
|
|
|
403
451
|
if (!("batches" in tableLike)) {
|
|
404
452
|
throw Error("The table passed in does not appear to be a table (no 'columns' property)");
|
|
405
453
|
}
|
|
406
|
-
const
|
|
407
|
-
const
|
|
454
|
+
const context = createSanitizationContext();
|
|
455
|
+
const schema = sanitizeSchemaWithContext(tableLike.schema, context);
|
|
456
|
+
const batches = tableLike.batches.map((batch) => sanitizeRecordBatch(batch, context));
|
|
408
457
|
return new arrow_1.Table(schema, batches);
|
|
409
458
|
}
|
|
410
|
-
function sanitizeRecordBatch(batchLike) {
|
|
459
|
+
function sanitizeRecordBatch(batchLike, context) {
|
|
411
460
|
if (batchLike instanceof arrow_1.RecordBatch) {
|
|
412
461
|
return batchLike;
|
|
413
462
|
}
|
|
@@ -420,20 +469,35 @@ function sanitizeRecordBatch(batchLike) {
|
|
|
420
469
|
if (!("data" in batchLike)) {
|
|
421
470
|
throw Error("The record batch passed in does not appear to be a record batch (no 'data' property)");
|
|
422
471
|
}
|
|
423
|
-
const schema =
|
|
424
|
-
const data = sanitizeData(batchLike.data);
|
|
472
|
+
const schema = sanitizeSchemaWithContext(batchLike.schema, context);
|
|
473
|
+
const data = sanitizeData(batchLike.data, context);
|
|
425
474
|
return new arrow_1.RecordBatch(schema, data);
|
|
426
475
|
}
|
|
427
|
-
function sanitizeData(dataLike) {
|
|
476
|
+
function sanitizeData(dataLike, context) {
|
|
428
477
|
if (dataLike instanceof apache_arrow_1.Data) {
|
|
429
478
|
return dataLike;
|
|
430
479
|
}
|
|
431
|
-
|
|
480
|
+
const cachedData = context.data.get(dataLike);
|
|
481
|
+
if (cachedData !== undefined) {
|
|
482
|
+
return cachedData;
|
|
483
|
+
}
|
|
484
|
+
const dictionaryLike = dataLike.dictionary;
|
|
485
|
+
let dictionary;
|
|
486
|
+
if (dictionaryLike !== undefined) {
|
|
487
|
+
dictionary = context.vectors.get(dictionaryLike);
|
|
488
|
+
if (dictionary === undefined) {
|
|
489
|
+
dictionary = new apache_arrow_1.Vector(dictionaryLike.data.map((data) => sanitizeData(data, context)));
|
|
490
|
+
context.vectors.set(dictionaryLike, dictionary);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
const data = new apache_arrow_1.Data(sanitizeTypeWithContext(dataLike.type, context), dataLike.offset, dataLike.length, dataLike.nullCount, {
|
|
432
494
|
[apache_arrow_1.BufferType.OFFSET]: dataLike.valueOffsets,
|
|
433
495
|
[apache_arrow_1.BufferType.DATA]: dataLike.values,
|
|
434
496
|
[apache_arrow_1.BufferType.VALIDITY]: dataLike.nullBitmap,
|
|
435
497
|
[apache_arrow_1.BufferType.TYPE]: dataLike.typeIds,
|
|
436
|
-
});
|
|
498
|
+
}, dataLike.children.map((child) => sanitizeData(child, context)), dictionary);
|
|
499
|
+
context.data.set(dataLike, data);
|
|
500
|
+
return data;
|
|
437
501
|
}
|
|
438
502
|
const constructorsByTypeName = {
|
|
439
503
|
null: () => new arrow_1.Null(),
|
package/dist/table.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, 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, Branches as NativeBranches, OptimizeStats, 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";
|
|
@@ -284,6 +284,13 @@ export declare abstract class Table {
|
|
|
284
284
|
* await table.createIndex("my_float_col");
|
|
285
285
|
*/
|
|
286
286
|
abstract createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
|
|
287
|
+
/**
|
|
288
|
+
* Create an index, returning a handle to the indexing job.
|
|
289
|
+
*
|
|
290
|
+
* The job may already be complete when returned; callers must not assume
|
|
291
|
+
* the index exists until {@link Job.wait} resolves.
|
|
292
|
+
*/
|
|
293
|
+
abstract createIndexAsync(column: string, options?: Partial<IndexOptions>): Promise<Job>;
|
|
287
294
|
/**
|
|
288
295
|
* Drop an index from the table.
|
|
289
296
|
*
|
|
@@ -702,6 +709,7 @@ export declare class LocalTable extends Table {
|
|
|
702
709
|
countRows(filter?: string): Promise<number>;
|
|
703
710
|
delete(predicate: string): Promise<DeleteResult>;
|
|
704
711
|
createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
|
|
712
|
+
createIndexAsync(column: string, options?: Partial<IndexOptions>): Promise<Job>;
|
|
705
713
|
dropIndex(name: string): Promise<void>;
|
|
706
714
|
prewarmIndex(name: string): Promise<void>;
|
|
707
715
|
prewarmData(columns?: string[]): Promise<void>;
|
package/dist/table.js
CHANGED
|
@@ -139,6 +139,11 @@ class LocalTable extends Table {
|
|
|
139
139
|
const nativeIndex = options?.config?.inner;
|
|
140
140
|
await this.inner.createIndex(nativeIndex, column, options?.replace, options?.waitTimeoutSeconds, options?.name, options?.train);
|
|
141
141
|
}
|
|
142
|
+
async createIndexAsync(column, options) {
|
|
143
|
+
// biome-ignore lint/suspicious/noExplicitAny: skip
|
|
144
|
+
const nativeIndex = options?.config?.inner;
|
|
145
|
+
return await this.inner.createIndexAsync(nativeIndex, column, options?.replace, options?.waitTimeoutSeconds, options?.name, options?.train);
|
|
146
|
+
}
|
|
142
147
|
async dropIndex(name) {
|
|
143
148
|
await this.inner.dropIndex(name);
|
|
144
149
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.37.1-beta.
|
|
14
|
+
"version": "0.37.1-beta.2",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -106,15 +106,21 @@
|
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"@huggingface/transformers": "3.0.2",
|
|
108
108
|
"openai": "4.29.2",
|
|
109
|
-
"@lancedb/lancedb-darwin-arm64": "0.37.1-beta.
|
|
110
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.37.1-beta.
|
|
111
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.37.1-beta.
|
|
112
|
-
"@lancedb/lancedb-linux-x64-musl": "0.37.1-beta.
|
|
113
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.37.1-beta.
|
|
114
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.37.1-beta.
|
|
115
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.37.1-beta.
|
|
109
|
+
"@lancedb/lancedb-darwin-arm64": "0.37.1-beta.2",
|
|
110
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.37.1-beta.2",
|
|
111
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.37.1-beta.2",
|
|
112
|
+
"@lancedb/lancedb-linux-x64-musl": "0.37.1-beta.2",
|
|
113
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.37.1-beta.2",
|
|
114
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.37.1-beta.2",
|
|
115
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.37.1-beta.2"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
|
+
"@types/node": ">=18",
|
|
118
119
|
"apache-arrow": ">=15.0.0 <=18.1.0"
|
|
120
|
+
},
|
|
121
|
+
"peerDependenciesMeta": {
|
|
122
|
+
"@types/node": {
|
|
123
|
+
"optional": true
|
|
124
|
+
}
|
|
119
125
|
}
|
|
120
126
|
}
|