@lancedb/lancedb 0.19.0-beta.7 → 0.19.0-beta.9

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/indices.d.ts CHANGED
@@ -573,4 +573,5 @@ export interface IndexOptions {
573
573
  * The default is true
574
574
  */
575
575
  replace?: boolean;
576
+ waitTimeoutSeconds?: number;
576
577
  }
package/dist/native.d.ts CHANGED
@@ -349,8 +349,10 @@ export class Table {
349
349
  add(buf: Buffer, mode: string): Promise<void>
350
350
  countRows(filter?: string | undefined | null): Promise<number>
351
351
  delete(predicate: string): Promise<void>
352
- createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null): Promise<void>
352
+ createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null, waitTimeoutS?: number | undefined | null): Promise<void>
353
353
  dropIndex(indexName: string): Promise<void>
354
+ prewarmIndex(indexName: string): Promise<void>
355
+ waitForIndex(indexNames: Array<string>, timeoutS: number): Promise<void>
354
356
  update(onlyIf: string | undefined | null, columns: Array<[string, string]>): Promise<bigint>
355
357
  query(): Query
356
358
  vectorSearch(vector: Float32Array): VectorQuery
package/dist/table.d.ts CHANGED
@@ -187,6 +187,25 @@ export declare abstract class Table {
187
187
  * Use {@link Table.listIndices} to find the names of the indices.
188
188
  */
189
189
  abstract dropIndex(name: string): Promise<void>;
190
+ /**
191
+ * Prewarm an index in the table.
192
+ *
193
+ * @param name The name of the index.
194
+ *
195
+ * This will load the index into memory. This may reduce the cold-start time for
196
+ * future queries. If the index does not fit in the cache then this call may be
197
+ * wasteful.
198
+ */
199
+ abstract prewarmIndex(name: string): Promise<void>;
200
+ /**
201
+ * Waits for asynchronous indexing to complete on the table.
202
+ *
203
+ * @param indexNames The name of the indices to wait for
204
+ * @param timeoutSeconds The number of seconds to wait before timing out
205
+ *
206
+ * This will raise an error if the indices are not created and fully indexed within the timeout.
207
+ */
208
+ abstract waitForIndex(indexNames: string[], timeoutSeconds: number): Promise<void>;
190
209
  /**
191
210
  * Create a {@link Query} Builder.
192
211
  *
@@ -401,6 +420,8 @@ export declare class LocalTable extends Table {
401
420
  delete(predicate: string): Promise<void>;
402
421
  createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
403
422
  dropIndex(name: string): Promise<void>;
423
+ prewarmIndex(name: string): Promise<void>;
424
+ waitForIndex(indexNames: string[], timeoutSeconds: number): Promise<void>;
404
425
  query(): Query;
405
426
  search(query: string | IntoVector | FullTextQuery, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query;
406
427
  vectorSearch(vector: IntoVector): VectorQuery;
package/dist/table.js CHANGED
@@ -123,11 +123,17 @@ class LocalTable extends Table {
123
123
  // Bit of a hack to get around the fact that TS has no package-scope.
124
124
  // biome-ignore lint/suspicious/noExplicitAny: skip
125
125
  const nativeIndex = options?.config?.inner;
126
- await this.inner.createIndex(nativeIndex, column, options?.replace);
126
+ await this.inner.createIndex(nativeIndex, column, options?.replace, options?.waitTimeoutSeconds);
127
127
  }
128
128
  async dropIndex(name) {
129
129
  await this.inner.dropIndex(name);
130
130
  }
131
+ async prewarmIndex(name) {
132
+ await this.inner.prewarmIndex(name);
133
+ }
134
+ async waitForIndex(indexNames, timeoutSeconds) {
135
+ await this.inner.waitForIndex(indexNames, timeoutSeconds);
136
+ }
131
137
  query() {
132
138
  return new query_1.Query(this.inner);
133
139
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "ann"
12
12
  ],
13
13
  "private": false,
14
- "version": "0.19.0-beta.7",
14
+ "version": "0.19.0-beta.9",
15
15
  "main": "dist/index.js",
16
16
  "exports": {
17
17
  ".": "./dist/index.js",
@@ -100,14 +100,14 @@
100
100
  "reflect-metadata": "^0.2.2"
101
101
  },
102
102
  "optionalDependencies": {
103
- "@lancedb/lancedb-darwin-x64": "0.19.0-beta.7",
104
- "@lancedb/lancedb-darwin-arm64": "0.19.0-beta.7",
105
- "@lancedb/lancedb-linux-x64-gnu": "0.19.0-beta.7",
106
- "@lancedb/lancedb-linux-arm64-gnu": "0.19.0-beta.7",
107
- "@lancedb/lancedb-linux-x64-musl": "0.19.0-beta.7",
108
- "@lancedb/lancedb-linux-arm64-musl": "0.19.0-beta.7",
109
- "@lancedb/lancedb-win32-x64-msvc": "0.19.0-beta.7",
110
- "@lancedb/lancedb-win32-arm64-msvc": "0.19.0-beta.7"
103
+ "@lancedb/lancedb-darwin-x64": "0.19.0-beta.9",
104
+ "@lancedb/lancedb-darwin-arm64": "0.19.0-beta.9",
105
+ "@lancedb/lancedb-linux-x64-gnu": "0.19.0-beta.9",
106
+ "@lancedb/lancedb-linux-arm64-gnu": "0.19.0-beta.9",
107
+ "@lancedb/lancedb-linux-x64-musl": "0.19.0-beta.9",
108
+ "@lancedb/lancedb-linux-arm64-musl": "0.19.0-beta.9",
109
+ "@lancedb/lancedb-win32-x64-msvc": "0.19.0-beta.9",
110
+ "@lancedb/lancedb-win32-arm64-msvc": "0.19.0-beta.9"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "apache-arrow": ">=15.0.0 <=18.1.0"