> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enterprise Quickstart

> Run the LanceDB quickstart workflow on a RemoteTable in LanceDB Enterprise.

export const RsQuickstartVectorSearch2 = "// Let's search for vectors similar to \"wizard\"\nlet query_vector = [0.7, 0.3, 0.5];\n\nlet result: DataFrame = table\n    .query()\n    .nearest_to(&query_vector)\n    .unwrap()\n    .limit(2)\n    .select(Select::Columns(vec![\"text\".to_string()]))\n    .execute()\n    .await\n    .unwrap()\n    .into_polars()\n    .await\n    .unwrap();\nprintln!(\"{result:?}\");\nlet text_col = result.column(\"text\").unwrap().str().unwrap();\nlet top_two = vec![\n    text_col.get(0).unwrap().to_string(),\n    text_col.get(1).unwrap().to_string(),\n];\n";

export const RsQuickstartAddData = "let more_data = vec![\n    Adventurer {\n        id: \"7\".to_string(),\n        text: \"mage\".to_string(),\n        vector: [0.6, 0.3, 0.4],\n    },\n    Adventurer {\n        id: \"8\".to_string(),\n        text: \"bard\".to_string(),\n        vector: [0.3, 0.8, 0.4],\n    },\n];\n\n// Add data to table\ntable\n    .add(adventurers_to_reader(schema.clone(), &more_data))\n    .execute()\n    .await\n    .unwrap();\n";

export const RsQuickstartOpenTable = "let table: Table = db.open_table(\"adventurers\").execute().await.unwrap();\n";

export const RsQuickstartVectorSearch1 = "// Let's search for vectors similar to \"warrior\"\nlet query_vector = [0.8, 0.3, 0.8];\n\nlet result: DataFrame = table\n    .query()\n    .nearest_to(&query_vector)\n    .unwrap()\n    .limit(2)\n    .select(Select::Columns(vec![\"text\".to_string()]))\n    .execute()\n    .await\n    .unwrap()\n    .into_polars()\n    .await\n    .unwrap();\nprintln!(\"{result:?}\");\n";

export const RsQuickstartCreateTable = "// Define an arrow schema named adventurers_schema beforehand (omitted here for brevity)\nlet schema = adventurers_schema();\nlet data = vec![\n    Adventurer {\n        id: \"1\".to_string(),\n        text: \"knight\".to_string(),\n        vector: [0.9, 0.4, 0.8],\n    },\n    Adventurer {\n        id: \"2\".to_string(),\n        text: \"ranger\".to_string(),\n        vector: [0.8, 0.4, 0.7],\n    },\n    Adventurer {\n        id: \"9\".to_string(),\n        text: \"priest\".to_string(),\n        vector: [0.6, 0.2, 0.6],\n    },\n    Adventurer {\n        id: \"4\".to_string(),\n        text: \"rogue\".to_string(),\n        vector: [0.7, 0.4, 0.7],\n    },\n];\n// Create a new table with the data, overwriting if it already exists\nlet mut table = db\n    .create_table(\"adventurers\", adventurers_to_reader(schema.clone(), &data))\n    .mode(CreateTableMode::Overwrite)\n    .execute()\n    .await\n    .unwrap();\n";

export const RsQuickstartDefineStruct = "// Define a struct representing the data schema\n#[derive(Debug, Clone, Serialize, Deserialize)]\nstruct Adventurer {\n    id: String,\n    text: String,\n    vector: [f32; 3],\n}\n\nfn adventurers_schema() -> Arc<Schema> {\n    Arc::new(Schema::new(vec![\n        Field::new(\"id\", DataType::LargeUtf8, false),\n        Field::new(\"text\", DataType::LargeUtf8, false),\n        Field::new(\n            \"vector\",\n            DataType::FixedSizeList(Arc::new(Field::new(\"item\", DataType::Float32, true)), 3),\n            false,\n        ),\n    ]))\n}\n";

export const TsQuickstartVectorSearch2 = "// Let's search for vectors similar to \"wizard\"\nqueryVector = [0.7, 0.3, 0.5];\n\nconst results = await table.search(queryVector).limit(2).toArray();\nconsole.table(results);\n";

export const TsQuickstartAddData = "const moreData = [\n  { id: \"7\", text: \"mage\", vector: [0.6, 0.3, 0.4] },\n  { id: \"8\", text: \"bard\", vector: [0.3, 0.8, 0.4] },\n];\n\n// Add data to table\nawait table.add(moreData);\n";

export const TsQuickstartOpenTable = "table = await db.openTable(\"adventurers\");\n";

export const TsQuickstartVectorSearch1 = "// Let's search for vectors similar to \"warrior\"\nlet queryVector = [0.8, 0.3, 0.8];\n\nlet result = await table.search(queryVector).limit(2).toArray();\nconsole.table(result);\n";

export const TsQuickstartCreateTable = "const data = [\n  { id: \"1\", text: \"knight\", vector: [0.9, 0.4, 0.8] },\n  { id: \"2\", text: \"ranger\", vector: [0.8, 0.4, 0.7] },\n  { id: \"9\", text: \"priest\", vector: [0.6, 0.2, 0.6] },\n  { id: \"4\", text: \"rogue\", vector: [0.7, 0.4, 0.7] },\n];\nlet table = await db.createTable(\"adventurers\", data, { mode: \"overwrite\" });\n";

export const PyQuickstartVectorSearch2 = "# Let's search for vectors similar to \"wizard\"\nquery_vector = [0.7, 0.3, 0.5]\n\nresults = table.search(query_vector).limit(2).to_polars()\nprint(results)\n";

export const PyQuickstartAddData = "more_data = [\n    {\"id\": \"7\", \"text\": \"mage\", \"vector\": [0.6, 0.3, 0.4]},\n    {\"id\": \"8\", \"text\": \"bard\", \"vector\": [0.3, 0.8, 0.4]},\n]\n\n# Add data to table\ntable.add(more_data)\n";

export const PyQuickstartOpenTable = "table = db.open_table(\"adventurers\")\n";

export const PyQuickstartVectorSearch1 = "# Let's search for vectors similar to \"warrior\"\nquery_vector = [0.8, 0.3, 0.8]\n\n# Ensure you run `pip install polars` beforehand\nresult = table.search(query_vector).limit(2).to_polars()\nprint(result)\n";

export const PyQuickstartCreateTable = "data = [\n    {\"id\": \"1\", \"text\": \"knight\", \"vector\": [0.9, 0.4, 0.8]},\n    {\"id\": \"2\", \"text\": \"ranger\", \"vector\": [0.8, 0.4, 0.7]},\n    {\"id\": \"9\", \"text\": \"priest\", \"vector\": [0.6, 0.2, 0.6]},\n    {\"id\": \"4\", \"text\": \"rogue\", \"vector\": [0.7, 0.4, 0.7]},\n]\ntable = db.create_table(\"adventurers\", data=data, mode=\"overwrite\")\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 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 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";

This quickstart follows a similar workflow as the [OSS quickstart](/quickstart), but uses a **`RemoteTable`** through a `db://...` connection.

<Callout icon="circle-info" color="#FF8A5C" iconType="regular">
  To get a LanceDB Enterprise cluster setup and to obtain credentials and endpoint details, [contact our team](mailto:contact@lancedb.com) to get started.
  This guide assumes your Enterprise cluster is already running.
</Callout>

## 1. Install LanceDB

<CodeGroup>
  ```bash Python icon=Python theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
  pip install lancedb
  ```

  ```bash TypeScript icon=js theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
  npm install @lancedb/lancedb
  ```

  ```bash Rust icon=Rust theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
  cargo add lancedb
  ```
</CodeGroup>

## 2. Connect to Enterprise (`db://...`)

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

    {PyConnectEnterpriseQuickstart}
  </CodeBlock>

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

    {TsConnectEnterpriseQuickstart}
  </CodeBlock>

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

    {RsConnectEnterpriseQuickstart}
  </CodeBlock>
</CodeGroup>

## 3. Create a table (same sample data as the OSS quickstart)

<CodeGroup>
  <CodeBlock filename="Python" language="Python" icon="python">
    {PyQuickstartCreateTable}
  </CodeBlock>

  <CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
    {TsQuickstartCreateTable}
  </CodeBlock>

  <CodeBlock filename="Rust" language="Rust" icon="rust">
    {RsQuickstartDefineStruct}

    {RsQuickstartCreateTable}
  </CodeBlock>
</CodeGroup>

## 4. Run vector search

<CodeGroup>
  <CodeBlock filename="Python" language="Python" icon="python">
    {PyQuickstartVectorSearch1}
  </CodeBlock>

  <CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
    {TsQuickstartVectorSearch1}
  </CodeBlock>

  <CodeBlock filename="Rust" language="Rust" icon="rust">
    {RsQuickstartVectorSearch1}
  </CodeBlock>
</CodeGroup>

## 5. Open table, add data, and query again

<CodeGroup>
  <CodeBlock filename="Python" language="Python" icon="python">
    {PyQuickstartOpenTable}

    {PyQuickstartAddData}

    {PyQuickstartVectorSearch2}
  </CodeBlock>

  <CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
    {TsQuickstartOpenTable}

    {TsQuickstartAddData}

    {TsQuickstartVectorSearch2}
  </CodeBlock>

  <CodeBlock filename="Rust" language="Rust" icon="rust">
    { "use lancedb::table::Table;\n\n" }

    {RsQuickstartOpenTable}

    {RsQuickstartAddData}

    {RsQuickstartVectorSearch2}
  </CodeBlock>
</CodeGroup>

## Differences between Enterprise and OSS usage

As can be seen, the flow for working with a `RemoteTable` in Enterprise looks more or less
similar to the [OSS quickstart](/quickstart). However, there are some semantic differences:

### 1. Connection model

In LanceDB Enterprise, your app connects via a `db://...` URI and sends requests to the cluster API. The cluster executes table operations on your behalf.
Your code is coupled to a **managed service endpoint** (whereas in OSS, your code is directly coupled to storage paths).

### 2. Returned table type

Connecting to an Enterprise table via `open_table(...)` returns a `RemoteTable`, unlike in OSS, which returns a `LanceTable`.

### 3. Materialization APIs

For Python users working with LanceDB Enterprise, `RemoteTable` does not support table-level
materialization methods like `table.to_arrow()` or `table.to_pandas()`. This is to protect
users from accidentally materializing tables that are too large to fit in memory.

Instead, you materialize results through query/search builders, for example `table.search(...).limit(...).to_pandas()` or `table.query(...).to_arrow()`. For quick previews, you can use `table.head()`.

### 4. Maintenance lifecycle

In Enterprise, maintenance operations like `optimize`, `compact_files` are handled by the cluster as background work. You can trigger them manually, but they are not required for performance or correctness in the same way they are in OSS.

That means maintenance is managed by platform behavior and cluster configuration, not by explicit per-table maintenance calls in your application code.

### 5. Guardrails and limits

Enterprise can enforce platform-level guardrails, such as index/table limits and safety checks around operations like `merge_insert` when too many rows are unindexed. OSS mostly exposes storage/format-level behavior, and you tune many lifecycle tasks yourself.

This means an operation in LanceDB Enterprise can fail due to service-level policy, not just because of local table shape or schema mismatch.

### 6. Cluster-managed background work

In Enterprise, async writes and reindexing workflows are handled by cluster background systems. In OSS, if you want ongoing upkeep, you usually schedule and run it yourself in your application or jobs.

In practice, your app issues table operations, and the platform handles distributed orchestration for maintenance and indexing in the background.

<Info>
  As a rule of thumb, all you need to remember with regard to LanceDB Enterprise is this: treat `db://...` as a remote service boundary, use query builders to fetch results, and otherwise interact with your tables as you would in OSS.\*\*
</Info>

## Advanced usage via namespace-backed connections

LanceDB Enterprise also supports namespace-backed catalog connections. This allows you to resolve tables by namespace, rather than by direct URI, and is accessed via the REST connection mode of `connect_namespace(...)`. This is useful when table location resolution and credential vending are handled by an external catalog/namespace service.

```py Python icon=Python theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
import os
import lancedb

ns_db = lancedb.connect_namespace(
    "rest",
    {
        "uri": "https://<your-catalog-endpoint>",
        "headers.Authorization": f"Bearer {os.environ['CATALOG_TOKEN']}",
    },
)

# Namespace-scoped table resolution
table = ns_db.open_table("adventurers", namespace=["prod", "search"])
```

This mode is useful when table location resolution and credential vending are handled by an external catalog/namespace service.

If you want to stick to a common table flow, start with the `db://` RemoteTable flow shown above.

## Further reading

You can learn more about table operations, namespaces, and the architecture of LanceDB Enterprise in the following guides.

<Columns cols={2}>
  <Card title="Table operations" icon="table" href="/tables">
    Build on this quickstart with table creation, updates, and schema tips.
  </Card>

  <Card title="Using namespaces" icon="sitemap" href="/namespaces/usage">
    Learn how to use namespaces in LanceDB, and connect to an Enterprise namespace via REST.
  </Card>

  <Card title="LanceDB Enterprise architecture" icon="cubes" href="/enterprise/architecture">
    Learn about the architecture of LanceDB Enterprise and how it achieves high performance at scale.
  </Card>
</Columns>
