commit | bb93a1045eda5620da8b2e2295338b19d4f61190 | [log] [tgz] |
---|---|---|
author | Kenneth Shaw <kenshaw@gmail.com> | Sat Jun 16 08:35:01 2018 +0700 |
committer | Kenneth Shaw <kenshaw@gmail.com> | Sat Jun 16 09:54:55 2018 +0700 |
tree | 42f565a62534feb0f575ba5db4da2480172b65e0 | |
parent | 24bae0c8efd03dead2eba9e6a08f55ded68c9027 [diff] |
[CALCITE-2367] Change UUID package (Kenneth Shaw) The satori UUID package causes problems with go get and vgo when building multiple database drivers in the same Go application. This is because the satori package introduced breaking API changes and has not tagged it a new version yet. This change converts the connection ID generation to use the hashicorp UUID package which was already a dependency of this project, as it is a dependency of the gokrb package. This has the added benefit of reducing the number of total package dependencies by 1. Additionally, this is needed by github.com/xo/usql so that go get and vgo build both work "out of the box". The following is a small Go program that demonstrates that the UUIDs generated will be the same format: package main import ( "log" guuid "github.com/google/uuid" huuid "github.com/hashicorp/go-uuid" suuid "github.com/satori/go.uuid" ) func main() { g, err := guuid.NewRandom() if err != nil { log.Fatal(err) } h, err := huuid.GenerateUUID() if err != nil { log.Fatal(err) } s, err := suuid.NewV4() if err != nil { log.Fatal(err) } log.Printf( "google: %s, hashicorp: %s, satori: %s", g, h, s, ) } Fixes CALCITE-2367.
Apache Calcite's Avatica Go is a Go database/sql driver for the Avatica server.
Avatica is a sub-project of Apache Calcite.
Install using your dependency management tool (we recommend dep!):
$ dep ensure -add 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" 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.