> ## 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.

# Session.connect_to_external_database()

<span id="atoti.Session.connect_to_external_database" />

> Session.connect\_to\_external\_database(<br />
>     *connection\_config*: ExternalDatabaseConnectionConfigT,<br />
>     /,<br />
> ) → [ExternalDatabaseConnection](./atoti.directquery.ExternalDatabaseConnection#atoti.ExternalDatabaseConnection)\[ExternalDatabaseConnectionConfigT]

Connect to an external database using DirectQuery.

<Note>
  This feature is not part of the community edition: it needs to be [unlocked](../guides/unlocking_all_features).
</Note>

### Parameters

<h4 id="atoti.Session.connect_to_external_database.connection_config">
  *connection\_config*
</h4>

The config to connect to the external database.
Each [DirectQuery plugin](../getting_started/plugins#directquery) has its own `ConnectionConfig` class.
