• Beta
Connect Data to Preset
  • 20 Oct 2020
  • 2 Minutes To Read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Connect Data to Preset

  • Print
  • Share
  • Dark
    Light

Overview

There are three ways to connect data to Preset:

  • Create a Table / Dataset;
  • Load a CSV; or,
  • Create a Query in SQL Editor

In this article we will explore the most popular method to connecting your data to Preset: creating a table / dataset.

Making_Data_Available_to_Preset


Step 1: Create a Database

Preset supports a wide variety of databases, so there's a good chance that your favorite database can already be used with Preset. Popular databases include SQL Server, Vertica, and PostgreSQL.

DB_List

For a full list of supported databases, have a look at the Supported Databases article.


Step 2: Connect the Database to Preset

To start, in the Toolbar, select Data and, in the drop-down menu, select Databases.

Select_Databases1@2x

The Data - Databases screen appears featuring a list of all databases connected to Preset within your selected workspace.

To start the process, select the green + DATABASE button.

Add_Database@2x

The Add Database window appears.

This interface is used to establish a connection between your database and Preset. This is done by specifying a name for your database as well as including a SQLAlchemy URI — please have a look at the SQLAlchemy documentation to learn how to structure your URI so that it connects successfully.

Add_Database1@2x

Feel free to use the Test Connection button to confirm that your database is connected.

At this stage, you are all done, but it is recommended to spend some time exploring the other configuration tabs: Performance, SQL Lab Settings, Security, and Extra.

Of particular note is the SQL Lab Settings tab. These fields are used to enable your database to interact with Preset's SQL Lab, a powerful query management tool that integrates tightly with the chart & dashboard creation process.

We recommend the following baseline settings in order to take advantage of SQL Lab's capabilities:

Add_Database2@2x

When done, select Add. Your newly-connected database will appear in the list of databases on the Data - Database screen.


Step 3: Add a Dataset to Preset

We're not done yet!

Although your database is now connected—which is a great start—we need to tell Preset which tables within your database should be available for user selection. Doing this enables users to select a datasource when creating a new chart.

This step is pretty straightforward. From the Data - Databases screen above, select the Datasets tab.

Dataset_Tab@2x

Like before, select the + DATASET button to add a new dataset.

Add_Dataset1@2x

The Add Dataset window appears.

In the Datasource field, select your newly-connected database. Wait just a moment — in this window, Preset will populate the next field based on your selection.

In the Schema field, select a schema from your database. As above, wait a moment for the table options to populate the next field.

Lastly, in the Table field, select a table. When done, select Add.

Add_Dataset2@2x

Great work! Congratulations, your database is now connected with Preset and a table within that database is available for selection by users.

You, and any colleagues within your workspace, can now select the table and use that data to build out their own visualizations!

Was This Article Helpful?