@lancedb/lancedb
Advanced tools
Comparing version 0.4.18 to 0.4.19
@@ -107,3 +107,3 @@ import { Schema } from "apache-arrow"; | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"]); | ||
* await table.createIndex("vector"); | ||
* @example | ||
@@ -113,8 +113,11 @@ * // For advanced control over vector index creation you can specify | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"], I) | ||
* .ivf_pq({ num_partitions: 128, num_sub_vectors: 16 }) | ||
* .build(); | ||
* await table.createIndex("vector", { | ||
* config: lancedb.Index.ivfPq({ | ||
* numPartitions: 128, | ||
* numSubVectors: 16, | ||
* }), | ||
* }); | ||
* @example | ||
* // Or create a Scalar index | ||
* await table.createIndex("my_float_col").build(); | ||
* await table.createIndex("my_float_col"); | ||
*/ | ||
@@ -131,4 +134,3 @@ createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>; | ||
* Note: By default, all columns are returned. For best performance, you should | ||
* only fetch the columns you need. See [`Query::select_with_projection`] for | ||
* more details. | ||
* only fetch the columns you need. | ||
* | ||
@@ -141,6 +143,9 @@ * When appropriate, various indices and statistics based pruning will be used to | ||
* // This query will return up to 1000 rows whose value in the `id` column | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table.query() | ||
* .filter("id > 1").select(["id"]).limit(20)) { | ||
* console.log(batch); | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -154,9 +159,10 @@ * @example | ||
* // | ||
* // The `refine_factor` and `nprobes` methods are used to control the recall / | ||
* // The `refineFactor` and `nprobes` methods are used to control the recall / | ||
* // latency tradeoff of the search. | ||
* for await (const batch of table.query() | ||
* .nearestTo([1, 2, 3]) | ||
* .refineFactor(5).nprobe(10) | ||
* .limit(10)) { | ||
* console.log(batch); | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -207,33 +213,35 @@ * @example | ||
dropColumns(columnNames: string[]): Promise<void>; | ||
/** | ||
* Retrieve the version of the table | ||
* | ||
* LanceDb supports versioning. Every operation that modifies the table increases | ||
* version. As long as a version hasn't been deleted you can `[Self::checkout]` that | ||
* version to view the data at that point. In addition, you can `[Self::restore]` the | ||
* version to replace the current table with a previous version. | ||
*/ | ||
/** Retrieve the version of the table */ | ||
version(): Promise<number>; | ||
/** | ||
* Checks out a specific version of the Table | ||
* Checks out a specific version of the table _This is an in-place operation._ | ||
* | ||
* Any read operation on the table will now access the data at the checked out version. | ||
* As a consequence, calling this method will disable any read consistency interval | ||
* that was previously set. | ||
* This allows viewing previous versions of the table. If you wish to | ||
* keep writing to the dataset starting from an old version, then use | ||
* the `restore` function. | ||
* | ||
* This is a read-only operation that turns the table into a sort of "view" | ||
* or "detached head". Other table instances will not be affected. To make the change | ||
* permanent you can use the `[Self::restore]` method. | ||
* Calling this method will set the table into time-travel mode. If you | ||
* wish to return to standard mode, call `checkoutLatest`. | ||
* @param {number} version The version to checkout | ||
* @example | ||
* ```typescript | ||
* import * as lancedb from "@lancedb/lancedb" | ||
* const db = await lancedb.connect("./.lancedb"); | ||
* const table = await db.createTable("my_table", [ | ||
* { vector: [1.1, 0.9], type: "vector" }, | ||
* ]); | ||
* | ||
* Any operation that modifies the table will fail while the table is in a checked | ||
* out state. | ||
* | ||
* To return the table to a normal state use `[Self::checkout_latest]` | ||
* console.log(await table.version()); // 1 | ||
* console.log(table.display()); | ||
* await table.add([{ vector: [0.5, 0.2], type: "vector" }]); | ||
* await table.checkout(1); | ||
* console.log(await table.version()); // 2 | ||
* ``` | ||
*/ | ||
checkout(version: number): Promise<void>; | ||
/** | ||
* Ensures the table is pointing at the latest version | ||
* Checkout the latest version of the table. _This is an in-place operation._ | ||
* | ||
* This can be used to manually update a table when the read_consistency_interval is None | ||
* It can also be used to undo a `[Self::checkout]` operation | ||
* The table will be set back into standard mode, and will track the latest | ||
* version of the table. | ||
*/ | ||
@@ -254,6 +262,4 @@ checkoutLatest(): Promise<void>; | ||
restore(): Promise<void>; | ||
/** | ||
* List all indices that have been created with Self::create_index | ||
*/ | ||
/** List all indices that have been created with {@link Table.createIndex} */ | ||
listIndices(): Promise<IndexConfig[]>; | ||
} |
@@ -126,3 +126,3 @@ "use strict"; | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"]); | ||
* await table.createIndex("vector"); | ||
* @example | ||
@@ -132,8 +132,11 @@ * // For advanced control over vector index creation you can specify | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"], I) | ||
* .ivf_pq({ num_partitions: 128, num_sub_vectors: 16 }) | ||
* .build(); | ||
* await table.createIndex("vector", { | ||
* config: lancedb.Index.ivfPq({ | ||
* numPartitions: 128, | ||
* numSubVectors: 16, | ||
* }), | ||
* }); | ||
* @example | ||
* // Or create a Scalar index | ||
* await table.createIndex("my_float_col").build(); | ||
* await table.createIndex("my_float_col"); | ||
*/ | ||
@@ -155,4 +158,3 @@ async createIndex(column, options) { | ||
* Note: By default, all columns are returned. For best performance, you should | ||
* only fetch the columns you need. See [`Query::select_with_projection`] for | ||
* more details. | ||
* only fetch the columns you need. | ||
* | ||
@@ -165,6 +167,9 @@ * When appropriate, various indices and statistics based pruning will be used to | ||
* // This query will return up to 1000 rows whose value in the `id` column | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table.query() | ||
* .filter("id > 1").select(["id"]).limit(20)) { | ||
* console.log(batch); | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -178,9 +183,10 @@ * @example | ||
* // | ||
* // The `refine_factor` and `nprobes` methods are used to control the recall / | ||
* // The `refineFactor` and `nprobes` methods are used to control the recall / | ||
* // latency tradeoff of the search. | ||
* for await (const batch of table.query() | ||
* .nearestTo([1, 2, 3]) | ||
* .refineFactor(5).nprobe(10) | ||
* .limit(10)) { | ||
* console.log(batch); | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -242,10 +248,3 @@ * @example | ||
} | ||
/** | ||
* Retrieve the version of the table | ||
* | ||
* LanceDb supports versioning. Every operation that modifies the table increases | ||
* version. As long as a version hasn't been deleted you can `[Self::checkout]` that | ||
* version to view the data at that point. In addition, you can `[Self::restore]` the | ||
* version to replace the current table with a previous version. | ||
*/ | ||
/** Retrieve the version of the table */ | ||
async version() { | ||
@@ -255,16 +254,25 @@ return await this.inner.version(); | ||
/** | ||
* Checks out a specific version of the Table | ||
* Checks out a specific version of the table _This is an in-place operation._ | ||
* | ||
* Any read operation on the table will now access the data at the checked out version. | ||
* As a consequence, calling this method will disable any read consistency interval | ||
* that was previously set. | ||
* This allows viewing previous versions of the table. If you wish to | ||
* keep writing to the dataset starting from an old version, then use | ||
* the `restore` function. | ||
* | ||
* This is a read-only operation that turns the table into a sort of "view" | ||
* or "detached head". Other table instances will not be affected. To make the change | ||
* permanent you can use the `[Self::restore]` method. | ||
* Calling this method will set the table into time-travel mode. If you | ||
* wish to return to standard mode, call `checkoutLatest`. | ||
* @param {number} version The version to checkout | ||
* @example | ||
* ```typescript | ||
* import * as lancedb from "@lancedb/lancedb" | ||
* const db = await lancedb.connect("./.lancedb"); | ||
* const table = await db.createTable("my_table", [ | ||
* { vector: [1.1, 0.9], type: "vector" }, | ||
* ]); | ||
* | ||
* Any operation that modifies the table will fail while the table is in a checked | ||
* out state. | ||
* | ||
* To return the table to a normal state use `[Self::checkout_latest]` | ||
* console.log(await table.version()); // 1 | ||
* console.log(table.display()); | ||
* await table.add([{ vector: [0.5, 0.2], type: "vector" }]); | ||
* await table.checkout(1); | ||
* console.log(await table.version()); // 2 | ||
* ``` | ||
*/ | ||
@@ -275,6 +283,6 @@ async checkout(version) { | ||
/** | ||
* Ensures the table is pointing at the latest version | ||
* Checkout the latest version of the table. _This is an in-place operation._ | ||
* | ||
* This can be used to manually update a table when the read_consistency_interval is None | ||
* It can also be used to undo a `[Self::checkout]` operation | ||
* The table will be set back into standard mode, and will track the latest | ||
* version of the table. | ||
*/ | ||
@@ -299,5 +307,3 @@ async checkoutLatest() { | ||
} | ||
/** | ||
* List all indices that have been created with Self::create_index | ||
*/ | ||
/** List all indices that have been created with {@link Table.createIndex} */ | ||
async listIndices() { | ||
@@ -304,0 +310,0 @@ return await this.inner.listIndices(); |
@@ -172,3 +172,3 @@ // Copyright 2024 Lance Developers. | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"]); | ||
* await table.createIndex("vector"); | ||
* @example | ||
@@ -178,8 +178,11 @@ * // For advanced control over vector index creation you can specify | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"], I) | ||
* .ivf_pq({ num_partitions: 128, num_sub_vectors: 16 }) | ||
* .build(); | ||
* await table.createIndex("vector", { | ||
* config: lancedb.Index.ivfPq({ | ||
* numPartitions: 128, | ||
* numSubVectors: 16, | ||
* }), | ||
* }); | ||
* @example | ||
* // Or create a Scalar index | ||
* await table.createIndex("my_float_col").build(); | ||
* await table.createIndex("my_float_col"); | ||
*/ | ||
@@ -202,4 +205,3 @@ async createIndex(column: string, options?: Partial<IndexOptions>) { | ||
* Note: By default, all columns are returned. For best performance, you should | ||
* only fetch the columns you need. See [`Query::select_with_projection`] for | ||
* more details. | ||
* only fetch the columns you need. | ||
* | ||
@@ -212,6 +214,9 @@ * When appropriate, various indices and statistics based pruning will be used to | ||
* // This query will return up to 1000 rows whose value in the `id` column | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table.query() | ||
* .filter("id > 1").select(["id"]).limit(20)) { | ||
* console.log(batch); | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -225,9 +230,10 @@ * @example | ||
* // | ||
* // The `refine_factor` and `nprobes` methods are used to control the recall / | ||
* // The `refineFactor` and `nprobes` methods are used to control the recall / | ||
* // latency tradeoff of the search. | ||
* for await (const batch of table.query() | ||
* .nearestTo([1, 2, 3]) | ||
* .refineFactor(5).nprobe(10) | ||
* .limit(10)) { | ||
* console.log(batch); | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -294,10 +300,3 @@ * @example | ||
/** | ||
* Retrieve the version of the table | ||
* | ||
* LanceDb supports versioning. Every operation that modifies the table increases | ||
* version. As long as a version hasn't been deleted you can `[Self::checkout]` that | ||
* version to view the data at that point. In addition, you can `[Self::restore]` the | ||
* version to replace the current table with a previous version. | ||
*/ | ||
/** Retrieve the version of the table */ | ||
async version(): Promise<number> { | ||
@@ -308,16 +307,25 @@ return await this.inner.version(); | ||
/** | ||
* Checks out a specific version of the Table | ||
* Checks out a specific version of the table _This is an in-place operation._ | ||
* | ||
* Any read operation on the table will now access the data at the checked out version. | ||
* As a consequence, calling this method will disable any read consistency interval | ||
* that was previously set. | ||
* This allows viewing previous versions of the table. If you wish to | ||
* keep writing to the dataset starting from an old version, then use | ||
* the `restore` function. | ||
* | ||
* This is a read-only operation that turns the table into a sort of "view" | ||
* or "detached head". Other table instances will not be affected. To make the change | ||
* permanent you can use the `[Self::restore]` method. | ||
* Calling this method will set the table into time-travel mode. If you | ||
* wish to return to standard mode, call `checkoutLatest`. | ||
* @param {number} version The version to checkout | ||
* @example | ||
* ```typescript | ||
* import * as lancedb from "@lancedb/lancedb" | ||
* const db = await lancedb.connect("./.lancedb"); | ||
* const table = await db.createTable("my_table", [ | ||
* { vector: [1.1, 0.9], type: "vector" }, | ||
* ]); | ||
* | ||
* Any operation that modifies the table will fail while the table is in a checked | ||
* out state. | ||
* | ||
* To return the table to a normal state use `[Self::checkout_latest]` | ||
* console.log(await table.version()); // 1 | ||
* console.log(table.display()); | ||
* await table.add([{ vector: [0.5, 0.2], type: "vector" }]); | ||
* await table.checkout(1); | ||
* console.log(await table.version()); // 2 | ||
* ``` | ||
*/ | ||
@@ -329,6 +337,6 @@ async checkout(version: number): Promise<void> { | ||
/** | ||
* Ensures the table is pointing at the latest version | ||
* Checkout the latest version of the table. _This is an in-place operation._ | ||
* | ||
* This can be used to manually update a table when the read_consistency_interval is None | ||
* It can also be used to undo a `[Self::checkout]` operation | ||
* The table will be set back into standard mode, and will track the latest | ||
* version of the table. | ||
*/ | ||
@@ -355,5 +363,3 @@ async checkoutLatest(): Promise<void> { | ||
/** | ||
* List all indices that have been created with Self::create_index | ||
*/ | ||
/** List all indices that have been created with {@link Table.createIndex} */ | ||
async listIndices(): Promise<IndexConfig[]> { | ||
@@ -360,0 +366,0 @@ return await this.inner.listIndices(); |
@@ -107,3 +107,3 @@ import { Schema } from "apache-arrow"; | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"]); | ||
* await table.createIndex("vector"); | ||
* @example | ||
@@ -113,8 +113,11 @@ * // For advanced control over vector index creation you can specify | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"], I) | ||
* .ivf_pq({ num_partitions: 128, num_sub_vectors: 16 }) | ||
* .build(); | ||
* await table.createIndex("vector", { | ||
* config: lancedb.Index.ivfPq({ | ||
* numPartitions: 128, | ||
* numSubVectors: 16, | ||
* }), | ||
* }); | ||
* @example | ||
* // Or create a Scalar index | ||
* await table.createIndex("my_float_col").build(); | ||
* await table.createIndex("my_float_col"); | ||
*/ | ||
@@ -131,4 +134,3 @@ createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>; | ||
* Note: By default, all columns are returned. For best performance, you should | ||
* only fetch the columns you need. See [`Query::select_with_projection`] for | ||
* more details. | ||
* only fetch the columns you need. | ||
* | ||
@@ -141,6 +143,9 @@ * When appropriate, various indices and statistics based pruning will be used to | ||
* // This query will return up to 1000 rows whose value in the `id` column | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table.query() | ||
* .filter("id > 1").select(["id"]).limit(20)) { | ||
* console.log(batch); | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -154,9 +159,10 @@ * @example | ||
* // | ||
* // The `refine_factor` and `nprobes` methods are used to control the recall / | ||
* // The `refineFactor` and `nprobes` methods are used to control the recall / | ||
* // latency tradeoff of the search. | ||
* for await (const batch of table.query() | ||
* .nearestTo([1, 2, 3]) | ||
* .refineFactor(5).nprobe(10) | ||
* .limit(10)) { | ||
* console.log(batch); | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -207,33 +213,35 @@ * @example | ||
dropColumns(columnNames: string[]): Promise<void>; | ||
/** | ||
* Retrieve the version of the table | ||
* | ||
* LanceDb supports versioning. Every operation that modifies the table increases | ||
* version. As long as a version hasn't been deleted you can `[Self::checkout]` that | ||
* version to view the data at that point. In addition, you can `[Self::restore]` the | ||
* version to replace the current table with a previous version. | ||
*/ | ||
/** Retrieve the version of the table */ | ||
version(): Promise<number>; | ||
/** | ||
* Checks out a specific version of the Table | ||
* Checks out a specific version of the table _This is an in-place operation._ | ||
* | ||
* Any read operation on the table will now access the data at the checked out version. | ||
* As a consequence, calling this method will disable any read consistency interval | ||
* that was previously set. | ||
* This allows viewing previous versions of the table. If you wish to | ||
* keep writing to the dataset starting from an old version, then use | ||
* the `restore` function. | ||
* | ||
* This is a read-only operation that turns the table into a sort of "view" | ||
* or "detached head". Other table instances will not be affected. To make the change | ||
* permanent you can use the `[Self::restore]` method. | ||
* Calling this method will set the table into time-travel mode. If you | ||
* wish to return to standard mode, call `checkoutLatest`. | ||
* @param {number} version The version to checkout | ||
* @example | ||
* ```typescript | ||
* import * as lancedb from "@lancedb/lancedb" | ||
* const db = await lancedb.connect("./.lancedb"); | ||
* const table = await db.createTable("my_table", [ | ||
* { vector: [1.1, 0.9], type: "vector" }, | ||
* ]); | ||
* | ||
* Any operation that modifies the table will fail while the table is in a checked | ||
* out state. | ||
* | ||
* To return the table to a normal state use `[Self::checkout_latest]` | ||
* console.log(await table.version()); // 1 | ||
* console.log(table.display()); | ||
* await table.add([{ vector: [0.5, 0.2], type: "vector" }]); | ||
* await table.checkout(1); | ||
* console.log(await table.version()); // 2 | ||
* ``` | ||
*/ | ||
checkout(version: number): Promise<void>; | ||
/** | ||
* Ensures the table is pointing at the latest version | ||
* Checkout the latest version of the table. _This is an in-place operation._ | ||
* | ||
* This can be used to manually update a table when the read_consistency_interval is None | ||
* It can also be used to undo a `[Self::checkout]` operation | ||
* The table will be set back into standard mode, and will track the latest | ||
* version of the table. | ||
*/ | ||
@@ -254,6 +262,4 @@ checkoutLatest(): Promise<void>; | ||
restore(): Promise<void>; | ||
/** | ||
* List all indices that have been created with Self::create_index | ||
*/ | ||
/** List all indices that have been created with {@link Table.createIndex} */ | ||
listIndices(): Promise<IndexConfig[]>; | ||
} |
@@ -126,3 +126,3 @@ "use strict"; | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"]); | ||
* await table.createIndex("vector"); | ||
* @example | ||
@@ -132,8 +132,11 @@ * // For advanced control over vector index creation you can specify | ||
* const table = await conn.openTable("my_table"); | ||
* await table.createIndex(["vector"], I) | ||
* .ivf_pq({ num_partitions: 128, num_sub_vectors: 16 }) | ||
* .build(); | ||
* await table.createIndex("vector", { | ||
* config: lancedb.Index.ivfPq({ | ||
* numPartitions: 128, | ||
* numSubVectors: 16, | ||
* }), | ||
* }); | ||
* @example | ||
* // Or create a Scalar index | ||
* await table.createIndex("my_float_col").build(); | ||
* await table.createIndex("my_float_col"); | ||
*/ | ||
@@ -155,4 +158,3 @@ async createIndex(column, options) { | ||
* Note: By default, all columns are returned. For best performance, you should | ||
* only fetch the columns you need. See [`Query::select_with_projection`] for | ||
* more details. | ||
* only fetch the columns you need. | ||
* | ||
@@ -165,6 +167,9 @@ * When appropriate, various indices and statistics based pruning will be used to | ||
* // This query will return up to 1000 rows whose value in the `id` column | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table.query() | ||
* .filter("id > 1").select(["id"]).limit(20)) { | ||
* console.log(batch); | ||
* // is greater than 5. LanceDb supports a broad set of filtering functions. | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -178,9 +183,10 @@ * @example | ||
* // | ||
* // The `refine_factor` and `nprobes` methods are used to control the recall / | ||
* // The `refineFactor` and `nprobes` methods are used to control the recall / | ||
* // latency tradeoff of the search. | ||
* for await (const batch of table.query() | ||
* .nearestTo([1, 2, 3]) | ||
* .refineFactor(5).nprobe(10) | ||
* .limit(10)) { | ||
* console.log(batch); | ||
* for await (const batch of table | ||
* .query() | ||
* .where("id > 1") | ||
* .select(["id"]) | ||
* .limit(20)) { | ||
* console.log(batch); | ||
* } | ||
@@ -242,10 +248,3 @@ * @example | ||
} | ||
/** | ||
* Retrieve the version of the table | ||
* | ||
* LanceDb supports versioning. Every operation that modifies the table increases | ||
* version. As long as a version hasn't been deleted you can `[Self::checkout]` that | ||
* version to view the data at that point. In addition, you can `[Self::restore]` the | ||
* version to replace the current table with a previous version. | ||
*/ | ||
/** Retrieve the version of the table */ | ||
async version() { | ||
@@ -255,16 +254,25 @@ return await this.inner.version(); | ||
/** | ||
* Checks out a specific version of the Table | ||
* Checks out a specific version of the table _This is an in-place operation._ | ||
* | ||
* Any read operation on the table will now access the data at the checked out version. | ||
* As a consequence, calling this method will disable any read consistency interval | ||
* that was previously set. | ||
* This allows viewing previous versions of the table. If you wish to | ||
* keep writing to the dataset starting from an old version, then use | ||
* the `restore` function. | ||
* | ||
* This is a read-only operation that turns the table into a sort of "view" | ||
* or "detached head". Other table instances will not be affected. To make the change | ||
* permanent you can use the `[Self::restore]` method. | ||
* Calling this method will set the table into time-travel mode. If you | ||
* wish to return to standard mode, call `checkoutLatest`. | ||
* @param {number} version The version to checkout | ||
* @example | ||
* ```typescript | ||
* import * as lancedb from "@lancedb/lancedb" | ||
* const db = await lancedb.connect("./.lancedb"); | ||
* const table = await db.createTable("my_table", [ | ||
* { vector: [1.1, 0.9], type: "vector" }, | ||
* ]); | ||
* | ||
* Any operation that modifies the table will fail while the table is in a checked | ||
* out state. | ||
* | ||
* To return the table to a normal state use `[Self::checkout_latest]` | ||
* console.log(await table.version()); // 1 | ||
* console.log(table.display()); | ||
* await table.add([{ vector: [0.5, 0.2], type: "vector" }]); | ||
* await table.checkout(1); | ||
* console.log(await table.version()); // 2 | ||
* ``` | ||
*/ | ||
@@ -275,6 +283,6 @@ async checkout(version) { | ||
/** | ||
* Ensures the table is pointing at the latest version | ||
* Checkout the latest version of the table. _This is an in-place operation._ | ||
* | ||
* This can be used to manually update a table when the read_consistency_interval is None | ||
* It can also be used to undo a `[Self::checkout]` operation | ||
* The table will be set back into standard mode, and will track the latest | ||
* version of the table. | ||
*/ | ||
@@ -299,5 +307,3 @@ async checkoutLatest() { | ||
} | ||
/** | ||
* List all indices that have been created with Self::create_index | ||
*/ | ||
/** List all indices that have been created with {@link Table.createIndex} */ | ||
async listIndices() { | ||
@@ -304,0 +310,0 @@ return await this.inner.listIndices(); |
{ | ||
"name": "@lancedb/lancedb", | ||
"version": "0.4.18", | ||
"version": "0.4.19", | ||
"main": "./dist/index.js", | ||
@@ -65,3 +65,4 @@ "types": "./dist/index.d.ts", | ||
"docs": "typedoc --plugin typedoc-plugin-markdown --out ../docs/src/js lancedb/index.ts", | ||
"lint": "eslint lancedb && eslint __test__", | ||
"lint": "eslint lancedb __test__", | ||
"lint-fix": "eslint lancedb __test__ --fix", | ||
"prepublishOnly": "napi prepublish -t npm", | ||
@@ -78,8 +79,8 @@ "test": "npm run build && jest --verbose", | ||
"optionalDependencies": { | ||
"@lancedb/lancedb-darwin-arm64": "0.4.18", | ||
"@lancedb/lancedb-linux-arm64-gnu": "0.4.18", | ||
"@lancedb/lancedb-darwin-x64": "0.4.18", | ||
"@lancedb/lancedb-linux-x64-gnu": "0.4.18", | ||
"@lancedb/lancedb-win32-x64-msvc": "0.4.18" | ||
"@lancedb/lancedb-darwin-arm64": "0.4.19", | ||
"@lancedb/lancedb-linux-arm64-gnu": "0.4.19", | ||
"@lancedb/lancedb-darwin-x64": "0.4.19", | ||
"@lancedb/lancedb-linux-x64-gnu": "0.4.19", | ||
"@lancedb/lancedb-win32-x64-msvc": "0.4.19" | ||
} | ||
} |
9426
385670