New features:
- Added
WorkloadIdentityHostconfig option (DSN fieldworkloadIdentityHost) that overrides the STS host used by the AWS WIF flows, for endpoints the driver cannot derive from the region (such as an interface VPC endpoint). Must be an STS endpoint for the region the workload runs in (#5).
New features:
- Added
WorkloadIdentityAwsUseOutboundTokenconfig option (DSN fieldworkloadIdentityAwsUseOutboundToken) that produces the AWS WIF attestation as an STSGetWebIdentityTokenJWT instead of the default signedGetCallerIdentityrequest envelope (#1824). - Added
CleanupTimeoutconfig option (DSN fieldcleanupTimeout, in seconds) that bounds post-cancellation cleanup (#1816). - Increased CRL disk cache removal delay to 7 days (#1820).
- Added option to load private key from
connections.tomlfile (#1822). - Added support for Go 1.27, dropped support for Go 1.24 (#1837).
- Added
SNOWFLAKE_MIN_TLS_VERSIONenvironment variable to enforce a minimum TLS version for all connections (#1840).
Security fixes:
- Restricted the WORKLOAD_IDENTITY authenticator to recognized Snowflake hosts (*.snowflakecomputing.com/.cn/.mil), normalizing the host before a suffix-anchored match. The
SNOWFLAKE_WIF_ALLOWED_HOST_SUFFIXESenvironment variable additively extends the recognized-host list (SNOW-3649730). - Azure workload-identity IMDS requests now URL-encode the
workloadIdentityEntraResourceand client-id query parameters, so their values are confined to their own parameter and cannot alter the rest of the query string (SNOW-3649876). - The Azure
IDENTITY_ENDPOINTis now required to be a loopback or link-local address before theIDENTITY_HEADERvalue is attached to the request (SNOW-3649837). - Account-identifier and region values in DSN parameters are now validated as well-formed URL-authority components before they are incorporated into driver-constructed URLs, and OCSP cache-server and retry URLs are built via
net/urlrather than direct string formatting, so neither can embed URL-significant characters that would alter the resulting URL authority (SNOW-3711332). - Improved OCSP response validation to correctly distinguish between transient network failures and definitive certificate status results; definitive results are now always reflected accurately regardless of the
ocspFailOpensetting (SNOW-3649697). - Extended secret masking in debug logs to cover the S3 SSE-C customer-key header and the
X-Amz-Credential/X-Amz-Security-TokenURL query parameters (SNOW-3649835). - HTTP response headers are now logged as header names only, without their values, at every site that previously logged the whole header collection (
restful.go,auth.go,authokta.go,heartbeat.go). Header values carry session tokens, storage credentials and the SSE-C customer key, and formatting anhttp.Headerwith%vproduced a shape the header-specific masking patterns did not match, so the values are omitted rather than masked (SNOW-3649835). - The chunk-header debug line now logs the header name only, not its value (SNOW-3649835).
- The TOML connection-config loader now logs setting names only, not their values, when reporting a parsing error (SNOW-3649818).
- Corrected the SAS-token masking pattern so signed-URL query parameters are fully masked in logs (SNOW-3649773).
- Corrected the connection-token masking pattern to admit
:in the token value, so a Snowflake session token (ver:1-hint:...) is masked; previously the match ended at the first colon and fell below the pattern's minimum length, so the pattern never matched the format it targets (SNOW-3649773).
Bug fixes:
- Fixed token cache key collisions for multi-account (shared IdP) and multi-role scenarios by switching to a versioned, SHA256-hashed canonical-JSON key with the token type in the key prefix, applied uniformly across keyring (macOS/Windows) and file (Linux) backends; also replaced the bag-of-fields spec struct with typed token-spec types (
hostUserTokenSpecfor MFA/ID flows,oauthTokenSpecfor OAuth flows) so each spec validates and serializes only its own fields (#1817, #1821). - Fixed nil pointer dereference panic when a corrupt or malformed OCSP cache key is encountered, either from the remote OCSP cache server or the local cache file (#1819).
- Fixed
WithFileGetStreamreturning corrupt or wrong-file bytes when aGETprefix-matched more than one file; a get-stream can return only one file, so a multi-file match now returns the newErrGetStreamMultipleFiles(pointing to the GETPATTERNargument) instead of a nondeterministic mix (#1809). - Do not attempt to get S3 bucket accelerate config for Snowflake-internal stages (matched by bucket name
sfc-*) since s3:GetAccelerateConfiguration not granted anyways (#1805). - Fixed gosnowflake writing a
gosnowflake-cgodirectory under the system temp dir at package import time even when the driver was never used (e.g. when imported only as a transitive dependency). Minicore now loads lazily when the driver is first referenced (NewConnector/OpenWithConfig) instead of ininit()(#1807). - Fixed
GETfrom a LOCAL_FS stage downloading 0 files and returning264011: not implemented. Cloud downloads were unaffected (#1810). - Fixed
NUMBERcolumns with a non-zero scale losing precision: values needing more significant digits than a binary float's mantissa were silently rounded, soNUMBER(20,10)holding1234567890.1234567890returned1234567890.1234567889. TheWithHigherPrecisionpath is unchanged and still returns a 64-bit*big.Float(#1835). - Fixed proxy configuration for a literal IPv6
ProxyHost, which was concatenated into an unbracketedhost:portand left the proxy URL unparseable (snowflakedb/gosnowflake#TBD). - Fixed the
regionparameter rewriting an explicitly providedhost(e.g.host=myacct.snowflakecomputing.comwithregion=us-east-1becamemyacct.us-east-1.snowflakecomputing.com); an explicit host now takes precedence (#1841).
Internal changes:
- Migrated from deprecated
github.com/aws/aws-sdk-go-v2/feature/s3/manager(v1.16.15) togithub.qkg1.top/aws/aws-sdk-go-v2/feature/s3/transfermanager(v0.3.5). - Introduced
ConversionOptionsfor Arrow batches configuration (#1832). - Updated AWS SDK dependencies:
github.com/aws/aws-sdk-go-v2: v1.38.1 → v1.43.0github.qkg1.top/aws/aws-sdk-go-v2/config: v1.27.11 → v1.32.31github.qkg1.top/aws/aws-sdk-go-v2/credentials: v1.17.11 → v1.19.30github.qkg1.top/aws/aws-sdk-go-v2/feature/ec2/imds: v1.16.1 → v1.18.31github.qkg1.top/aws/aws-sdk-go-v2/service/s3: v1.53.1 → v1.106.0github.qkg1.top/aws/aws-sdk-go-v2/service/sts: v1.28.6 → v1.45.0github.qkg1.top/aws/smithy-go: v1.22.5 → v1.27.4
- Adopted Go 1.25 idioms now that the minimum supported version is 1.25:
sync.WaitGroup.Gofor driver-managed goroutines, and themin/maxbuiltins in place of the hand-rolledintMin/intMax/int64Max/durationMin/durationMaxhelpers. - Enabled the
modernize,nosprintfhostport,perfsprintandusetestinglinters and the Go 1.25hostport/waitgroupgo vetanalyzers; bumped golangci-lint to v2.13. - Fixed the
fakeResponseBodytest double reporting more bytes read than fit in the caller's buffer, which panicked the Go 1.27encoding/jsondecoder.
New features:
- Added
SF_DISABLE_OCSP_CHECKSenvironment variable as an additional option to override OCSP checks' default behaviour besides the existingDisableOCSPChecksconfig. (#1798).- Note: the env var is explicitly refused when OCSP fail-closed mode is active.
- Added
ArrowStreamBatch.Reset()method that closes any existing stream and clears the cached reader, allowing callers to retryGetStreamafter a mid-stream failure (e.g. TCP RST) without re-executing the entire query. Inline (RowSetBase64) batches are restored from cached bytes on reset. - Added one in-band telemetry record per successful login describing which connection-identifier fields the user supplied (
account_provided,account_with_region,account_org_provided,region_provided,host_provided). No hostname or account value is included. This is gated by the existing server-sideCLIENT_TELEMETRY_ENABLEDparameter and can additionally be disabled locally by settingSF_TELEMETRY_DISABLE_CONNECTION_SHAPE=true. The telemetry collection is time-boxed and will be removed in a future release.
Bug fixes:
- Fixed stale OCSP cache
.lckdirectory permanently blocking cache writes (and forcing an online OCSP validation if OCSP is enabled, as is by default) by usingos.RemoveAllinstead ofos.Removefor stale lock recovery (#1793). - Fixed regular chunk downloader reads so canceling the query context now interrupts stalled chunk downloads and wakes waiting row readers instead of hanging on the HTTP body read (#1789).
- Fixed
QueryArrowStreamchunk reads so canceling the query context now interrupts stalled Arrow stream downloads and reports the cancellation instead of hanging on the HTTP body read (#1789). - Fixed
baseNamesilently dropping files whose name ends with a dot (e.g.myfile.txt.), which caused PUT uploads to discard such files without error (#1788). - Improved error message when
Hostis incorrectly configured with a URL scheme (e.g.https://myorg-myaccount.snowflakecomputing.com), previously this produced a cryptic260004: failed to parse a port numbererror (#1784). - Fixed minicore build on OpenBSD by skipping the
-ldllinker flag, since libdl is not a separate library on OpenBSD (dlopen/dlsymare provided by libc) (#1791).
Internal changes:
- Introduced
SKIP_FILE_PERMISSIONS_VERIFICATIONenvironment variable to allow bypassing file permissions checks forconnections.tomland the credential cache, which is useful for environments where strict permissions cannot be set (#1780). - Added support for
SPCS_TOKENin the login request. When the driver detects it is running inside a Snowpark Container Services workload (via theSNOWFLAKE_RUNNING_INSIDE_SPCSenvironment variable), it reads an opaque service token from/snowflake/session/spcs_tokenon every login and attaches it to the login-request payload asSPCS_TOKEN. Read failures are logged at warn and do not affect login (#1783). - Minicore binaries for Windows and Mac are now signed - content is the same. (#1790).
New features:
- Added
QueryResultFormatProviderinterface to expose the server-reported query result format ("arrow" or "json") fromQueryArrowStream, enabling callers to distinguish Arrow IPC from JSON responses before interpreting batch streams (#1773).
Bug fixes:
- Fixed empty
Accountwhen connecting with programmaticConfiganddatabase/sql.Connectorby derivingAccountfrom the first DNS label ofHostinFillMissingConfigParameterswhenHostmatches the Snowflake hostname pattern (#1772). - Fixed PAT (Programmatic Access Token)
authenticatorto actually require the Token or TokenFilePath field, instead of silently accepting Password which was never forwarded (#1772). - Fix logger reporting incorrect source location when called without
WithContext(#1768). - GCP WIF attestation now uses hostname
metadata.google.internalinstead of the IPv4 link-local address, so it works on IPv6-only GCP VMs (#1775). - Fixed query failures on large inline results (e.g. 64MB LOB) caused by truncated HTTP response bodies. The driver now retries the query when
json.Decoderreturnsio.ErrUnexpectedEOF, reusing the same request ID so Snowflake returns the cached result (#1777).
Bug fixes:
- Fixed default
CrlDownloadMaxSizeto be 20MB instead of 200MB, as the previous value was set too high and could cause out-of-memory issues (#1735). - Replaced global
paramsMutexwith per-connectionsyncParamsto encapsulate parameter synchronization and avoid cross-connection contention (snowflakedb/gosnoflake#1747). Config.Paramsmap is not modified anymore, to avoid changing parameter values across connections of the same connection pool (#1747).- Set
BlobContentMD5on Azure uploads so that multi-part uploads have the blob content-MD5 property populated (#1757). - Fixed 403 errors from Google/GCP/GCS PUT queries on versioned stages (#1760).
- Fixed not updating query context cache for failed queries (#1763).
Internal changes:
- Moved configuration to a dedicated internal package (#1720).
- Modernized Go syntax idioms throughout the codebase.
- Added libc family, version and dynamic linking marker to client environment telemetry (#1750).
- Bumped a few libraries to fix vulnerabilities (#1751, #1756).
- Depointerised query context cache in
snowflakeConn(#1763).
Breaking changes:
- Removed
RaisePutGetErrorfromSnowflakeFileTransferOptions- current behaviour is aligned to always raise errors for PUT/GET operations (#1690). - Removed
GetFileToStreamfromSnowflakeFileTransferOptions- usingWithFileGetStreamautomatically enables file streaming for GETs (#1690). - Renamed
WithFileStreamtoWithFilePutStreamfor consistency (#1690). Arrayfunction now returns error for unsupported types (#1693).WithMultiStatementdoes not return error anymore (#1693).WithOriginalTimestampis removed, useWithArrowBatchesTimestampOption(UseOriginalTimestamp)instead (#1693).WithMapValuesNullableandWithArrayValuesNullablecombined into one optionWithEmbeddedValuesNullable(#1693).- Hid streaming chunk downloader. It will be removed completely in the future (#1696).
- Maximum number of chunk download goroutines is now configured with
CLIENT_PREFETCH_THREADSsession parameter (#1696) and default to 4. - Fixed typo in
GOSNOWFLAKE_SKIP_REGISTRATIONenv variable (#1696). - Removed
ClientIPfield fromConfigstruct. This field was never used and is not needed for any functionality (#1692). - Unexported MfaToken and IdToken (#1692).
- Removed
InsecureModefield fromConfigstruct. UseDisableOCSPChecksinstead (#1692). - Renamed
KeepSessionAlivefield inConfigstruct toServerSessionKeepAliveto adjust with the remaining drivers (#1692). - Removed
DisableTelemetryfield fromConfigstruct. UseCLIENT_TELEMETRY_ENABLEDsession parameter instead (#1692). - Removed stream chunk downloader. Use a regular, default downloader instead. (#1702).
- Removed
SnowflakeTransport. UseConfig.Transporteror simply register your own TLS config withRegisterTLSConfigif you just need a custom root certificates set (#1703). - Arrow batches changes (#1706):
- Arrow batches have been extracted to a separate package. It should significantly drop the compilation size for those who don't need arrow batches (~34MB -> ~18MB).
- Removed
GetArrowBatchesfromSnowflakeRowsandSnowflakeResult. Usearrowbatches.GetArrowBatches(rows.(SnowflakeRows))instead. - Migrated functions:
sf.WithArrowBatchesTimestampOption->arrowbatches.WithTimstampOptionsf.WithArrowBatchesUtf8Validation->arrowbatches.WithUtf8Validationsf.ArrowSnowflakeTimestampToTime->arrowbatches.ArrowSnowflakeTimestampToTime
- Logging changes (#1710):
- Removed Logrus logger and migrated to slog.
- Simplified
SFLoggerinterface. - Added
SFSlogLoggerinterface for setting custom slog handler.
Bug fixes:
- The query
context.Contextis now propagated to cloud storage operations for PUT and GET queries, allowing for better cancellation handling (#1690).
New features:
- Added support for Go 1.26, dropped support for Go 1.23 (#1707).
- Added support for FIPS-only mode (#1496).
Bug fixes:
- Added panic recovery block for stage file uploads and downloads operation (#1687).
- Fixed WIF metadata request from Azure container, manifested with HTTP 400 error (#1701).
- Fixed SAML authentication port validation bypass in
isPrefixEqualwhere the second URL's port was never checked (#1712). - Fixed a race condition in OCSP cache clearer (#1704).
- The query
context.Contextis now propagated to cloud storage operations for PUT and GET queries, allowing for better cancellation handling (#1690). - Fixed
tokenFilePathDSN parameter triggering false validation error claiming bothtokenandtokenFilePathwere specified when onlytokenFilePathwas provided in the DSN string (#1715). - Fixed minicore crash (SIGFPE) on fully statically linked Linux binaries by detecting static linking via ELF PT_INTERP inspection and skipping
dlopengracefully (#1721).
Internal changes:
- Moved configuration to a dedicated internal package (#1720).
New features:
- Added ability to disable minicore loading at compile time (#1679).
- Exposed
tokenFilePathinConfig(#1666). tokenFilePathis now read for every new connection (#1666).- Added support for identity impersonation when using workload identity federation (#1652, #1660).
Bug fixes:
- Fixed getting file from an unencrypted stage (#1672).
- Fixed minicore file name gathering in client environment (#1661).
- Fixed file descriptor leaks in cloud storage calls (#1682)
- Fixed path escaping for GCS urls (#1678).
Internal changes:
- Improved Linux telemetry gathering (#1677).
- Improved some logs returned from cloud storage clients (#1665).
Bug fixes:
- Handle HTTP307 & 308 in drivers to achieve better resiliency to backend errors (#1616).
- Create temp directory only if needed during file transfer (#1647)
- Fix unnecessary user expansion for file paths (#1646).
Internal changes:
- Remove spammy "telemetry disabled" log messages (#1638).
- Introduced shared library (source code) for extended telemetry to identify and prepare testing platform for native rust extensions (#1629)
New features:
- Added validation of CRL
NextUpdatefor freshly downloaded CRLs (#1617) - Exposed function to send arbitrary telemetry data (#1627)
- Added logging of query text and parameters (#1625)
Bug fixes:
- Fixed a data race error in tests caused by platform_detection init() function (#1618)
- Make secrets detector initialization thread safe and more maintainable (#1621)
Internal changes:
- Added ISA to login request telemetry (#1620)
- Fix unsafe reflection of nil pointer on DECFLOAT func in bind uploader (#1604).
- Added temporary download files cleanup (#1577)
- Marked fields as deprecated (#1556)
- Exposed
QueryStatusfromSnowflakeResultandSnowflakeRowsinGetStatus()function (#1556) - Split timeout settings into separate groups based on target service types (#1531)
- Added small clarification in oauth.go example on token escaping (#1574)
- Ensured proper permissions for CRL cache directory (#1588)
- Added
CrlDownloadMaxSizeto limit the size of CRL downloads (#1588) - Added platform telemetry to login requests. Can be disabled with
SNOWFLAKE_DISABLE_PLATFORM_DETECTIONenvironment variable (#1601) - Bypassed proxy settings for WIF metadata requests (#1593)
- Fixed a bug where GCP PUT/GET operations would fail when the connection context was cancelled (#1584)
- Fixed nil pointer dereference while calling long-running queries (#1592) (#1596)
- Moved keyring-based secure storage manager into separate file to avoid the need to initialize keyring on Linux. (#1595)
- Enabling official support for RHEL9 by testing and enabling CI/CD checks for Rocky Linux in CICD, (#1597)
- Improve logging (#1570)
- Added ability to configure OCSP per connection (#1528)
- Added
DECFLOATsupport, see details indoc.go(#1504, #1506) - Added support for Go 1.25, dropped support for Go 1.22 (#1544)
- Added proxy options to connection parameters (#1511)
- Added
client_session_keep_alive_heartbeat_frequencyconnection param (#1576) - Added support for multi-part downloads for S3, Azure and GCP (#1549)
- Added
singleAuthenticationPromptto control whether only one authentication should be performed at the same time for authentications that need human interactions (like MFA or OAuth authorization code). Default is true. (#1561) - Fixed missing
DisableTelemetryoption in connection parameters (#1520) - Fixed multistatements in large result sets (#1539, #1543, #1547)
- Fixed unnecessary retries when context is cancelled (#1540)
- Fixed regression in TOML connection file (#1530)
Release notes available at https://docs.snowflake.com/en/release-notes/clients-drivers/golang