mirror of
https://github.com/lancedb/lancedb.git
synced 2026-09-09 14:52:25 +00:00
`table_names` is being replaced by `list_tables` across the SDKs, but TypeScript only had `tableNames`. This PR adds `listTables`, which returns a page of table names together with the token that resumes after it, and marks `tableNames` and `TableNamesOptions` deprecated in favor of it. It binds the `Connection::list_tables` that already exists, so nothing in the Rust API changes and nothing existing breaks. `pageToken` is documented as opaque rather than as a table name, since what resumes a listing is the database's to decide — that keeps callers off a detail that is going to change. Stacked on #4040, which fixes a table being dropped at every page boundary. The page-walking test here needs that fix to pass. Review the last commit only until #4040 lands. ## Example ```ts const names = []; let pageToken = undefined; do { const page = await conn.listTables({ pageToken, limit: 100 }); names.push(...page.tables); pageToken = page.pageToken; } while (pageToken); ``` A namespace can be listed by passing its path first, mirroring `tableNames`: ```ts const page = await conn.listTables(["analytics"], { limit: 100 }); ``` Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
35 lines
655 B
Markdown
35 lines
655 B
Markdown
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
|
|
***
|
|
|
|
[@lancedb/lancedb](../globals.md) / ListTablesOptions
|
|
|
|
# Interface: ListTablesOptions
|
|
|
|
## Properties
|
|
|
|
### limit?
|
|
|
|
```ts
|
|
optional limit: number;
|
|
```
|
|
|
|
An upper bound on how many tables to return.
|
|
|
|
A page may hold fewer than this and still not be the last one, so keep
|
|
going while the response carries a page token rather than while pages are
|
|
full.
|
|
|
|
***
|
|
|
|
### pageToken?
|
|
|
|
```ts
|
|
optional pageToken: string;
|
|
```
|
|
|
|
Token from a previous response, to resume listing where it left off.
|
|
|
|
The token is opaque: it carries whatever the database needs to resume, and
|
|
callers should not construct or interpret one.
|