---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/operations/connection/create-trino
  - ru/operations/connection/create-trino
  - href: en/operations/connection/create-trino.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/operations/connection/create-trino.html
title: How to create a Trino connection in DataLens On-premises
description: >-
  In this tutorial, you will learn how to connect to Trino in DataLens
  On-premises.
vcsPath: en/operations/connection/create-trino.md
---

# Creating a connection to Trino in DataLens On-premises

To create a Trino connection:


1. Go to the [workbook](../../workbooks-collections/index.md) page or create a new one.
1. In the top-right corner, click **Create** → **Connection**.
1. Select the **Trino** connection.



1. Select the **Authentication type**:
    * `Without authentication`
    * `Password`
    * `JWT`
1. <!-- source: en/_includes/datalens/connection-trino-manual.md -->
   Specify the external database credentials for connection over a public network:

   * **Host name**: Specify the Trino coordinator path or IP address.
   * **Port**: Specify the Trino connection port. The default port is 8443.
   * **Username**: Specify a username for the Trino connection. If authentication is off, you can use any username as it will not affect the connection. The field value will be sent to the source with the queries.
   * **Password**: If the `Password` authentication type was selected, specify the password for the user.
   * **JWT**: If the `JWT` authentication type was selected, specify the [JWT](https://en.wikipedia.org/wiki/JSON_Web_Token).

   <!-- source: en/_includes/datalens/datalens-db-connection-sql-level-2.md -->
   * **Raw SQL level**: Enables you to use an ad-hoc SQL query to [generate a dataset](../../dataset/settings.md#sql-request-in-datatset). This option is disabled by default. When enabling it, you will need to select the raw SQL level:

      * **Subqueries only**: Describe dataset sources using [SQL queries](../../dataset/settings.md#sql-request-in-datatset).
      * **SQL to read**: Describe dataset sources using SQL queries, [create QL charts](../../concepts/chart/ql-charts.md), and execute read-only SQL queries.
   <!-- endsource: en/_includes/datalens/datalens-db-connection-sql-level-2.md -->
   <!-- endsource: en/_includes/datalens/connection-trino-manual.md -->
1. <!-- source: en/_includes/datalens/connection-trino-cache.md -->
   Optionally, specify the caching settings:

   * **Cache TTL**: Specify cache TTL in seconds or leave the default value. The recommended value is 300 seconds (5 minutes).
   * **Allow cache verification in datasets**: Specify the maximum cache validation interval in seconds.
   <!-- endsource: en/_includes/datalens/connection-trino-cache.md -->
1. <!-- source: en/_includes/datalens/connection-trino-advanced.md -->
   Optionally, configure **Advanced connection settings**. For more information, see [Additional settings](#additional-settings).
   <!-- endsource: en/_includes/datalens/connection-trino-advanced.md -->
1. Optionally, test the connection by clicking **Check connection**.
1. Click **Create connection**.
1. Enter a name for the connection and click **Create**.



## Additional settings {#additional-settings}

You can specify additional connection settings under **Advanced connection settings**:


<!-- source: en/_includes/datalens/connection-trino-additional-settings.md -->
* **TLS**: If this option is enabled, Trino is accessed via `HTTPS`; if not, `HTTP`.
* **CA Certificate**: To upload a certificate, click **Attach file** and select the certificate file. When the certificate is uploaded, the field shows the file name.
* <!-- source: en/_includes/datalens/operations/datalens-db-connection-export-settings-item.md -->
  **Disable data export**: When this option is on, the data export item will not be available in the <!-- diplodoc:svg ![icon](../../_assets/console-icons/ellipsis.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" clip-rule="evenodd"/></svg> menu for the charts based on this connection. However, you will still be able to copy chart data and take screenshots.
  <!-- endsource: en/_includes/datalens/operations/datalens-db-connection-export-settings-item.md -->
* <!-- source: en/_includes/datalens/operations/datalens-db-connection-table-list-settings-item.md -->
  **Request table list**: Disable this option if loading a table list from the source takes too long or produces errors. Instead, use SQL subqueries to add tables.
  <!-- endsource: en/_includes/datalens/operations/datalens-db-connection-table-list-settings-item.md -->

![image](../../_assets/datalens/operations/connection/connection-trino-yc-manwal-additional.png)
<!-- endsource: en/_includes/datalens/connection-trino-additional-settings.md -->

{% note info %}

So far the [UNNEST](../..//function-ref/UNNEST.md) function has not been implemented for Trino.

{% endnote %}





## Creating a dataset {#create-dataset}

The table search scope when connecting to Trino is limited to a specific folder.

When [creating a dataset](../../dataset/create-dataset.md) based on the Trino connection:

1. In the top-right corner of the connection page, click **Create dataset**.
1. Select the folder in the source. The tables it contains will be shown on the panel below.

   {% cut "Selecting a folder in the source" %}

   ![image](../../_assets/datalens/operations/connection/dataset-trino-catalog.png)

   {% endcut %}

1. Proceed with [this guide](../../dataset/create-dataset.md#add-data) from Step 4.

