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

# Bubble

> This page outlines the steps to connect Bubble to the Connect AI Virtual SQL Server API.

## Prerequisites

Before you connect, you must first do the following:

* Connect a data source to your Connect AI account. See [Sources](/en/Sources) for more information.
* Generate a Personal Access Token (PAT) on the [Settings](/en/Settings#personal-access-tokens) page. Copy this down, as it acts as your password during authentication.

## Connect to Connect AI

To establish a connection from Bubble to the Connect AI Virtual SQL Server API, follow these steps.

<Steps>
  <Step>
    Log in to Bubble.
  </Step>

  <Step>
    On the left hand menu, click **Plugins**.

    <Frame>
      <img src="https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/bubble_client_01.png?fit=max&auto=format&n=dLO4dOBGO5Ysdj01&q=85&s=bfc40929b795455b99230ffba050c150" alt="" width="941" height="476" data-path="en/images/bubble_client_01.png" />
    </Frame>
  </Step>

  <Step>
    Click **Add plugins**.
  </Step>

  <Step>
    Search for "SQL Database Connector" and click **Install**.

    <Frame>
      <img src="https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/bubble_client_02.png?fit=max&auto=format&n=dLO4dOBGO5Ysdj01&q=85&s=3f709fdd71ba14c73eab768ba6d46bcb" alt="" width="1006" height="239" data-path="en/images/bubble_client_02.png" />
    </Frame>
  </Step>

  <Step>
    Once it is installed, it is available to use as shown below. Click **Add a new connection**.

    <Frame>
      <img src="https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/bubble_client_03.png?fit=max&auto=format&n=dLO4dOBGO5Ysdj01&q=85&s=119b6dd0c40b2c7f6145302b4f591029" alt="" width="642" height="532" data-path="en/images/bubble_client_03.png" />
    </Frame>
  </Step>

  <Step>
    Enter the connection settings.

    * **Connection name**—enter a name for the connection to Connect AI.
    * **Database type**—select **Microsoft SQL**.
    * **Connection string**—enter the SQL database connection string. This string includes a username and password in a format like `sql://[Username]:[Password]@tds.cdata.com:14333/`. Enter the following settings into this string.
      * **Username**—enter your Connect AI username. This is displayed in the top-right corner of the Connect AI interface. For example, *[test@cdata.com](mailto:test@cdata.com)*.
      * **Password**—enter the PAT you generated on the [Settings](/en/Settings#personal-access-tokens) page.

    <Note>
      The password portion of the connection string should not contain any forward slashes, because Bubble interprets them as separators. Replace any forward slashes with the URL-encoded string `%2F`.
    </Note>

    <Note>
      it is also possible to add a database connection name at the end of the connection string like `sql://[Username]:[Password]@tds.cdata.com:14333/[ConnectionName]`.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/bubble_client_04.png?fit=max&auto=format&n=dLO4dOBGO5Ysdj01&q=85&s=3afbad8e9b791703baf675c026844aec" alt="" width="960" height="219" data-path="en/images/bubble_client_04.png" />
    </Frame>
  </Step>

  <Step>
    Click **Test the connection**. If the connection succeeds, this button becomes gray and says **Database connected** as shown below.

    <Frame>
      <img src="https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/bubble_client_05.png?fit=max&auto=format&n=dLO4dOBGO5Ysdj01&q=85&s=7bb85f7d5db6415168351aa8b68681fa" alt="" width="471" height="230" data-path="en/images/bubble_client_05.png" />
    </Frame>
  </Step>
</Steps>
