# Connecting to Databases and Cloud Data Sources

For this tutorial, we will walk through the process of **connecting to a PostgreSQL database**.

#### 1. Click "settings"

Access the settings menu.

<figure><img src="/files/e0IpC02FzO2VrNJ6zyYj" alt=""><figcaption></figcaption></figure>

#### 2. Click "Datasources"

Navigate to the Datasources section.

![Click 'Datasources'](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2FmXQU6BoFnoToxRefQjNm8e_doc.png?alt=media\&token=2ff66ee7-ae89-4d48-8ece-ed047e5e488b)

#### 3. Click "ADD DATASOURCE"

![Click 'ADD DATASOURCE'](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2FkorGMvqQxpGdPMvG6RoT3s_doc.png?alt=media\&token=d4adb8ba-b3cd-4e8f-ba0f-fa5b471ae00f)

#### 4. Select the database or cloud datasource you like to connect

![Select the database or cloud datasource you like to connect](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2FaAiShuf6wntTtAYP3YDkKU_doc.png?alt=media\&token=814f9a2a-379b-406b-8ad5-63b64cd0e260)

#### 5. We'll be using Postgres for this tutorial.

Choose the Postgres option.

![We'll be using Postgres for this tutorial.](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2F9S3hzGYgoBTNc6i8RtxjvD_doc.png?alt=media\&token=695f641b-9faa-4546-a791-1116e20ca008)

#### 6. You can select "Live" or "Cached" mode.

When connecting to a **PostgreSQL database**, you can choose between **Live** and **Cached** modes, depending on your data retrieval needs.

### **Mode Options**

1. **Live Mode**
   * Queries are executed directly on the database **during runtime**.
   * Ensures real-time data access with the latest updates.
   * May have **slightly higher latency** depending on the database performance.
2. **Cached Mode**
   * Data is **copied and stored** in the platform’s data warehouse.
   * Improves performance by reducing database queries.
   * Ideal for **historical data analysis** and reducing database load.

![You can select 'Live' or 'Cached' mode.](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2FsJW37FbayLrqfQkKtiXLpn_doc.png?alt=media\&token=ab54993c-ef9d-4afb-9af2-ae9682fa2adb)

#### 7. Enter Database Credentials

Access the field for entering the datasource name.

![Enter Database Credentials](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2Fnhh33x6jpfauCLZvHCNqzs_doc.png?alt=media\&token=9115be18-4134-484c-a2eb-d3ad4844f864)

#### 8. Critical: White list IP and provide read-only access.

When connecting your database to **Infinity**, it is **critical** to whitelist the required IP address and provide **read-only access** to ensure a secure connection.

### **Why Whitelist an IP?**

* Ensures that **Infinity** can securely access your database.
* Prevents unauthorized access by restricting database connections to a specific IP.
* Improves security while allowing the platform to retrieve data for analytics.

### **Steps to Whitelist the Required IP**

1. **Identify the IP to Whitelist**
   * The platform will display the required IP address (e.g., **34.71.126.215** in this example).
   * Copy the IP address provided in the notification.
2. **Whitelist the IP in Your Database**
   * Log into your **database management system** (e.g., PostgreSQL, MySQL, or cloud provider like AWS RDS, Google Cloud, or Azure).
   * Navigate to **Security Settings** or **Network Access** settings.
   * Add the provided IP to the **Allowed IP List** or **Firewall Rules**.
3. **Grant Read-Only Access**
   * Create a **read-only database user** or adjust permissions for an existing user.
   * Ensure the user **can read data** but **cannot modify** or delete records.

![Critical: White list IP and provide read-only access.](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2FaodcuEjzqZUzqQ1uyWV5JU_doc.png?alt=media\&token=f48d17e7-078a-456e-bee3-0b8c4dd22df8)

#### 9. Proceed to the next step.

Move on to the next step.

![Proceed to the next step.](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2Fnuzc432VZKSNAY9qFojwLd_doc.png?alt=media\&token=503b665f-b649-4815-8845-612ff8893b73)

#### 10. Add/Edit data descriptions for each table

When connecting a database, it is essential to provide **clear and meaningful descriptions** for each table to improve AI-driven insights and analytics.

### **Steps to Add or Edit Data Descriptions**

1. **Review Tables in Your Dataset**
   * After establishing the connection, you will see a list of tables.
   * Tables marked as **"uncompleted"** require descriptions to be added.
2. **Select a Table**
   * Click on a table (e.g., **customer, manufacturer, mobilephone**) to open its details.
   * A description field will be available for each table.
3. **Enter or Edit Descriptions**
   * Provide a **clear and concise** summary of what the table contains.
   * Example: Instead of `"customers"`, use `"Contains customer demographic details, contact information, and purchase history."`
4. **Save and Complete the Process**
   * Once you have reviewed and updated the description, the table status will change to **"completed."**
   * Continue editing until all tables have descriptions.
   * Click **Next** to proceed to the settings step.

### **Why This Matters?**

✔ **Enhances AI Context** – AI models use descriptions to generate accurate charts and analyses.\
✔ **Improves Data Usability** – Users can better understand and navigate the dataset.\
✔ **Ensures Data Consistency** – Helps maintain a structured and well-documented database.

By completing this step, you ensure that **Infinity** can leverage your data effectively for AI-driven insights.

![Add/Edit data descriptions for each table](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2FobqsrC9PAuTdfXd92HCvEG_doc.png?alt=media\&token=ac466b94-9314-4e77-bc35-29c21e439d8c)

#### 11. Once you update data descriptions for all tables, proceed by clicking "Next"

* **Review Completion Status**
  * Ensure that all tables in the list have a **"completed"** status.
  * A **progress bar** at the top will indicate how many tables have been reviewed.
* **Verify Each Table's Description**
  * Double-check that all table descriptions are clear, accurate, and useful.
  * If needed, edit descriptions before moving forward.
* **Proceed by Clicking "Next"**
  * Once all tables are marked as **"completed"**, click the **"Next"** button.
  * This will take you to the **Settings** step, where you can configure additional options like permissions and data access settings.

<figure><img src="/files/NmhvT3lrNBlCitoqtvLg" alt=""><figcaption></figcaption></figure>

#### 12. Assign access permissions

1. **Navigate to the Permissions Settings**
   * In the **Settings** step, locate the **Roles** section.
   * This allows you to assign access based on predefined roles.
2. **Select Roles for Access**
   * Click the **Roles** dropdown menu.
   * Choose the appropriate roles that should have access to the data source.
   * You can assign multiple roles as needed.
3. **Save the Permissions**
   * Once you have assigned the necessary roles, click **Save** to confirm the changes.

![Assign access permissions](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2F4RguuvAEyLoJHeCYrBrBZ5_doc.png?alt=media\&token=fa0d3d67-9f49-4bad-826e-134b056b3f19)

#### 13. Click "Save" to complete connection.

Save the changes.

![Click 'Save' to complete connection.](https://static.guidde.com/v0/qg%2F3qQSN1rQvFb25Kfi4Malri6srgx1%2FeCytJkN1JyZwVv1f3VbQSX%2F33iiGzYMnionxF7VnWpGhR_doc.png?alt=media\&token=6c46b5a4-dc17-4b79-b42a-47f7354754a8)

[Powered by **guidde**](https://www.guidde.com)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getinfinity.app/user-guide/comprehensive-user-guide/1.-connecting-your-data/connecting-to-databases-and-cloud-data-sources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
