@lancedb/lancedb 0.10.0-beta.1 → 0.11.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/connection.d.ts +12 -4
- package/dist/connection.js +4 -4
- package/dist/indices.d.ts +235 -1
- package/dist/indices.js +26 -2
- package/dist/native.d.ts +10 -4
- package/dist/query.d.ts +1 -0
- package/dist/query.js +4 -0
- package/dist/table.d.ts +21 -0
- package/dist/table.js +25 -0
- package/package.json +6 -6
package/dist/connection.d.ts
CHANGED
|
@@ -30,16 +30,24 @@ export interface CreateTableOptions {
|
|
|
30
30
|
/**
|
|
31
31
|
* The version of the data storage format to use.
|
|
32
32
|
*
|
|
33
|
-
* The default is `
|
|
34
|
-
*
|
|
33
|
+
* The default is `stable`.
|
|
34
|
+
* Set to "legacy" to use the old format.
|
|
35
35
|
*/
|
|
36
36
|
dataStorageVersion?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Use the new V2 manifest paths. These paths provide more efficient
|
|
39
|
+
* opening of datasets with many versions on object stores. WARNING:
|
|
40
|
+
* turning this on will make the dataset unreadable for older versions
|
|
41
|
+
* of LanceDB (prior to 0.10.0). To migrate an existing dataset, instead
|
|
42
|
+
* use the {@link LocalTable#migrateManifestPathsV2} method.
|
|
43
|
+
*/
|
|
44
|
+
enableV2ManifestPaths?: boolean;
|
|
37
45
|
/**
|
|
38
46
|
* If true then data files will be written with the legacy format
|
|
39
47
|
*
|
|
40
|
-
* The default is
|
|
48
|
+
* The default is false.
|
|
41
49
|
*
|
|
42
|
-
* Deprecated.
|
|
50
|
+
* Deprecated. Use data storage version instead.
|
|
43
51
|
*/
|
|
44
52
|
useLegacyFormat?: boolean;
|
|
45
53
|
schema?: SchemaLike;
|
package/dist/connection.js
CHANGED
|
@@ -73,14 +73,14 @@ class LocalConnection extends Connection {
|
|
|
73
73
|
throw new Error("data is required");
|
|
74
74
|
}
|
|
75
75
|
const { buf, mode } = await table_1.Table.parseTableData(data, options);
|
|
76
|
-
let dataStorageVersion = "
|
|
76
|
+
let dataStorageVersion = "stable";
|
|
77
77
|
if (options?.dataStorageVersion !== undefined) {
|
|
78
78
|
dataStorageVersion = options.dataStorageVersion;
|
|
79
79
|
}
|
|
80
80
|
else if (options?.useLegacyFormat !== undefined) {
|
|
81
81
|
dataStorageVersion = options.useLegacyFormat ? "legacy" : "stable";
|
|
82
82
|
}
|
|
83
|
-
const innerTable = await this.inner.createTable(nameOrOptions, buf, mode, cleanseStorageOptions(options?.storageOptions), dataStorageVersion);
|
|
83
|
+
const innerTable = await this.inner.createTable(nameOrOptions, buf, mode, cleanseStorageOptions(options?.storageOptions), dataStorageVersion, options?.enableV2ManifestPaths);
|
|
84
84
|
return new table_1.LocalTable(innerTable);
|
|
85
85
|
}
|
|
86
86
|
async createEmptyTable(name, schema, options) {
|
|
@@ -95,7 +95,7 @@ class LocalConnection extends Connection {
|
|
|
95
95
|
const registry = (0, registry_1.getRegistry)();
|
|
96
96
|
metadata = registry.getTableMetadata([embeddingFunction]);
|
|
97
97
|
}
|
|
98
|
-
let dataStorageVersion = "
|
|
98
|
+
let dataStorageVersion = "stable";
|
|
99
99
|
if (options?.dataStorageVersion !== undefined) {
|
|
100
100
|
dataStorageVersion = options.dataStorageVersion;
|
|
101
101
|
}
|
|
@@ -104,7 +104,7 @@ class LocalConnection extends Connection {
|
|
|
104
104
|
}
|
|
105
105
|
const table = (0, arrow_1.makeEmptyTable)(schema, metadata);
|
|
106
106
|
const buf = await (0, arrow_1.fromTableToBuffer)(table);
|
|
107
|
-
const innerTable = await this.inner.createEmptyTable(name, buf, mode, cleanseStorageOptions(options?.storageOptions), dataStorageVersion);
|
|
107
|
+
const innerTable = await this.inner.createEmptyTable(name, buf, mode, cleanseStorageOptions(options?.storageOptions), dataStorageVersion, options?.enableV2ManifestPaths);
|
|
108
108
|
return new table_1.LocalTable(innerTable);
|
|
109
109
|
}
|
|
110
110
|
async dropTable(name) {
|
package/dist/indices.d.ts
CHANGED
|
@@ -92,6 +92,220 @@ export interface IvfPqOptions {
|
|
|
92
92
|
*/
|
|
93
93
|
sampleRate?: number;
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Options to create an `HNSW_PQ` index
|
|
97
|
+
*/
|
|
98
|
+
export interface HnswPqOptions {
|
|
99
|
+
/**
|
|
100
|
+
* The distance metric used to train the index.
|
|
101
|
+
*
|
|
102
|
+
* Default value is "l2".
|
|
103
|
+
*
|
|
104
|
+
* The following distance types are available:
|
|
105
|
+
*
|
|
106
|
+
* "l2" - Euclidean distance. This is a very common distance metric that
|
|
107
|
+
* accounts for both magnitude and direction when determining the distance
|
|
108
|
+
* between vectors. L2 distance has a range of [0, ∞).
|
|
109
|
+
*
|
|
110
|
+
* "cosine" - Cosine distance. Cosine distance is a distance metric
|
|
111
|
+
* calculated from the cosine similarity between two vectors. Cosine
|
|
112
|
+
* similarity is a measure of similarity between two non-zero vectors of an
|
|
113
|
+
* inner product space. It is defined to equal the cosine of the angle
|
|
114
|
+
* between them. Unlike L2, the cosine distance is not affected by the
|
|
115
|
+
* magnitude of the vectors. Cosine distance has a range of [0, 2].
|
|
116
|
+
*
|
|
117
|
+
* "dot" - Dot product. Dot distance is the dot product of two vectors. Dot
|
|
118
|
+
* distance has a range of (-∞, ∞). If the vectors are normalized (i.e. their
|
|
119
|
+
* L2 norm is 1), then dot distance is equivalent to the cosine distance.
|
|
120
|
+
*/
|
|
121
|
+
distanceType?: "l2" | "cosine" | "dot";
|
|
122
|
+
/**
|
|
123
|
+
* The number of IVF partitions to create.
|
|
124
|
+
*
|
|
125
|
+
* For HNSW, we recommend a small number of partitions. Setting this to 1 works
|
|
126
|
+
* well for most tables. For very large tables, training just one HNSW graph
|
|
127
|
+
* will require too much memory. Each partition becomes its own HNSW graph, so
|
|
128
|
+
* setting this value higher reduces the peak memory use of training.
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
numPartitions?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Number of sub-vectors of PQ.
|
|
134
|
+
*
|
|
135
|
+
* This value controls how much the vector is compressed during the quantization step.
|
|
136
|
+
* The more sub vectors there are the less the vector is compressed. The default is
|
|
137
|
+
* the dimension of the vector divided by 16. If the dimension is not evenly divisible
|
|
138
|
+
* by 16 we use the dimension divded by 8.
|
|
139
|
+
*
|
|
140
|
+
* The above two cases are highly preferred. Having 8 or 16 values per subvector allows
|
|
141
|
+
* us to use efficient SIMD instructions.
|
|
142
|
+
*
|
|
143
|
+
* If the dimension is not visible by 8 then we use 1 subvector. This is not ideal and
|
|
144
|
+
* will likely result in poor performance.
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
numSubVectors?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Max iterations to train kmeans.
|
|
150
|
+
*
|
|
151
|
+
* The default value is 50.
|
|
152
|
+
*
|
|
153
|
+
* When training an IVF index we use kmeans to calculate the partitions. This parameter
|
|
154
|
+
* controls how many iterations of kmeans to run.
|
|
155
|
+
*
|
|
156
|
+
* Increasing this might improve the quality of the index but in most cases the parameter
|
|
157
|
+
* is unused because kmeans will converge with fewer iterations. The parameter is only
|
|
158
|
+
* used in cases where kmeans does not appear to converge. In those cases it is unlikely
|
|
159
|
+
* that setting this larger will lead to the index converging anyways.
|
|
160
|
+
*
|
|
161
|
+
*/
|
|
162
|
+
maxIterations?: number;
|
|
163
|
+
/**
|
|
164
|
+
* The rate used to calculate the number of training vectors for kmeans.
|
|
165
|
+
*
|
|
166
|
+
* Default value is 256.
|
|
167
|
+
*
|
|
168
|
+
* When an IVF index is trained, we need to calculate partitions. These are groups
|
|
169
|
+
* of vectors that are similar to each other. To do this we use an algorithm called kmeans.
|
|
170
|
+
*
|
|
171
|
+
* Running kmeans on a large dataset can be slow. To speed this up we run kmeans on a
|
|
172
|
+
* random sample of the data. This parameter controls the size of the sample. The total
|
|
173
|
+
* number of vectors used to train the index is `sample_rate * num_partitions`.
|
|
174
|
+
*
|
|
175
|
+
* Increasing this value might improve the quality of the index but in most cases the
|
|
176
|
+
* default should be sufficient.
|
|
177
|
+
*
|
|
178
|
+
*/
|
|
179
|
+
sampleRate?: number;
|
|
180
|
+
/**
|
|
181
|
+
* The number of neighbors to select for each vector in the HNSW graph.
|
|
182
|
+
*
|
|
183
|
+
* The default value is 20.
|
|
184
|
+
*
|
|
185
|
+
* This value controls the tradeoff between search speed and accuracy.
|
|
186
|
+
* The higher the value the more accurate the search but the slower it will be.
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
189
|
+
m?: number;
|
|
190
|
+
/**
|
|
191
|
+
* The number of candidates to evaluate during the construction of the HNSW graph.
|
|
192
|
+
*
|
|
193
|
+
* The default value is 300.
|
|
194
|
+
*
|
|
195
|
+
* This value controls the tradeoff between build speed and accuracy.
|
|
196
|
+
* The higher the value the more accurate the build but the slower it will be.
|
|
197
|
+
* 150 to 300 is the typical range. 100 is a minimum for good quality search
|
|
198
|
+
* results. In most cases, there is no benefit to setting this higher than 500.
|
|
199
|
+
* This value should be set to a value that is not less than `ef` in the search phase.
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
efConstruction?: number;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Options to create an `HNSW_SQ` index
|
|
206
|
+
*/
|
|
207
|
+
export interface HnswSqOptions {
|
|
208
|
+
/**
|
|
209
|
+
* The distance metric used to train the index.
|
|
210
|
+
*
|
|
211
|
+
* Default value is "l2".
|
|
212
|
+
*
|
|
213
|
+
* The following distance types are available:
|
|
214
|
+
*
|
|
215
|
+
* "l2" - Euclidean distance. This is a very common distance metric that
|
|
216
|
+
* accounts for both magnitude and direction when determining the distance
|
|
217
|
+
* between vectors. L2 distance has a range of [0, ∞).
|
|
218
|
+
*
|
|
219
|
+
* "cosine" - Cosine distance. Cosine distance is a distance metric
|
|
220
|
+
* calculated from the cosine similarity between two vectors. Cosine
|
|
221
|
+
* similarity is a measure of similarity between two non-zero vectors of an
|
|
222
|
+
* inner product space. It is defined to equal the cosine of the angle
|
|
223
|
+
* between them. Unlike L2, the cosine distance is not affected by the
|
|
224
|
+
* magnitude of the vectors. Cosine distance has a range of [0, 2].
|
|
225
|
+
*
|
|
226
|
+
* "dot" - Dot product. Dot distance is the dot product of two vectors. Dot
|
|
227
|
+
* distance has a range of (-∞, ∞). If the vectors are normalized (i.e. their
|
|
228
|
+
* L2 norm is 1), then dot distance is equivalent to the cosine distance.
|
|
229
|
+
*/
|
|
230
|
+
distanceType?: "l2" | "cosine" | "dot";
|
|
231
|
+
/**
|
|
232
|
+
* The number of IVF partitions to create.
|
|
233
|
+
*
|
|
234
|
+
* For HNSW, we recommend a small number of partitions. Setting this to 1 works
|
|
235
|
+
* well for most tables. For very large tables, training just one HNSW graph
|
|
236
|
+
* will require too much memory. Each partition becomes its own HNSW graph, so
|
|
237
|
+
* setting this value higher reduces the peak memory use of training.
|
|
238
|
+
*
|
|
239
|
+
*/
|
|
240
|
+
numPartitions?: number;
|
|
241
|
+
/**
|
|
242
|
+
* Max iterations to train kmeans.
|
|
243
|
+
*
|
|
244
|
+
* The default value is 50.
|
|
245
|
+
*
|
|
246
|
+
* When training an IVF index we use kmeans to calculate the partitions. This parameter
|
|
247
|
+
* controls how many iterations of kmeans to run.
|
|
248
|
+
*
|
|
249
|
+
* Increasing this might improve the quality of the index but in most cases the parameter
|
|
250
|
+
* is unused because kmeans will converge with fewer iterations. The parameter is only
|
|
251
|
+
* used in cases where kmeans does not appear to converge. In those cases it is unlikely
|
|
252
|
+
* that setting this larger will lead to the index converging anyways.
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
maxIterations?: number;
|
|
256
|
+
/**
|
|
257
|
+
* The rate used to calculate the number of training vectors for kmeans.
|
|
258
|
+
*
|
|
259
|
+
* Default value is 256.
|
|
260
|
+
*
|
|
261
|
+
* When an IVF index is trained, we need to calculate partitions. These are groups
|
|
262
|
+
* of vectors that are similar to each other. To do this we use an algorithm called kmeans.
|
|
263
|
+
*
|
|
264
|
+
* Running kmeans on a large dataset can be slow. To speed this up we run kmeans on a
|
|
265
|
+
* random sample of the data. This parameter controls the size of the sample. The total
|
|
266
|
+
* number of vectors used to train the index is `sample_rate * num_partitions`.
|
|
267
|
+
*
|
|
268
|
+
* Increasing this value might improve the quality of the index but in most cases the
|
|
269
|
+
* default should be sufficient.
|
|
270
|
+
*
|
|
271
|
+
*/
|
|
272
|
+
sampleRate?: number;
|
|
273
|
+
/**
|
|
274
|
+
* The number of neighbors to select for each vector in the HNSW graph.
|
|
275
|
+
*
|
|
276
|
+
* The default value is 20.
|
|
277
|
+
*
|
|
278
|
+
* This value controls the tradeoff between search speed and accuracy.
|
|
279
|
+
* The higher the value the more accurate the search but the slower it will be.
|
|
280
|
+
*
|
|
281
|
+
*/
|
|
282
|
+
m?: number;
|
|
283
|
+
/**
|
|
284
|
+
* The number of candidates to evaluate during the construction of the HNSW graph.
|
|
285
|
+
*
|
|
286
|
+
* The default value is 300.
|
|
287
|
+
*
|
|
288
|
+
* This value controls the tradeoff between build speed and accuracy.
|
|
289
|
+
* The higher the value the more accurate the build but the slower it will be.
|
|
290
|
+
* 150 to 300 is the typical range. 100 is a minimum for good quality search
|
|
291
|
+
* results. In most cases, there is no benefit to setting this higher than 500.
|
|
292
|
+
* This value should be set to a value that is not less than `ef` in the search phase.
|
|
293
|
+
*
|
|
294
|
+
*/
|
|
295
|
+
efConstruction?: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Options to create a full text search index
|
|
299
|
+
*/
|
|
300
|
+
export interface FtsOptions {
|
|
301
|
+
/**
|
|
302
|
+
* Whether to build the index with positions.
|
|
303
|
+
* True by default.
|
|
304
|
+
* If set to false, the index will not store the positions of the tokens in the text,
|
|
305
|
+
* which will make the index smaller and faster to build, but will not support phrase queries.
|
|
306
|
+
*/
|
|
307
|
+
withPosition?: boolean;
|
|
308
|
+
}
|
|
95
309
|
export declare class Index {
|
|
96
310
|
private readonly inner;
|
|
97
311
|
private constructor();
|
|
@@ -167,7 +381,27 @@ export declare class Index {
|
|
|
167
381
|
*
|
|
168
382
|
* For now, the full text search index only supports English, and doesn't support phrase search.
|
|
169
383
|
*/
|
|
170
|
-
static fts(): Index;
|
|
384
|
+
static fts(options?: Partial<FtsOptions>): Index;
|
|
385
|
+
/**
|
|
386
|
+
*
|
|
387
|
+
* Create a hnswPq index
|
|
388
|
+
*
|
|
389
|
+
* HNSW-PQ stands for Hierarchical Navigable Small World - Product Quantization.
|
|
390
|
+
* It is a variant of the HNSW algorithm that uses product quantization to compress
|
|
391
|
+
* the vectors.
|
|
392
|
+
*
|
|
393
|
+
*/
|
|
394
|
+
static hnswPq(options?: Partial<HnswPqOptions>): Index;
|
|
395
|
+
/**
|
|
396
|
+
*
|
|
397
|
+
* Create a hnswSq index
|
|
398
|
+
*
|
|
399
|
+
* HNSW-SQ stands for Hierarchical Navigable Small World - Scalar Quantization.
|
|
400
|
+
* It is a variant of the HNSW algorithm that uses scalar quantization to compress
|
|
401
|
+
* the vectors.
|
|
402
|
+
*
|
|
403
|
+
*/
|
|
404
|
+
static hnswSq(options?: Partial<HnswSqOptions>): Index;
|
|
171
405
|
}
|
|
172
406
|
export interface IndexOptions {
|
|
173
407
|
/**
|
package/dist/indices.js
CHANGED
|
@@ -100,8 +100,32 @@ class Index {
|
|
|
100
100
|
*
|
|
101
101
|
* For now, the full text search index only supports English, and doesn't support phrase search.
|
|
102
102
|
*/
|
|
103
|
-
static fts() {
|
|
104
|
-
return new Index(native_1.Index.fts());
|
|
103
|
+
static fts(options) {
|
|
104
|
+
return new Index(native_1.Index.fts(options?.withPosition));
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* Create a hnswPq index
|
|
109
|
+
*
|
|
110
|
+
* HNSW-PQ stands for Hierarchical Navigable Small World - Product Quantization.
|
|
111
|
+
* It is a variant of the HNSW algorithm that uses product quantization to compress
|
|
112
|
+
* the vectors.
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
static hnswPq(options) {
|
|
116
|
+
return new Index(native_1.Index.hnswPq(options?.distanceType, options?.numPartitions, options?.numSubVectors, options?.maxIterations, options?.sampleRate, options?.m, options?.efConstruction));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* Create a hnswSq index
|
|
121
|
+
*
|
|
122
|
+
* HNSW-SQ stands for Hierarchical Navigable Small World - Scalar Quantization.
|
|
123
|
+
* It is a variant of the HNSW algorithm that uses scalar quantization to compress
|
|
124
|
+
* the vectors.
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
static hnswSq(options) {
|
|
128
|
+
return new Index(native_1.Index.hnswSq(options?.distanceType, options?.numPartitions, options?.maxIterations, options?.sampleRate, options?.m, options?.efConstruction));
|
|
105
129
|
}
|
|
106
130
|
}
|
|
107
131
|
exports.Index = Index;
|
package/dist/native.d.ts
CHANGED
|
@@ -138,8 +138,8 @@ export class Connection {
|
|
|
138
138
|
* - buf: The buffer containing the IPC file.
|
|
139
139
|
*
|
|
140
140
|
*/
|
|
141
|
-
createTable(name: string, buf: Buffer, mode: string, storageOptions?: Record<string, string> | undefined | null, dataStorageOptions?: string | undefined | null): Promise<Table>
|
|
142
|
-
createEmptyTable(name: string, schemaBuf: Buffer, mode: string, storageOptions?: Record<string, string> | undefined | null, dataStorageOptions?: string | undefined | null): Promise<Table>
|
|
141
|
+
createTable(name: string, buf: Buffer, mode: string, storageOptions?: Record<string, string> | undefined | null, dataStorageOptions?: string | undefined | null, enableV2ManifestPaths?: boolean | undefined | null): Promise<Table>
|
|
142
|
+
createEmptyTable(name: string, schemaBuf: Buffer, mode: string, storageOptions?: Record<string, string> | undefined | null, dataStorageOptions?: string | undefined | null, enableV2ManifestPaths?: boolean | undefined | null): Promise<Table>
|
|
143
143
|
openTable(name: string, storageOptions?: Record<string, string> | undefined | null, indexCacheSize?: number | undefined | null): Promise<Table>
|
|
144
144
|
/** Drop table with the name. Or raise an error if the table does not exist. */
|
|
145
145
|
dropTable(name: string): Promise<void>
|
|
@@ -149,7 +149,9 @@ export class Index {
|
|
|
149
149
|
static btree(): Index
|
|
150
150
|
static bitmap(): Index
|
|
151
151
|
static labelList(): Index
|
|
152
|
-
static fts(): Index
|
|
152
|
+
static fts(withPosition?: boolean | undefined | null): Index
|
|
153
|
+
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
|
|
154
|
+
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
|
|
153
155
|
}
|
|
154
156
|
/** Typescript-style Async Iterator over RecordBatches */
|
|
155
157
|
export class RecordBatchIterator {
|
|
@@ -168,6 +170,7 @@ export class Query {
|
|
|
168
170
|
select(columns: Array<[string, string]>): void
|
|
169
171
|
selectColumns(columns: Array<string>): void
|
|
170
172
|
limit(limit: number): void
|
|
173
|
+
offset(offset: number): void
|
|
171
174
|
nearestTo(vector: Float32Array): VectorQuery
|
|
172
175
|
execute(maxBatchLength?: number | undefined | null): Promise<RecordBatchIterator>
|
|
173
176
|
explainPlan(verbose: boolean): Promise<string>
|
|
@@ -184,6 +187,7 @@ export class VectorQuery {
|
|
|
184
187
|
select(columns: Array<[string, string]>): void
|
|
185
188
|
selectColumns(columns: Array<string>): void
|
|
186
189
|
limit(limit: number): void
|
|
190
|
+
offset(offset: number): void
|
|
187
191
|
execute(maxBatchLength?: number | undefined | null): Promise<RecordBatchIterator>
|
|
188
192
|
explainPlan(verbose: boolean): Promise<string>
|
|
189
193
|
}
|
|
@@ -198,7 +202,7 @@ export class Table {
|
|
|
198
202
|
countRows(filter?: string | undefined | null): Promise<number>
|
|
199
203
|
delete(predicate: string): Promise<void>
|
|
200
204
|
createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null): Promise<void>
|
|
201
|
-
update(onlyIf: string | undefined | null, columns: Array<[string, string]>): Promise<
|
|
205
|
+
update(onlyIf: string | undefined | null, columns: Array<[string, string]>): Promise<bigint>
|
|
202
206
|
query(): Query
|
|
203
207
|
vectorSearch(vector: Float32Array): VectorQuery
|
|
204
208
|
addColumns(transforms: Array<AddColumnsSql>): Promise<void>
|
|
@@ -212,4 +216,6 @@ export class Table {
|
|
|
212
216
|
listIndices(): Promise<Array<IndexConfig>>
|
|
213
217
|
indexStats(indexName: string): Promise<IndexStatistics | null>
|
|
214
218
|
mergeInsert(on: Array<string>): NativeMergeInsertBuilder
|
|
219
|
+
usesV2ManifestPaths(): Promise<boolean>
|
|
220
|
+
migrateManifestPathsV2(): Promise<void>
|
|
215
221
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export declare class QueryBase<NativeQueryType extends NativeQuery | NativeVecto
|
|
|
94
94
|
* called then every valid row from the table will be returned.
|
|
95
95
|
*/
|
|
96
96
|
limit(limit: number): this;
|
|
97
|
+
offset(offset: number): this;
|
|
97
98
|
protected nativeExecute(options?: Partial<QueryExecutionOptions>): Promise<NativeBatchIterator>;
|
|
98
99
|
/**
|
|
99
100
|
* Execute the query and return the results as an @see {@link AsyncIterator}
|
package/dist/query.js
CHANGED
|
@@ -176,6 +176,10 @@ class QueryBase {
|
|
|
176
176
|
this.doCall((inner) => inner.limit(limit));
|
|
177
177
|
return this;
|
|
178
178
|
}
|
|
179
|
+
offset(offset) {
|
|
180
|
+
this.doCall((inner) => inner.offset(offset));
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
179
183
|
nativeExecute(options) {
|
|
180
184
|
if (this.inner instanceof Promise) {
|
|
181
185
|
return this.inner.then((inner) => inner.execute(options?.maxBatchLength));
|
package/dist/table.d.ts
CHANGED
|
@@ -391,4 +391,25 @@ export declare class LocalTable extends Table {
|
|
|
391
391
|
toArrow(): Promise<ArrowTable>;
|
|
392
392
|
indexStats(name: string): Promise<IndexStatistics | undefined>;
|
|
393
393
|
mergeInsert(on: string | string[]): MergeInsertBuilder;
|
|
394
|
+
/**
|
|
395
|
+
* Check if the table uses the new manifest path scheme.
|
|
396
|
+
*
|
|
397
|
+
* This function will return true if the table uses the V2 manifest
|
|
398
|
+
* path scheme.
|
|
399
|
+
*/
|
|
400
|
+
usesV2ManifestPaths(): Promise<boolean>;
|
|
401
|
+
/**
|
|
402
|
+
* Migrate the table to use the new manifest path scheme.
|
|
403
|
+
*
|
|
404
|
+
* This function will rename all V1 manifests to V2 manifest paths.
|
|
405
|
+
* These paths provide more efficient opening of datasets with many versions
|
|
406
|
+
* on object stores.
|
|
407
|
+
*
|
|
408
|
+
* This function is idempotent, and can be run multiple times without
|
|
409
|
+
* changing the state of the object store.
|
|
410
|
+
*
|
|
411
|
+
* However, it should not be run while other concurrent operations are happening.
|
|
412
|
+
* And it should also run until completion before resuming other operations.
|
|
413
|
+
*/
|
|
414
|
+
migrateManifestPathsV2(): Promise<void>;
|
|
394
415
|
}
|
package/dist/table.js
CHANGED
|
@@ -240,5 +240,30 @@ class LocalTable extends Table {
|
|
|
240
240
|
on = Array.isArray(on) ? on : [on];
|
|
241
241
|
return new merge_1.MergeInsertBuilder(this.inner.mergeInsert(on));
|
|
242
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Check if the table uses the new manifest path scheme.
|
|
245
|
+
*
|
|
246
|
+
* This function will return true if the table uses the V2 manifest
|
|
247
|
+
* path scheme.
|
|
248
|
+
*/
|
|
249
|
+
async usesV2ManifestPaths() {
|
|
250
|
+
return await this.inner.usesV2ManifestPaths();
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Migrate the table to use the new manifest path scheme.
|
|
254
|
+
*
|
|
255
|
+
* This function will rename all V1 manifests to V2 manifest paths.
|
|
256
|
+
* These paths provide more efficient opening of datasets with many versions
|
|
257
|
+
* on object stores.
|
|
258
|
+
*
|
|
259
|
+
* This function is idempotent, and can be run multiple times without
|
|
260
|
+
* changing the state of the object store.
|
|
261
|
+
*
|
|
262
|
+
* However, it should not be run while other concurrent operations are happening.
|
|
263
|
+
* And it should also run until completion before resuming other operations.
|
|
264
|
+
*/
|
|
265
|
+
async migrateManifestPathsV2() {
|
|
266
|
+
await this.inner.migrateManifestPathsV2();
|
|
267
|
+
}
|
|
243
268
|
}
|
|
244
269
|
exports.LocalTable = LocalTable;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"vector database",
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.11.0-beta.0",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": "./dist/index.js",
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"reflect-metadata": "^0.2.2"
|
|
93
93
|
},
|
|
94
94
|
"optionalDependencies": {
|
|
95
|
-
"@lancedb/lancedb-darwin-arm64": "0.
|
|
96
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.
|
|
97
|
-
"@lancedb/lancedb-darwin-x64": "0.
|
|
98
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.
|
|
99
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.
|
|
95
|
+
"@lancedb/lancedb-darwin-arm64": "0.11.0-beta.0",
|
|
96
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.11.0-beta.0",
|
|
97
|
+
"@lancedb/lancedb-darwin-x64": "0.11.0-beta.0",
|
|
98
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.11.0-beta.0",
|
|
99
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.11.0-beta.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"apache-arrow": ">=13.0.0 <=17.0.0"
|