Repository navigation
Closed
Labels
Description
Problem
The Trino plugin cannot connect to Presto. databases/trino.mdx says so under Limitations: Presto speaks the same client protocol under an X-Presto- header prefix, and the driver always sends X-Trino-.
Most of the protocol side is already there:
TrinoProtocolHeaders.prestoexists (apple/Packages/TableProCore/Sources/TableProTrinoCore/TrinoProtocolHeaders.swift:11), and every request and response header is built from the chosen prefix.TrinoClientConfigtakes aprotocolHeadersvalue with.trinoas the default (TrinoClientConfig.swift:61).makeClientConfiginapple/Plugins/TrinoDriverPlugin/TrinoPluginDriver.swift:197never passes it, so every connection gets.trino. Nothing in the app refers to.presto.
#1906, which added Trino, left Presto for later because the protocol is close.
Proposed solution
- A Presto connection type served by the Trino plugin, the way the PostgreSQL plugin serves Redshift and CockroachDB through
additionalDatabaseTypeIds(apple/Plugins/PostgreSQLDriverPlugin/PostgreSQLPlugin.swift:44). It builds its client with.presto. A Server dropdown on the Trino form would also work, but a type of its own gives Presto its name in the New Connection picker and apresto://URL scheme next totrino://. - Before shipping, check against a Presto coordinator what differs past the headers:
- Browse paging. The plugin pages with
OFFSET n ROWS FETCH NEXT m ROWS ONLY(apple/Plugins/TrinoDriverPlugin/TrinoPlugin.swift:142). - The introspection queries, in particular
system.metadata.table_commentsandsystem.metadata.materialized_views(TrinoIntrospectionSQL.swift:58and:66). - The
PARAMETRIC_DATETIMEclient capability every request sends (TrinoStatementClient.swift:325). - The type mapper and the EXPLAIN variants.
- Browse paging. The plugin pages with
- A Presto section in the docs in place of the Limitations line.
Done means: a stock Presto coordinator connects, lists catalogs, schemas and tables, runs a query, and cancels one with Cancel Query.
Alternatives considered
None inside TablePro. The Presto CLI or the coordinator's web UI.
Platform
macOS
Related database type
N/A / General
Activity