Repository navigation
v0.16.0
This release adds the driver snowflake, for Snowflake. No other driver changes for a caller.
New
- Snowflake. The package
snowflakeruns SQL on Snowflake through its SQL REST API,/api/v2/statements, which is HTTPS and JSON. It does not use the private protocol ofgosnowflakeand needs no Arrow. The DSN issnowflake://user:key@<org>-<account>.snowflakecomputing.com/database/schema, with the keysrole,warehouse,timeout(a duration, such as60s) andtimezone. The password is the private key of the user, as base64url text of the PKCS8 DER bytes (D183). - Login. The login is a key-pair JWT only. The driver signs it with RS256 and signs a new one before the old one expires. Other kinds of token are not part of this release.
- Statements. The driver starts each statement with
?async=trueand polls until it ends, so that it always holds the handle. When the context ends, and when the caller closes the rows early, it sendsPOST /cancelfor the statement. - Results. The first partition is in the answer, and each later one is fetched with
GETin order, one at a time. The server runs the whole statement first, so an error always comes before any row.RowsAffectedis read from the row of the answer, and fromstatswhen the row has none. - Types. A
fixedof scale 0 and precision 18 or less is anint64, and any other is an*apd.Decimal. Arealis afloat64. Adateis adbimp.Date, atimeis adbimp.LocalTime, atimestamp_ntzis adbimp.LocalDateTime, and the other two timestamps are atime.Time. Avariantis the decoded JSON value, anobjectis amap[string]any, anarrayis a[]any, a geography and a geometry are themap[string]anyof their GeoJSON, and avectoris adbimp.Vector[float64]. - Parameters. Each argument is a typed binding of the server, chosen from its Go type.
Infinityand-Infinitybind as the server takes them. Amapor a list is refused, becauseVARIANTis not a type of a binding.
What a caller must know
BeginTxfails withdbimp.ErrNotSupported, because the server refusesBEGINalone and each request is its own session. A request of several statements is refused for now.- A
timestamp_ltzvalue has the location of the keytimezone, ortime.Localwhen none is named. Usetimezone=UTCon a server. - A statement that fails while it runs has no SQLSTATE. The error names the code, the message and the handle.
- A
TIMESTAMP_TZbinding does not convert by itself into aTIMESTAMP_LTZcolumn in a list of values, so a statement casts it. WithParameterrefuses the nine output-format parameters, because they change the text of a value.- A
TRUNCATEof an empty table gives no count, soRowsAffectedreturns an error that wrapsdbimp.ErrNotSupported.
Other changes
- The recorder
dbimptest/cmd/recordsends the same credentials on a followed page as on the first request: basic, Bearer or Signature Version 4. - The workflow leaves a hosted service out of its job list, because
dbrundoes not start it. - Hard rule 4 names the rows of a Snowflake query. The sibling repository
xo/cqlis nowxo/cassandrain the documents.
Tests
CI passed all 42 jobs on the tagged commit. The jobs of Snowflake replay the 158 recorded exchanges and use fake servers, because the account is a hosted trial. The integration tests ran by hand against the live trial account on 2026-10-10 and passed: all nine tests, 47 subtests, with the round trip of every type. They read SNOWFLAKE_DSN and skip when it is empty. VoltDB gets no driver here (D180).