> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-feat-721-compare-sync.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trino

> Connect to a Trino cluster with TablePro's native Swift driver.

TablePro connects to Trino with a driver written in native Swift. It speaks the Trino client REST protocol directly over HTTP, so there is no JDBC jar or CLI to install. Queries run over `POST /v1/statement` and TablePro pages through the results until the cluster is done.

Presto uses the same protocol under a different header prefix. The current driver targets Trino.

## Install the plugin

Trino is a registry driver. Pick Trino in the database type chooser and TablePro offers to download it, or install it up front from **Settings > Plugins > Browse > Trino Driver**. The driver loads without restarting the app.

## Connection settings

| Field        | Description                                                                                                                                                                                                                                                                                                                                              |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Host         | The Trino coordinator hostname.                                                                                                                                                                                                                                                                                                                          |
| Port         | The coordinator HTTP port. Default `8080`. Set `8443` when the coordinator serves HTTPS.                                                                                                                                                                                                                                                                 |
| Username     | The user the query runs as. Sent as `X-Trino-User`.                                                                                                                                                                                                                                                                                                      |
| Catalog      | The default catalog for unqualified table names. Optional; leave blank to browse all catalogs.                                                                                                                                                                                                                                                           |
| Schema       | The default schema. Optional.                                                                                                                                                                                                                                                                                                                            |
| Auth Method  | Authentication pane. `Username & Password` for LDAP or password-file auth, or `JWT Access Token` for a bearer token.                                                                                                                                                                                                                                     |
| Password     | Your password when the auth method is Username & Password. Sent as HTTP Basic auth.                                                                                                                                                                                                                                                                      |
| Access Token | Authentication pane. Your JWT when the auth method is JWT Access Token. Sent as a bearer token.                                                                                                                                                                                                                                                          |
| SSL          | Off by default. The SSL pane sets the mode: Preferred and Required both encrypt without checking the certificate, Verify CA checks the certificate chain, and Verify Identity also checks the hostname. This driver has no plaintext fallback, so any mode other than Off forces TLS. Point CA Certificate at your CA file to trust a private authority. |
| Time Zone    | Advanced pane. Optional IANA time zone (for example `America/New_York`) for the session. Leave blank to use the server default.                                                                                                                                                                                                                          |

Trino requires TLS for any authentication. If you pick Password or JWT, set an SSL mode so the coordinator accepts the credentials.

## Catalogs, schemas, and tables

A Trino connection is scoped to a catalog and schema, but every query can name objects in full as `catalog.schema.table`. TablePro shows catalogs from `SHOW CATALOGS`, schemas from `SHOW SCHEMAS`, and tables and columns from each catalog's `information_schema`. Materialized views appear alongside tables and views. Expand a catalog to see its schemas, then a schema to see its tables. Table row counts come from `SHOW STATS`, and table and column comments come from `information_schema` and the `system.metadata` tables.

Identifiers are quoted with double quotes. Results page with `OFFSET n ROWS FETCH NEXT m ROWS ONLY`, the order Trino's grammar requires.

## Types

Trino's type system maps to TablePro's grid as follows:

* Numbers keep full precision. `bigint` and `decimal` are read as exact text, not floating point.
* `varbinary` is shown as hex.
* `array`, `map`, and `row` are shown as JSON.
* `json` opens in the JSON viewer.
* `timestamp`, `time`, and their `with time zone` forms keep the value the server returned.

## Editing rows and schema

Edit cells in the data grid and TablePro writes `INSERT`, `UPDATE`, and `DELETE` back. Trino's `information_schema` reports no primary keys, so the WHERE clause matches on every column of the row as it was read. A row that is not unique across all its columns matches more than one row. Values are written with their Trino type, so a `varchar` holding digits stays quoted and a number stays unquoted. Columns whose type cannot be compared with `=`, such as `array`, `map`, and `row`, are left out of the WHERE clause.

The Structure tab creates tables and adds, drops, renames, and retypes columns. Statements run in autocommit, matching how most Trino connectors handle DDL.

Whether a write succeeds depends on the connected catalog. Many connectors are read-only or support only part of SQL, so a valid statement can still return `NOT_SUPPORTED` from the connector. Changing a column's type in particular is only supported by a few connectors.

Trino connections export but do not import. See [Import and Export](/features/import-export).

## EXPLAIN variants

Click the Explain dropdown in the query editor to choose:

| Variant                   | Statement                                                                 |
| ------------------------- | ------------------------------------------------------------------------- |
| **Explain (Logical)**     | `EXPLAIN`, the logical plan                                               |
| **Explain (Distributed)** | `EXPLAIN (TYPE DISTRIBUTED)`, the plan split into stages                  |
| **Explain (IO)**          | `EXPLAIN (TYPE IO)`, the tables and columns the query reads               |
| **Explain (Validate)**    | `EXPLAIN (TYPE VALIDATE)`, parses and validates without running the query |
| **Explain Analyze**       | `EXPLAIN ANALYZE`, runs the query and reports actual timings              |

## Authentication

* **Username & Password** sends HTTP Basic auth. Use it for LDAP or password-file authentication. Requires TLS.
* **JWT Access Token** sends the token as a bearer credential. Requires TLS.
* **Client certificate** works with any TLS mode (Preferred, Required, Verify CA, or Verify Identity). Set the Client Certificate and Client Key files in the SSL pane and TablePro presents them for mutual TLS. With SSL off the connection is plain HTTP and no certificate is sent.

## Troubleshooting

* **Cannot reach the coordinator.** Confirm the host and that the coordinator port is open. Trino serves HTTP on `8080` and HTTPS on `8443` by default.
* **Authentication failed.** Password and JWT auth need TLS. Turn SSL on and confirm the credentials.
* **A write fails with NOT\_SUPPORTED.** The connected catalog's connector does not support that operation. Check the connector's documentation for what it allows.

## Limitations

* No primary keys, indexes, or foreign keys. Trino's `information_schema` does not report them, so the Structure tab's Indexes view is always empty and row edits key on every column.
* Import is not available. Export works.
* Kerberos and OAuth 2.0 authentication are not supported.
* Write support depends on the catalog's connector, not on TablePro.
