Skip to content

v0.14.0

Choose a tag to compare

@kenshaw kenshaw released this 07 Oct 10:01
· 33 commits to main since this release

This release adds five drivers: drill, solr, elasticsearch, opensearch and dynamodb. No other driver changes for a caller.

New

  • Apache Drill. The package drill runs SQL on a Drillbit through its REST interface, measured on Drill 1.21.2 and 1.22.0. The DSN is drill://user:password@host:8047 with no path and the keys tls, schema and autolimit. The driver keeps the session cookie of the server, so the settings autoLimit, defaultSchema and options stay in the session of a connection. A writing statement goes through CREATE TABLE AS (D165 and D178).
  • Apache Solr. The package solr runs SQL through the /sql handler, measured on Solr 9.9.0, 9.10.1 and 10.0.0. The DSN is solr://user:password@host:8983/<collection> with the keys tls and mode. The path is optional, and a statement with no path needs WithDatabase. The driver reads the class of a field from the luke handler, so a boolean, a binary and a UUID have the types bool, []byte and uuid.UUID (D166 and D178).
  • Elasticsearch. The package elasticsearch runs SQL through _sql, measured on 8.19.22, 9.4.6 and 9.5.3. The DSN is elasticsearch://user:password@host:9200 with no path and the keys tls, auth, fetch_size, time_zone, field_multi_value_leniency and catalog. The driver reads each page one token at a time and closes the cursor when the caller closes the rows early (D167 and D178).
  • OpenSearch. The package opensearch runs SQL through the SQL plugin, measured on 2.19.6 and 3.9.0. The DSN is opensearch://user:password@host:9200 with no path and the keys tls and fetch_size. The driver sends a page size to each plain SELECT, and it returns the HTTP 403 that the ordinary user of 2.19.6 gets when that opens a cursor (D168 and D178).
  • Amazon DynamoDB. The package dynamodb runs PartiQL, measured on DynamoDB Local 3.2.0 and 3.3.1. The DSN is dynamodb://key:secret@host:port?region=r with the keys tls, region and token. The driver signs each request with AWS Signature Version 4, and token sends the session token of temporary credentials. dynamodb.Set binds a set. The service of AWS is not tested, only DynamoDB Local (D169 and D178).

What a caller must know

  • A statement that changes rows gives no count on ClickHouse, Drill (except CREATE TABLE AS), DynamoDB, Elasticsearch, OpenSearch and Solr. RowsAffected then returns an error that wraps dbimp.ErrNotSupported, and the driver returns a count whenever the server sends one (D178).
  • Elasticsearch, OpenSearch and DynamoDB store a context in their rows, for the request of the next page. Hard rule 4 of AGENTS.md names them.
  • The driver of Drill keeps settings of a statement in the session. A later statement on the same connection can still have an autoLimit that an earlier one set, and rows can be lost with no sign. ALTER SESSION RESET ALL clears it.
  • An OpenSearch result that has no page size is cut at 10000 rows with no sign. The ordinary user of 2.19.6 reaches that when it sets WithParameter("fetch_size", 0).
  • A float of Elasticsearch is read as a float64, and a day-time interval of more than about 292 years fails the row.

Other changes

  • The signer of AWS Signature Version 4 is in the root package as dbimp.SignV4, and the recorder uses it too.
  • Alternator of ScyllaDB is not part of the DynamoDB driver (D163).
  • The dbmeta pin of the workflow is the release v0.3.0.
  • The type matrix of docs/TYPES.md has a column for each new driver.

Tests

CI passed all 42 jobs on the tagged commit. Three earlier runs of almost the same code failed one or two jobs, because two tests were not deterministic. The Solr test wrote its schema commands in a random order, because encoding/json/v2 writes the keys of a map in any order. The OpenSearch test read the count of points in time before the server dropped the last one. Both tests are fixed, and the OpenSearch cause is a best guess that no run reproduced.