You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by fr...@apache.org on 2018/04/17 04:44:21 UTC

[3/4] calcite-avatica-go git commit: Add development and release instructions

Add development and release instructions


Project: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/commit/b6b1fb4b
Tree: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/tree/b6b1fb4b
Diff: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/diff/b6b1fb4b

Branch: refs/heads/master
Commit: b6b1fb4be93262cc6dd9f6ab162326bf2d353918
Parents: 7e0e878
Author: Francis Chuang <fr...@apache.org>
Authored: Tue Apr 17 14:34:54 2018 +1000
Committer: Francis Chuang <fr...@apache.org>
Committed: Tue Apr 17 14:34:54 2018 +1000

----------------------------------------------------------------------
 Dockerfile             |  9 +++++++
 README.md              | 23 +++++++++++++++++
 docker-compose.yml     | 13 ++++++++++
 driver.go              |  2 +-
 site/go_development.md | 61 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 107 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/b6b1fb4b/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..bc9dbd2
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,9 @@
+FROM golang:1.10-alpine
+
+WORKDIR /go/src/github.com/apache/calcite-avatica-go
+COPY . .
+RUN apk --no-cache --update add git \
+    && go get -u github.com/golang/dep/cmd/dep \
+    && dep ensure -v
+
+CMD ["python", "app.py"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/b6b1fb4b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index eb6d0e5..88ec9c5 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,29 @@ Apache Calcite's Avatica Go is a Go [database/sql](https://golang.org/pkg/databa
 
 Avatica is a sub-project of [Apache Calcite](https://calcite.apache.org).
 
+## Quick Start
+Install using your dependency management tool (we recommend [dep](https://github.com/golang/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](https://calcite.apache.org/avatica/go_client_reference.html).
 
 Release notes for all published versions are available on the [history

http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/b6b1fb4b/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..0a4f447
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,13 @@
+version: '3'
+services:
+  calcite-avatica-go:
+    build: .
+    environment:
+      PHOENIX_HOST: http://phoenix:8765
+      HSQLDB_HOST: http://hsqldb:8765
+    command: sh -c "export AVATICA_FLAVOR=HSQLDB && go test -v ./...; export AVATICA_FLAVOR=PHOENIX && go test -v ./..."
+  phoenix:
+    image: boostport/hbase-phoenix-all-in-one:1.3-4.13
+  hsqldb:
+    image: f21global/calcite-avatica:1.11.0-hypersql
+    command: -u jdbc:hsqldb:mem:public
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/b6b1fb4b/driver.go
----------------------------------------------------------------------
diff --git a/driver.go b/driver.go
index 6457f40..36e6634 100644
--- a/driver.go
+++ b/driver.go
@@ -27,7 +27,7 @@ Import the database/sql package along with the avatica driver.
 
 	db, err := sql.Open("avatica", "http://phoenix-query-server:8765")
 
-See https://github.com/apache/calcite-avatica-go#usage for more details
+See https://calcite.apache.org/avatica/go_client_reference.html for more details
 */
 package avatica
 

http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/b6b1fb4b/site/go_development.md
----------------------------------------------------------------------
diff --git a/site/go_development.md b/site/go_development.md
new file mode 100644
index 0000000..e2faf11
--- /dev/null
+++ b/site/go_development.md
@@ -0,0 +1,61 @@
+---
+layout: docs
+title: Go Client Development
+sidebar_title: Go Client Development
+permalink: /docs/go_development.html
+---
+
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+## Testing
+
+The test suite takes around 4 minutes to run if you run both the Avatica HSQLDB and Apache Phoenix tests.
+
+### Easy way
+1. Install [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/).
+
+2. From the root of the repository, run `docker-compose up`.
+
+### Manual set up
+1. Install [Go](https://golang.org/doc/install).
+
+2. Install [dep](https://github.com/golang/dep): `go get -u github.com/golang/dep/cmd/dep`
+
+3. Install dependencies by running `dep ensure -v` from the root of the repository.
+
+4. The test suite requires access to an instance of Avatica running HSQLDB and an instance of Apache Phoenix running the
+Phoenix Query Server.
+
+You should then set the `HSQLDB_HOST` and `PHOENIX_HOST` environment variables. For example:
+~~~~~~
+HSQLDB_HOST: http://hsqldb:8765
+PHOENIX_HOST: http://phoenix:8765
+~~~~~~
+
+5. To select the test suite, export `AVATICA_FLAVOR=HSQLDB` for Avatica HSQLDB or `AVATICA_FLAVOR=PHOENIX` for Phoenix.
+
+6. Then run `go test-v ./...` from the root of the repository to execute the test suite.
+
+## Releasing
+If you have not set up a GPG signing key, set one up by following these [instructions](https://www.apache.org/dev/openpgp.html#generate-key).
+
+From the root of the repository, run `./make-release-artifacts.sh`.
+
+The release artifacts will be placed in the `dist/` folder.
\ No newline at end of file