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

# Database

> Sync data directly from SQL databases.

# Database

The **Database** data source allows you to connect and sync data tables directly from an external SQL database.

## Supported Databases

* **PostgreSQL**
* **Microsoft SQL Server**

## Connect Data source

1. Select **Data Sources** > **+ Add**.
2. Choose **Database** as the source type.
3. Select your database provider (e.g., **PostgreSQL** or **Microsoft SQL Server**).

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_list.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=eee3ea89c187e58bd15c0f09b6d65cc4" style={{ width: 'auto', maxWidth: '100%' }} alt="Select Database Provider" width="499" height="226" data-path="docs/images/gidr/database_list.png" />

<Note>
  For detailed configuration settings for each database connector (Host, Port, Credentials), please refer to the [Connectors](connectors#database-connectors) page.
</Note>

## Upload Database (Excel)

Alternatively, you can upload an offline database in Excel format. This is useful for importing static datasets that follow a relational structure.

1. In the "Connect your data" modal, select **Database**.
2. Switch to the **Upload** tab.
3. Upload your Excel file (Max 500 MB).

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_upload_modal.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=f0d91732aa108e02e3b49b9dcb61ca7a" style={{ width: 'auto', maxWidth: '100%' }} alt="Upload Database Modal" width="563" height="510" data-path="docs/images/gidr/database_upload_modal.png" />

### Excel Format Requirements

The Excel file must follow a strict template with three sheets: **schema**, **data**, and **info**.

#### 1. Schema Sheet

Defines the table structure.

* **Column Name**: The name of the field.
* **Column Type**: Data type (e.g., `VARCHAR(255)`, `TEXT`, `INTEGER`, `TIMESTAMP`).
* **Description**: A description of what the column represents.

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_excel_schema.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=391281239b28419677b554244eba8de0" style={{ width: 'auto', maxWidth: '100%' }} alt="Excel Schema Sheet" width="1024" height="285" data-path="docs/images/gidr/database_excel_schema.png" />

#### 2. Data Sheet

Contains the actual data records corresponding to the schema.

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_excel_data.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=ea7457844adcf0f8f94f8a9aaa533767" style={{ width: 'auto', maxWidth: '100%' }} alt="Excel Data Sheet" width="1024" height="386" data-path="docs/images/gidr/database_excel_data.png" />

#### 3. Info Sheet

Provides metadata about the table.

* **Cell A1**: A comprehensive description of the table's purpose (e.g., "This table holds all audit records...").

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_excel_info.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=07fc8b674502451641d9e295e550f542" style={{ width: 'auto', maxWidth: '100%' }} alt="Excel Info Sheet" width="1003" height="502" data-path="docs/images/gidr/database_excel_info.png" />

## Managing Databases

Once connected or uploaded, your database tables appear in the data sources list.

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_list_processed.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=aa544ebd3ecff8830f232f56c98e4613" style={{ width: 'auto', maxWidth: '100%' }} alt="Database List View" width="1024" height="242" data-path="docs/images/gidr/database_list_processed.png" />

### Schema Manager

You can view and edit the metadata for any table by clicking the **Schema Manager** link (gear icon).

<img src="https://mintcdn.com/gidrai/tGsSOYP36yYHS_h9/docs/images/gidr/database_schema_manager.png?fit=max&auto=format&n=tGsSOYP36yYHS_h9&q=85&s=5ab3798cbc3cd06751d1843bc62e4a2f" style={{ width: 'auto', maxWidth: '100%' }} alt="Database Schema Manager" width="1024" height="634" data-path="docs/images/gidr/database_schema_manager.png" />

The Schema Manager allows you to:

* **Edit Table Description**: Update the high-level description of what the table contains.
* **Edit Column Descriptions**: Refine the descriptions for individual columns.

<Note>
  Why edit descriptions? The system uses these descriptions to understand the semantic meaning of your data. Improving them can significantly enhance the accuracy of natural language queries and retrieval performance.
</Note>
