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

# atoti_sql_bridge

Client part of the [plugin](../getting_started/plugins) to connect Tableau and Power BI to Atoti sessions.

<Note>
  Not available in the community edition: [upgrade](../getting_started/upgrade_from_community_edition) to use it.

  This feature requires a license that enables the `bi-adapter` component.
</Note>

Tableau and Power BI can query an Atoti session: it exposes each of its cubes as a SQL table, over the PostgreSQL wire protocol.
Only the SQL generated by these two tools is supported.

BI tools connect with a username and password, which are checked like any other username and password login of the session, such as the ones set in [`credentials`](./atoti.security.BasicAuthenticationSecurity.credentials#atoti.security.basic_authentication_security.BasicAuthenticationSecurity.credentials).

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> table = session.read_pandas(
...     pd.DataFrame({"ID": ["foo"]}), keys={"ID"}, table_name="Example"
... )
>>> cube = session.create_cube(table)
```

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> path, _ = session.client.get_path_and_version_id("activeviam/bi-adapter")
```

The `host` is the one the BI tool will use to reach the SQL endpoint:

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> body = {"host": "localhost"}
```

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> session.client.http_client.post(
...     f"{path}/tableau/tds/{cube.name}", json=body
... ).status_code
200
>>> session.client.http_client.post(
...     f"{path}/powerbi/pbit/{cube.name}", json=body
... ).status_code
200
```

### Members

| Name | Summary |
| - | - |
| [`SqlBridgeConfig`](./atoti_sql_bridge.SqlBridgeConfig#atoti_sql_bridge.SqlBridgeConfig) | Configuration of the SQL endpoint that BI tools connect to. |
