feat: add native Trino driver
Merged
CE
5mo ago+1109+1109+0123456789012345678901234567890123456789-83-83-01234567890123456789
Summary
- Add a native Trino driver using
trino-client. - Wire Trino into connection normalization, registry loading, dbt profile parsing, Docker discovery, environment discovery, SQL explain, and warehouse add guidance.
- Document Trino configuration, authentication, installation, and support matrix entries.
Details
The previous dbt profile mapping treated trino as PostgreSQL-compatible. This adds a first-class Trino connector instead, with support for:
- HTTP and HTTPS server URLs
- catalog and schema defaults
- Basic authentication
- bearer token authentication
- extra headers, session properties, and extra credentials
- schema/table/column introspection through catalog-scoped
information_schema - SELECT limit injection with truncation detection
Tests
cd packages/drivers && bun test test/trino-unit.test.tscd packages/opencode && bun test test/altimate/driver-normalize.test.ts test/altimate/connections.test.ts test/tool/project-scan.test.ts test/altimate/tools/sql-explain.test.tscd packages/opencode && bun run typecheck
Note: bunx tsc -p packages/drivers/tsconfig.json --noEmit still fails on the existing bun:sqlite type resolution issue in packages/drivers/src/sqlite.ts, unrelated to this Trino change.
Summary by cubic
Adds a native Trino driver and integrates it across discovery, dbt, SQL tools, and docs, expanding support to 13 warehouses. Also standardizes tool error handling and prevents sensitive details from appearing in outputs.
-
New Features
- Native Trino connector using
trino-clientover HTTP/HTTPS with Basic or Bearer auth (mutually exclusive), extra headers/session/extra credentials, catalog/schema defaults; clamps SELECT limits, detects truncation, recognizesFETCH NEXT, and supportsEXPLAIN/EXPLAIN ANALYZE(query history not surfaced). - Integration: config aliases (server →
connection_string, database/dbname →catalog, token →access_token); dbttrinonow maps to the native driver; Docker discovery matches Trino images; env var detection forTRINO_*andDATABASE_URL(trino,trino+http(s),presto); docs updated with a migration note (dbt mapping change anddatabase→catalog,token→access_token) and troubleshooting (catalog required for introspection, auth conflict, protocol/port defaults).
- Native Trino connector using
-
Bug Fixes
- Normalize tool responses for
sql_analyze,schema_inspect,lineage_check, and column lineage with shared helpers: unwrap dispatcher envelopes, treat falsy/object errors via message/detail fields, avoid exposing object details, standardize titles/metadata; treatsuccess=falseas failure with “Analysis failed.”; lineage tools also fail on innerdata.success=false. - Trino driver: clearer error when
trino-clientis present but incompatible; clamps non-numeric/negative limits and detectsFETCH NEXT; falls back to protocol-default port whenportis invalid; throws if both password and access token are set;warehouse.listshows Database fromcatalogfor Trino. - Docs: correct Docker auto‑discovery lists to match actual images (includes Trino; MongoDB not auto‑discovered) and fix minor markdown.
- Normalize tool responses for
Summary by CodeRabbit
-
New Features
- Trino added as a supported warehouse with connectivity, query execution, schema/table inspection, and EXPLAIN support.
-
Documentation
- Guides updated for Trino configuration, auth examples, installation notes, discovery, and support matrix; supported warehouse count updated.
-
Tests
- New and updated tests covering Trino driver behavior, config normalization, discovery, and EXPLAIN semantics.
-
UX
- “Warehouse add” surfaces non-blocking post-connect suggestions after successful adds.