mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-05 19:32:56 +00:00
## Summary - Exposes `Session` in Python and Typescript so users can set the `index_cache_size_bytes` and `metadata_cache_size_bytes` * The `Session` is attached to the `Connection`, and thus shared across all tables in that connection. - Adds deprecation warnings for table-level cache configuration 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
2.1 KiB
2.1 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb / connect
Function: connect()
connect(uri, options, session)
function connect(
uri,
options?,
session?): Promise<Connection>
Connect to a LanceDB instance at the given URI.
Accepted formats:
/path/to/database- local databases3://bucket/path/to/databaseorgs://bucket/path/to/database- database on cloud storagedb://host:port- remote database (LanceDB cloud)
Parameters
-
uri:
stringThe uri of the database. If the database uri starts withdb://then it connects to a remote database. -
options?:
Partial<ConnectionOptions> The options to use when connecting to the database -
session?:
Session
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(options)
function connect(options): Promise<Connection>
Connect to a LanceDB instance at the given URI.
Accepted formats:
/path/to/database- local databases3://bucket/path/to/databaseorgs://bucket/path/to/database- database on cloud storagedb://host:port- remote database (LanceDB cloud)
Parameters
- options:
Partial<ConnectionOptions> &objectThe options to use when connecting to the database
Returns
Promise<Connection>
See
ConnectionOptions for more details on the URI format.
Examples
const conn = await connect({
uri: "/path/to/database",
storageOptions: {timeout: "60s"}
});
const session = Session.default();
const conn = await connect({
uri: "/path/to/database",
session: session
});