commit | 7a35be7713b740eb9bd8e18d2996ca2c279c27f3 | [log] [tgz] |
---|---|---|
author | Tino Rusch <tino.rusch@gmail.com> | Tue Aug 20 13:33:46 2019 +0200 |
committer | Francis Chuang <F21@users.noreply.github.com> | Thu Aug 22 16:41:16 2019 +1000 |
tree | 0e2948df0c1311d462e9d5a5bddaf424a93ffe40 | |
parent | 9e0d6f54ae174dcc8aa8b78ba87cd85d3f0968f4 [diff] |
[CALCITE-3275] add nil checks to error parsing (Tino Rusch). This commit introduces a small helper method to get the server address from the message metadata. Before using this helper the driver would crash the whole application if the server sends an error message without setting up the metadata object.
Apache Calcite's Avatica Go is a Go database/sql driver for the Avatica server.
Avatica is a sub-project of Apache Calcite.
If you are using Go 1.10 and below, install using dep:
$ dep ensure -add github.com/apache/calcite-avatica-go
If you are using Go 1.11 and above, install using Go modules:
$ go get github.com/apache/calcite-avatica-go
The Phoenix/Avatica driver implements Go's database/sql/driver
interface, so, import the database/sql
package and the driver:
import "database/sql" import _ "github.com/apache/calcite-avatica-go/v4" db, err := sql.Open("avatica", "http://localhost:8765")
Then simply use the database connection to query some data, for example:
rows := db.Query("SELECT COUNT(*) FROM test")
For more details, see the home page.
Release notes for all published versions are available on the history page.
We do not use Github to file issues. Please create an issue on Calcite's JIRA and select avatica-go
as the component.