> For the complete documentation index, see [llms.txt](https://learn.squirrel365.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.squirrel365.io/components-functions-and-connections/overview-2/infoburst/database-connections.md).

# Database Connections

{% hint style="success" %}
**Who can use this feature?**

The **Database Connections** can be used by those with the **Builder** subscription plan.

For more details, see our [**pricing comparison matrix**](https://squirrel365.io/pricing/).
{% endhint %}

The **Database** Connections can be used to connect the Squirrel project to an external InfoBurst database.

There are two different **Database** connections:

* **Database Query** - queries the referenced database and returns the selected query.
* **Database Writeback** - writes back to the selected query and updates the information based on an insertion

## Common Database Connector Properties – Credentials

An Infoburst URL and login credentials are required to use the **Database** connectors. These can be obtained from the Infoburst webpage, as well as the URL port.

### Database Login Credentials

The '**Infoburst URL**' is used to access followed by a port to identify the specific environment.

After entering the URL, all that is needed is a '**Username**' and '**Password**'.

All three of the credential fields can be bound to cells in the spreadsheet.

<figure><img src="/files/09DeuPuiTM6kx1DIUt6M" alt=""><figcaption></figcaption></figure>

***

## Mapping the data to the spreadsheet

After connecting to the database, the **DATA MAPPING** properties will populate which is where you can define the cache or cache query to be brought into Squirrel.

***

### Database Query

The **Database Query** DATA MAPPING properties will populate a list of the existing caches within the connected database. After making a selection, the dropdown will outline the number of caches selected.

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

The selected query will populate below the dropdown to bind its location to the spreadsheet. The **Destination** field will appear to bind the query to an area in the spreadsheet for the data to populate at runtime.&#x20;

**Max Rows** will determine if there is a limit on the number of rows returned from the database.

{% hint style="info" %}
If the database contains parameters defined in the SQL code, a PARAMETER sub-drawer will populate in the DATA MAPPING drawer.
{% endhint %}

<figure><img src="/files/A5ttr1TKIKM7lLBVg0Am" alt=""><figcaption><p>The Parameter inputs that appear will be labelled as the value defined in the Database SQL code.</p></figcaption></figure>

***

### Database Writeback

The **Database Writeback** DATA MAPPING properties will populate a list of the existing cache queries within the connected database. After making a selection, a sub-drawer will populate labeled META DATA.

{% hint style="info" %}
If the database contains parameters defined in the SQL code, a PARAMETER sub-drawer will populate in the DATA MAPPING drawer.
{% endhint %}

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

The **FALLBACK STATEMENT** drawer defines a "backup" writeback that will execute only if the initial writeback statement fails. The property panel layout is the same as the original Writeback Statement.

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

The **QUERY ON SUCCESS** drawer is used to run a query if either of the above writeback statements succeeds.

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

***

## Triggering the connection

Like most connections, the properties panel has a **USAGE** drawer that provides control of the connector's triggers.

* **Refresh on Load** - as described, the connection will trigger and the data will be brought through to the spreadsheet on the load of the project. This can be previewed in Debug and Preview modes.
* **Refresh on Interval** - defines an Interval that the connection will refresh. When selected, an input will populate where a period of seconds can be defined for the connection to refresh.
* **Refresh on Cell Changes** - sets the trigger to refresh on the change of another cell. This property utilizes **Conditional Logic**. For more information on **Conditional Logic** and its uses, see [**this article**](https://learn.squirrel365.io/getting-started/dynamic-visibility#conditional-logic).

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