Skip to content

@lancedb/lancedb • Docs


@lancedb/lancedb / Catalog

Class: Catalog

A remote catalog manages databases through the server's root namespace.

Accessors

uri

get uri(): string

The root namespace endpoint.

Returns

string

Methods

connectDatabase()

connectDatabase(name): Promise<Connection>

Connect to an existing database by its logical name.

Parameters

  • name: string

Returns

Promise<Connection>


createDatabase()

createDatabase(name, options): Promise<Connection>

Create a database, or open an existing database when existOk is true.

Parameters

  • name: string

  • options = {}

  • options.existOk?: boolean

Returns

Promise<Connection>


dropDatabase()

dropDatabase(name, options): Promise<void>

Drop an empty database. The server rejects nonempty databases.

Parameters

  • name: string

  • options = {}

  • options.ignoreMissing?: boolean

Returns

Promise<void>


listDatabases()

listDatabases(options): DatabaseNames

Iterate lazily over all database names using for await...of. pageToken resumes from a saved token; omitted starts at the beginning. pageLimit limits each REST response, not the total; omitted uses the server default. Request errors are raised during iteration and terminate the iterator.

Parameters

  • options = {}

  • options.pageLimit?: number

  • options.pageToken?: string

Returns

DatabaseNames

Example

for await (const name of catalog.listDatabases({ pageLimit: 20 })) {
  console.log(name);
}