mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-13 15:22:30 +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.
829 B
829 B
@lancedb/lancedb • Docs
@lancedb/lancedb / connectCatalog
Function: connectCatalog()
function connectCatalog(endpoint, options): Promise<Catalog>
Connect to an HTTP(S) catalog endpoint. Catalog requests omit database-selection headers; opened database connections inherit authentication and client options.
Parameters
-
endpoint:
string -
options:
CatalogOptions={}
Returns
Promise<Catalog>
Example
const catalog = await connectCatalog("https://my-server.example", { apiKey: "secret" });
const db = await catalog.createDatabase("analytics", { existOk: true });
for await (const name of catalog.listDatabases({ pageLimit: 20 })) {
console.log(name);
}