Repository navigation
v0.10.0
This release adds the driver avatica, for Apache Calcite Avatica and the Apache Phoenix Query Server. The drivers libsql and databend each get one fix in how a transaction ends.
New
- Avatica. The package
avaticaruns SQL on the standalone server of Avatica and on the Phoenix Query Server, over the JSON protocol of Avatica. It was measured on Avatica 1.28.0 and 1.29.0, which run HSQLDB, and on Phoenix 2.0-5.0. The driver speaks JSON only (D153). Apache Druid will get a driver of its own (D154). - DSN. The DSN is
avatica://user:password@host:port, with the default port 8765, no path, and the keystlsandauth(D156). The user and the password go in the info ofopenConnection.auth=basicalso sends them by HTTP basic authentication. - Reading. One connection of
database/sqlis one connection of Avatica, withautoCommiton. A query reads its rows in frames, one token at a time, and fetches each next frame.WithFrameSizesets the size of a frame, 1000 rows by default. An error in a later frame wrapsdbimp.ErrIncomplete(D157). - Types. A value has the Go type of the name of its type of JDBC:
int64,*apd.Decimalwith every digit,float64,bool,string,[]byte,dbimp.Date,dbimp.LocalTime,dbimp.LocalDateTime,dbimp.Interval,[]anyanduuid.UUID(D155). - Arguments. A statement with arguments goes as
prepareandexecute, with a typed value for each argument. The driver refuses a count of arguments that is not the count of the parameters, because the server binds a missing one as NULL. A decimal goes as text. Each character outside ASCII goes as an escape of JSON, because the Phoenix Query Server misreads raw UTF-8 (D158). - Transactions.
BeginTxturnsautoCommitoff, and sendsReadOnlyand the isolation level. The end of a transaction setsautoCommit,readOnlyand the isolation level back (D159).
What a caller must know
- Nothing stops a statement on the server. When the context of a query ends, the driver stops the read and closes the statement, but the server runs the statement to its end (D159).
WithTimeoutabove zero fails withdbimp.ErrNotSupported. LastInsertIdfails withdbimp.ErrNotSupported, because Avatica gives no id.- A
DATEbefore 1582-10-15 arrives in the Julian calendar of Java, and the driver reads it in the Gregorian calendar. The driver binds no array and no interval (D160). - The server cannot write
TIMESTAMP WITH TIME ZONE,TIME WITH TIME ZONE,CLOBorBLOBin JSON, and fails the whole answer for them. - Phoenix writes with
UPSERT, and refusesINSERTandUPDATE. It stores an empty string as NULL, and reads a NULL in aBINARYcolumn as zero bytes.
Fixes
- libSQL. When the context of a transaction ended,
database/sqlrolled it back, but the context stopped theROLLBACKbefore it reached the server. The server then held the transaction and the write lock of SQLite until the stream expired after 10 seconds. TheROLLBACKnow reaches the server (D150). - Databend. The
Commitof a failed transaction sent itsROLLBACKwith no time limit, so a server that did not answer could blockCommit. TheROLLBACKnow has a limit of 5 seconds, and its error joins the error ofCommit(D122).
Other changes
- The workflow also tests each product whose release the manifest of a driver recorded, so Phoenix runs the tests of
avatica(D161). - The workflow pins dbmeta at
585a1f8, which starts the Avatica and Phoenix servers with JSON. - The record command can capture a number or an object, and writes each password in a body as
REDACTED.