This article covers:
To make a connection to Trino or Presto, navigate to the Connections page, select New Connection, then select Trino or Presto from the New Connection modal. You'll be asked to provide a host, port, username and password:
https:// in front of the host URL!X-Trino-Catalog header in calls.X-Trino-User header in calls to Trino or Presto.Authorization header in calls to Trino or Presto.Please refer to the examples in our developer documentation to find out how to create a connection to Trino or Presto via our API.
Notes:
/v1/status HTTP endpoint which is used for verifying the cluster is reachable to Luzmo.Once you have connected your Trino/Presto you can add datasets as explained here.
{{metadata.< parameter name >|< default value >}}. Find out more about parameterized SQL Datasets.Also make sure to check out this article on Preparing your data for analytics.
To find out how to add datasets using our API, please refer to the examples in our developer documentation for Trino or Presto.
When generating an Authorization token to grant a user acces to your embedded dashboards it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.
The fields available for overriding a Trino/Presto connection are as follows:
Our developer documentation has more info about connection overrides and an example of a Trino connection override or Presto connection override.
Example code demonstrating how to override a Trino/Presto connection:
import Luzmo from '@luzmo/nodejs-sdk';
const client = new Luzmo({
api_key: '<your Luzmo API key>',
api_token: '<your Luzmo API token>',
host: 'https: //api.luzmo.com:443'
});
const response = await client.create('authorization',
{
type: "embed",
username: "< A unique and immutable identifier for your user >",
name: "< user name >",
email: "< user email >",
suborganization: "< a suborganization name >",
access: {
collections: [
{
id: "<collection_id>",
inheritRights: "use"
}
]
},
account_overrides: {
<account_id>: {
host: "<new_https_endpoint>",
port: "<new_https_port>",
database: "<new_collection>",
user: "<new_username>",
password: "<new_password>",
datasets: {
<dataset_id>: {
table: "<new_table_or_view>",
sql: "<new_sql_for_sql_dataset>"
}
}
}
);
| Data Type in Trino | Data Type in Luzmo |
|---|---|
| boolean | hierarchy |
| tinyint | numeric |
| smallint | numeric |
| integer | numeric |
| int | numeric |
| bigint | numeric |
| real | numeric |
| double | numeric |
| decimal | numeric |
| varchar | hierarchy |
| char | hierarchy |
| varbinary | hierarchy |
| json | hierarchy |
| date | datetime |
| time without time zone | datetime |
| time with time zone | datetime |
| timestamp without time zone | datetime |
| timestamp with time zone | datetime |
| ipaddress | hierarchy |
| uuid | hierarchy |