Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ icon: rocket
import {
PyConnect,
PyConnectAsync,
PyConnectEnterprise,
PyConnectEnterpriseAsync,
PyConnectEnterpriseQuickstart,
PyConnectObjectStorage,
PyConnectObjectStorageAsync,
RsConnect,
RsConnectEnterprise,
RsConnectEnterpriseQuickstart,
RsConnectObjectStorage,
TsConnect,
TsConnectEnterprise,
TsConnectEnterpriseQuickstart,
TsConnectObjectStorage,
} from '/snippets/connection.mdx';
import {
Expand Down Expand Up @@ -113,29 +112,39 @@ For credentials, endpoints, and provider-specific options, see

### Connect to LanceDB Enterprise

If you're using LanceDB Enterprise, you can connect using a `db://` URI,
along with any necessary credentials. Simply replace the local path with a remote `uri`
that points to where your data is stored, and you're ready to go.
If you're using LanceDB Enterprise, you can connect using a `db://` URI along
with the API key, region, and cluster endpoint you received from the LanceDB
team. Pass the cluster endpoint via `host_override` so the client routes
requests to your deployment.

<CodeGroup >
<CodeBlock filename="Python (sync)" language="Python" icon="python">
{PyConnectEnterprise}
</CodeBlock>

<CodeBlock filename="Python (async)" language="Python" icon="python">
{PyConnectEnterpriseAsync}
<CodeBlock filename="Python" language="Python" icon="python">
{ "import lancedb\n\n" }
{PyConnectEnterpriseQuickstart}
</CodeBlock>

<CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
{TsConnectEnterprise}
{ "import * as lancedb from \"@lancedb/lancedb\";\n\n" }
{TsConnectEnterpriseQuickstart}
</CodeBlock>

<CodeBlock filename="Rust" language="Rust" icon="rust">
{RsConnectEnterprise}
{ "use lancedb::connect;\n\n" }
{RsConnectEnterpriseQuickstart}
</CodeBlock>
</CodeGroup >

To learn more about LanceDB Enterprise, see the [Enterprise documentation](/enterprise).
<Note>
`host_override` is the full URL of your cluster endpoint, including the scheme
(`https://`) and a port if your deployment listens on a non-default one
(e.g. `https://your-enterprise-endpoint.com:443`). If you don't know the
endpoint, [contact the LanceDB team](mailto:contact@lancedb.com).
</Note>

For a walkthrough on how to use LanceDB Enterprise (including `RemoteTable`
semantics), see its [quickstart](/enterprise/quickstart). To learn
more about LanceDB Enterprise overall, see the
[Enterprise documentation](/enterprise).

## 3. Obtain data and ingest into LanceDB

Expand Down
8 changes: 0 additions & 8 deletions docs/snippets/connection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ export const PyConnect = "import lancedb\n\nuri = \"ex_lancedb\"\ndb = lancedb.c

export const PyConnectAsync = "import lancedb\n\nuri = \"ex_lancedb\"\nasync_db = await lancedb.connect_async(uri)\n";

export const PyConnectEnterprise = "uri = \"db://your-database-uri\"\napi_key = \"your-api-key\"\nregion = \"us-east-1\"\n";

export const PyConnectEnterpriseAsync = "uri = \"db://your-database-uri\"\napi_key = \"your-api-key\"\nregion = \"us-east-1\"\n";

export const PyConnectEnterpriseQuickstart = "uri = \"db://your-database-uri\"\napi_key = \"your-api-key\"\nregion = \"us-east-1\"\nhost_override = \"https://your-enterprise-endpoint.com\"\n\ndb = lancedb.connect(\n uri=uri,\n api_key=api_key,\n region=region,\n host_override=host_override,\n)\n";

export const PyConnectObjectStorage = "import lancedb\n\nuri = \"s3://your-bucket/path\"\n# You can also use \"gs://your-bucket/path\" or \"az://your-container/path\".\ndb = lancedb.connect(uri)\n";
Expand All @@ -20,8 +16,6 @@ export const PyNamespaceTableOps = "import lancedb\n\ndb = lancedb.connect_names

export const TsConnect = "import * as lancedb from \"@lancedb/lancedb\";\n\nasync function connectExample(uri: string) {\n const db = await lancedb.connect(uri);\n return db;\n}\n";

export const TsConnectEnterprise = "const uri = \"db://your-database-uri\";\nconst apiKey = \"your-api-key\";\nconst region = \"us-east-1\";\n";

export const TsConnectEnterpriseQuickstart = "const uri = \"db://your-database-uri\";\nconst apiKey = \"your-api-key\";\nconst region = \"us-east-1\";\nconst hostOverride = \"https://your-enterprise-endpoint.com\";\n\nconst db = await lancedb.connect(uri, {\n apiKey,\n region,\n hostOverride,\n});\n";

export const TsConnectObjectStorage = "async function connectObjectStorageExample() {\n const uri = \"s3://your-bucket/path\";\n // You can also use \"gs://your-bucket/path\" or \"az://your-container/path\".\n const db = await lancedb.connect(uri);\n return db;\n}\n";
Expand All @@ -32,8 +26,6 @@ export const TsNamespaceTableOps = "const db = await lancedb.connectNamespace(\"

export const RsConnect = "async fn connect_example(uri: &str) {\n let db = connect(uri).execute().await.unwrap();\n let _ = db;\n}\n";

export const RsConnectEnterprise = "let uri = \"db://your-database-uri\";\nlet api_key = \"your-api-key\";\nlet region = \"us-east-1\";\n";

export const RsConnectEnterpriseQuickstart = "let uri = \"db://your-database-uri\";\nlet api_key = \"your-api-key\";\nlet region = \"us-east-1\";\nlet host_override = \"https://your-enterprise-endpoint.com\";\n";

export const RsConnectObjectStorage = "let uri = \"s3://your-bucket/path\";\n// You can also use \"gs://your-bucket/path\" or \"az://your-container/path\".\n";
Expand Down
11 changes: 7 additions & 4 deletions docs/tables/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ icon: "table"
keywords: ["create table", "polars", "pandas", "pyarrow", "dataframe", "nested data"]
---

import { PyConnect, PyConnectEnterprise, TsConnect, TsConnectEnterprise, RsConnect, RsConnectEnterprise } from '/snippets/connection.mdx';
import { PyConnect, PyConnectEnterpriseQuickstart, TsConnect, TsConnectEnterpriseQuickstart, RsConnect, RsConnectEnterpriseQuickstart } from '/snippets/connection.mdx';
import {
PyBasicImports,
PyDataLoad,
Expand Down Expand Up @@ -183,15 +183,18 @@ that points to where your data is stored, and you're ready to go.

<CodeGroup >
<CodeBlock filename="Python" language="Python" icon="python">
{PyConnectEnterprise}
{ "import lancedb\n\n" }
{PyConnectEnterpriseQuickstart}
</CodeBlock>

<CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
{TsConnectEnterprise}
{ "import * as lancedb from \"@lancedb/lancedb\";\n\n" }
{TsConnectEnterpriseQuickstart}
</CodeBlock>

<CodeBlock filename="Rust" language="Rust" icon="rust">
{RsConnectEnterprise}
{ "use lancedb::connect;\n\n" }
{RsConnectEnterpriseQuickstart}
</CodeBlock>
</CodeGroup >

Expand Down
14 changes: 0 additions & 14 deletions tests/py/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ async def connect_async_example():
return async_db


# --8<-- [start:connect_enterprise]
uri = "db://your-database-uri"
api_key = "your-api-key"
region = "us-east-1"
# --8<-- [end:connect_enterprise]


# --8<-- [start:connect_enterprise_async]
uri = "db://your-database-uri"
api_key = "your-api-key"
region = "us-east-1"
# --8<-- [end:connect_enterprise_async]


def connect_enterprise_quickstart_config():
import lancedb

Expand Down
11 changes: 0 additions & 11 deletions tests/rs/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,10 @@ async fn main() {
connect_example(uri.to_str().unwrap()).await;

// Keep the enterprise snippet in this file, but don't run it in CI.
let _ = connect_enterprise_config();
let _ = connect_enterprise_quickstart_config();
let _ = connect_object_storage_config();
}

fn connect_enterprise_config() -> (String, String, String) {
// --8<-- [start:connect_enterprise]
let uri = "db://your-database-uri";
let api_key = "your-api-key";
let region = "us-east-1";
// --8<-- [end:connect_enterprise]

(uri.to_string(), api_key.to_string(), region.to_string())
}

fn connect_enterprise_quickstart_config() -> (String, String, String, String) {
// --8<-- [start:connect_enterprise_quickstart]
let uri = "db://your-database-uri";
Expand Down
9 changes: 0 additions & 9 deletions tests/ts/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ test("connect to a local database", async () => {
});
});

// --8<-- [start:connect_enterprise]
const uri = "db://your-database-uri";
const apiKey = "your-api-key";
const region = "us-east-1";
// --8<-- [end:connect_enterprise]

async function connectEnterpriseQuickstart() {
// --8<-- [start:connect_enterprise_quickstart]
const uri = "db://your-database-uri";
Expand Down Expand Up @@ -120,9 +114,6 @@ async function namespaceAdminOpsExample() {
}

void [
uri,
apiKey,
region,
connectObjectStorageExample,
connectEnterpriseQuickstart,
namespaceTableOpsExample,
Expand Down
Loading