> ## 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()

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

Connect to an external database using DirectQuery.

> [!NOTE]
>
> Not available in the community edition: [upgrade](https://docs.activeviam.com/engine/python-sdk/6.2/getting_started/upgrade_from_community_edition.md) to use it.

### Parameters

#### *connection\_config*

The config to connect to the external database.
Each [DirectQuery plugin](https://docs.activeviam.com/engine/python-sdk/6.2/getting_started/plugins.md#directquery) has its own `ConnectionConfig` class.
