# Connection configuration

Wire up your connection by following the following steps (detailed explanation below):

1. Choose database type
2. Connect to your database
3. Define datasets
4. Write the required queries

To establish a connection, navigate to **Settings → Connection**.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FpCknXZtPpbRNxXyQb6Le%2FScreenshot%202025-02-04%20at%2011.42.17.png?alt=media&#x26;token=03c4e502-34b8-469d-9932-4e054786a4b5" alt="" width="563"><figcaption></figcaption></figure>

## Step 1: Choose database type

In the **Overview** tab, you can change the type of database you want to connect to.

You can also export the current connection setup (including all the queries), or import connection settings from a JSON.

To get some guidance, you can start by uploading these test queries (written for Postgres databases):

{% file src="<https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FocvhJORE6ve2W79A9hSL%2Fdatabase-connection-postgres.json?alt=media&token=7de9cbe1-9243-48de-85b9-b60f6496f046>" %}

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2Fm4Ota8M8SfMqOy1O6RUB%2Fimage.png?alt=media&#x26;token=2cb50c30-f539-41a6-b5ff-db4d02df8ba1" alt=""><figcaption><p>Connection overview</p></figcaption></figure>

Read more:

{% content-ref url="supported-databases" %}
[supported-databases](https://docs.marpledata.com/docs/marple-insight/setup-and-configuration/data-connection/supported-databases)
{% endcontent-ref %}

## Step 2: Connect to your database

Before configuring a connection, ensure that you have configured all necessary credentials. The required values differ between database types.&#x20;

After selecting the database type in the **Overview** tab, move to **Connection** to fill in the credentials.

Use "Test Connection" to make sure everything works. It should give a green checkmark (✅)

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FF9PHTKZ0MM9x6QUqbH5B%2Fimage.png?alt=media&#x26;token=8d2e3292-a88b-4b90-822a-d7a59cc52c8a" alt=""><figcaption><p>Connection credentials</p></figcaption></figure>

## Step 3: Define datasets

Marple Insight has a "dataset-oriented" approach.\
Start by defining 1 or more dataset metadata keys that define a dataset uniquely. Each dataset will shown in the library as a separate entry that can be analysed.

A dataset can be for example one flight test, race data for 1 car, ...

In the **Metadata** tab, you can define all dataset metadata that is shown in Marpe.

Mark the dataset identifiers as "filter". Those values can later be used in the queries, e.g. as *dataset.dataset\_id*.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FdXO4KDBXc6igTkpw7X4C%2Fimage.png?alt=media&#x26;token=bbac64c7-5945-4ec8-a3e8-51e21231ba08" alt="Metadata as dataset identifiers"><figcaption></figcaption></figure>

## Step 4: Queries

Next, within the Marple Insight application, you'll need to define a set of queries that allow Marple to interpret and retrieve your data.&#x20;

There are **required queries**—such as those for datasets, signal lists, and time-series data—as well as **optional queries**, like segment-based queries.

Make sure to wire up all required queries to enable Marple Insight on your data.

{% content-ref url="connection-configuration/required-queries" %}
[required-queries](https://docs.marpledata.com/docs/marple-insight/setup-and-configuration/data-connection/connection-configuration/required-queries)
{% endcontent-ref %}

{% content-ref url="connection-configuration/optional-queries" %}
[optional-queries](https://docs.marpledata.com/docs/marple-insight/setup-and-configuration/data-connection/connection-configuration/optional-queries)
{% endcontent-ref %}

These queries are written using the Jinja templating language, which makes them dynamic and adaptable to different database structures.

{% content-ref url="connection-configuration/templating" %}
[templating](https://docs.marpledata.com/docs/marple-insight/setup-and-configuration/data-connection/connection-configuration/templating)
{% endcontent-ref %}

## Need help?

Our team has a lot of expertise in setting up Marple Insight for customers. Get in touch if you have any questions:

{% content-ref url="../../welcome/feedback" %}
[feedback](https://docs.marpledata.com/docs/marple-insight/welcome/feedback)
{% endcontent-ref %}
