Skip to content

@lancedb/lancedb β€’ Docs


@lancedb/lancedb / connect

Function: connect()

connect(uri, opts)

function connect(uri, opts?): Promise<Connection>

Connect to a LanceDB instance at the given URI.

Accepted formats:

  • /path/to/database - local database
  • s3://bucket/path/to/database or gs://bucket/path/to/database - database on cloud storage
  • db://host:port - remote database (LanceDB cloud)

Parameters

  • uri: string The uri of the database. If the database uri starts with db:// then it connects to a remote database.

  • opts?: Partial<ConnectionOptions>

Returns

Promise<Connection>

See

ConnectionOptions for more details on the URI format.

Examples

const conn = await connect("/path/to/database");
const conn = await connect(
  "s3://bucket/path/to/database",
  {storageOptions: {timeout: "60s"}
});

connect(opts)

function connect(opts): Promise<Connection>

Connect to a LanceDB instance at the given URI.

Accepted formats:

  • /path/to/database - local database
  • s3://bucket/path/to/database or gs://bucket/path/to/database - database on cloud storage
  • db://host:port - remote database (LanceDB cloud)

Parameters

Returns

Promise<Connection>

See

ConnectionOptions for more details on the URI format.

Example

const conn = await connect({
  uri: "/path/to/database",
  storageOptions: {timeout: "60s"}
});