Releases: prestodb/presto-go-client
v2.1.1
What's Changed
Refactoring
- Replace
initialized atomic.Bool+client *Clientwithatomic.Pointer[Client]in connector, eliminating redundant state - Remove unreachable
*net.OpErrorfallback inisRetryableNetError - Simplify
PrepareForInsertto collect and sort once - Improve error messages for duration and SI size types (include
got %T) - Use
strings.IndexByteinstead ofbytes.IndexByte([]byte(...))to avoid allocation
Dependencies
go-colorablev0.1.13 → v0.1.14golang.org/x/sysv0.35.0 → v0.42.0golang.org/x/cryptov0.45.0 → v0.49.0golang.org/x/netv0.47.0 → v0.52.0golang.org/x/oauth2v0.27.0 → v0.36.0
Full Changelog: v2.1.0...v2.1.1
v2.1.0
What's Changed
Breaking Changes
query_jsonpackage renamed toqueryjson— update import paths fromgithub.com/prestodb/presto-go-client/v2/query_jsontogithub.com/prestodb/presto-go-client/v2/queryjson
Features
- Handle
X-Presto-Set-SessionandX-Presto-Clear-Sessionresponse headers
Bug Fixes
- Fix race condition on
MockPrestoServer.defaultLatency(converted toatomic.Int64) - Fix
PrepareForInserterror-path idempotency (deferred nil-out pattern) - Make
Session.PrepareForInsertoutput deterministic (sorted keys) - Fix drain processing for initial query batch
- Eliminate nested lock ordering between session mu and clientMu
- Replace
sync.Oncewith retryable init for connector, fix interval parsing - Add nil receiver guard to
Session.PrepareForInsert - Improve error messages for duration and SI size types (include
got %T) - Use
strings.IndexByteinstead ofbytes.IndexByte([]byte(...))to avoid allocation - Remove unreachable
*net.OpErrorfallback inisRetryableNetError
Refactoring
- Replace
initialized atomic.Bool+client *Clientwithatomic.Pointer[Client]in connector - Simplify
PrepareForInsertto collect and sort once
Testing & Documentation
- Coverage increased from 80% to 87.7%
- Added
UpdateCountfield toMockQueryTemplate - Added tests for deprecated driver paths (
Stmt.Exec,Stmt.Query,Conn.Begin) - Added tests for
Source,Open,Driver(),WithHTTPClient - Documented
isRetryableNetErrornetwork timeout retry behavior - Improved
ensureClientdouble-checked locking comment with Go memory model citation
v2.0.1
Fix concurrency, error handling, and correctness issues identified during code review.
v2.0.0
presto-go-client v2.0.0
A complete rewrite of the Presto Go client library, implementing RFC-0022. This release replaces the legacy v1 client with a modern, modular architecture built on current Go best practices.
Highlights
- Low-level REST API client — direct access to
/v1/statement,/v1/query/{queryId},/v1/queryState/{queryId}, and/v1/clusterendpoints database/sqldriver — standard Go database API with full DSN parsing, parameter interpolation, and transaction support (all four Presto isolation levels + read-only mode)- Trino compatibility — automatic header translation when using the
trino://DSN scheme - Session management — isolated, cloneable, thread-safe sessions with fluent configuration API
- Batch result streaming — memory-efficient
DrainAPI - Query info/stats parsing — the
query_jsonsubpackage provides structured Go types for complete Presto query information, including derived metrics and flattened stage hierarchies
Authentication
Authentication is fully modular — opt-in via separate Go modules to avoid dependency bloat:
- Kerberos/SPNEGO (
prestoauth/kerberos) — keytab-based authentication via gokrb5 - OAuth2/JWT (
prestoauth/oauth2) — static bearer tokens or client credentials flow with automatic token refresh
TLS
Full TLS configuration support including custom CA certificates, mutual TLS (client cert + key), and skip-verify mode. HTTPS is automatically enabled when any ssl_* DSN parameter is set.
Type System
Generic complex type scanners eliminate the need for dozens of explicit scanner types:
NullSlice[T]forARRAYcolumnsNullMap[K, V]forMAPcolumnsNullRow[T]forROWcolumns (struct scanning)INTERVAL DAY TO SECONDparses directly totime.Duration
Testing
prestotestpackage providesMockPrestoServer— a stdlib-only mock for hermetic unit testing without a real Presto cluster- CI enforces 80% coverage, race detection, static analysis, and vulnerability scanning
Other Improvements over v1
- Automatic retry with exponential backoff on 503 and transient network errors
- Request body buffering for safe retry replay
- Proper HTTP response body cleanup (no resource leaks)
- Thread-safe header mutations
- Gzip request/response compression
- Pre-minted query ID support
Installation
go get github.com/prestodb/presto-go-client/v2Optional authentication modules:
go get github.com/prestodb/presto-go-client/v2/prestoauth/kerberos
go get github.com/prestodb/presto-go-client/v2/prestoauth/oauth2Migration from v1
The v2 client uses a new module path (github.com/prestodb/presto-go-client/v2). The v1 client remains available at the v1.0.0 release.
v1.0.0
Final release of the v1 presto-go-client. For the v2 rewrite, see the main branch.