mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-13 07:12:27 +00:00
CatalogConnection.list_databases should return an iterator so that users don't have to manually re-implement pagination. For those who do want more control over pagination, add num_page_results and page_token to the Iterator object, and also allow the iterator object to be created at a specific page token.
1.3 KiB
1.3 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb / DatabaseNames
Class: DatabaseNames
A lazy async iterator of database names with pagination state. Returned by Catalog.listDatabases.
Implements
AsyncIterableIterator<string>
Methods
[asyncIterator]()
asyncIterator: AsyncIterableIterator<string>
Returns
AsyncIterableIterator<string>
Implementation of
AsyncIterableIterator.[asyncIterator]
next()
next(): Promise<IteratorResult<string, any>>
Fetch the next name, requesting another page only when needed.
Returns
Promise<IteratorResult<string, any>>
Implementation of
AsyncIterableIterator.next
numPageResults()
numPageResults(): number
Number of names available without another REST request.
Returns
number
pageToken()
pageToken(): undefined | string
Token for the next REST request. Initially this is the supplied starting token. Returns undefined after the final page is fetched, even if names remain cached. Drain the cache before saving a token to avoid skipping names when resuming. A failed request terminates iteration and retains its token for a new iterator.
Returns
undefined | string