Go Snowflake Driver
Clone or download
Latest commit 50dd2d0 Jan 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github retry connection and requests Apr 25, 2017
benchmark Updated doc Aug 23, 2018
cmd Fixed SHOW PARAMETERS result handling for variable length case Aug 13, 2018
vendor change to implicit vender glog Sep 18, 2018
.gitignore added the encrypted private key for key pair test Aug 31, 2018
.travis.yml Add test against Azure Deployment (#212) Jan 15, 2019
CHANGELOG.md Bump up to v1.1.15 Nov 27, 2018
CONTRIBUTING.md Added Github supporting docs Apr 18, 2017
Gopkg.lock change to implicit vender glog Sep 18, 2018
Gopkg.toml hide glog as a google's one Sep 18, 2018
LICENSE updated copyright to 2018 Jan 4, 2018
Makefile echo test parameters Aug 31, 2018
README.rst Update support URL Jan 18, 2019
auth.go Rename retryID to requestGUID Oct 5, 2018
auth_go1_10_test.go Move file description to avoid lint complaint Aug 31, 2018
auth_test.go Fixed go 1.9 tests Aug 31, 2018
authexternalbrowser.go Added OS info to the session Apr 3, 2018
authokta.go Change UUID dependency Jun 19, 2018
authokta_test.go updated copyright to 2018 Jan 4, 2018
cacert.go updated copyright to 2018 Jan 4, 2018
chunk.go address comments Jan 14, 2019
chunk_test.go fix custom json parser Jan 14, 2019
connection.go add test cases for both standard and custom JSON decoder Aug 23, 2018
converter.go updated copyright to 2018 Jan 4, 2018
converter_test.go updated copyright to 2018 Jan 4, 2018
datatype.go Add extra type Oct 30, 2018
datatype_test.go updated copyright to 2018 Jan 4, 2018
debug.go Add debugPanic Oct 30, 2018
doc.go Format change Sep 18, 2018
driver.go Remove my TODO comments Aug 31, 2018
driver_test.go Add test against Azure Deployment (#212) Jan 15, 2019
dsn.go Remove unnecessary go routine and fix context cancel/timeout handling ( Oct 9, 2018
dsn_test.go Complete compile time dependency change. Aug 31, 2018
errors.go user can now set jwt timeout in the dsn Aug 31, 2018
errors_test.go updated copyright to 2018 Jan 4, 2018
gosnowflake.mak Follow lint's new path as they enforce it. Oct 16, 2018
heartbeat.go Rename retryID to requestGUID Oct 5, 2018
location.go updated copyright to 2018 Jan 4, 2018
location_test.go updated copyright to 2018 Jan 4, 2018
log.go improved logging based on security code review Nov 29, 2017
log_debug.go change to implicit vender glog Sep 18, 2018
ocsp.go Fix proxy settings Jul 22, 2018
ocsp_test.go updated copyright to 2018 Jan 4, 2018
optional_go1_10_test.go Move file description to avoid lint complaint Aug 31, 2018
optional_go1_9_test.go Move file description to avoid lint complaint Aug 31, 2018
parameters.json.enc fixed password (2nd) Aug 31, 2018
parameters.json.tmpl Added Makefile to run tests by make test. parameters.py is used to se… Apr 22, 2017
parameters_azure.json.enc Add test against Azure Deployment (#212) Jan 15, 2019
priv_key_coding_go1_10.go Move file description to avoid lint complaint Aug 31, 2018
priv_key_coding_go1_9.go Move file description to avoid lint complaint Aug 31, 2018
query.go fixed fmt and lint. Updated dep lock file. Aug 14, 2018
release.go Add debugPanic Oct 30, 2018
restful.go Perform check on error for response. Nov 20, 2018
restful_test.go raise HTTP 403 immediately if Snowflake authentication fails Jan 24, 2018
result.go updated copyright to 2018 Jan 4, 2018
retry.go do not sleep through a context timeout Oct 16, 2018
retry_test.go Rename retryID to requestGUID Oct 5, 2018
rows.go Remove unnecessary go routine and fix context cancel/timeout handling ( Oct 9, 2018
rows_test.go Fix segfault led by configurable timeout in rest. Oct 8, 2018
rsa-2048-private-key.p8.enc added the encrypted private key for key pair test Aug 31, 2018
sqlstate.go updated copyright to 2018 Jan 4, 2018
statement.go updated copyright to 2018 Jan 4, 2018
transaction.go updated copyright to 2018 Jan 4, 2018
util.go updated copyright to 2018 Jan 4, 2018
util_test.go updated copyright to 2018 Jan 4, 2018
version.go Bump up to v1.1.15 Nov 27, 2018

README.rst

Go Snowflake Driver

https://travis-ci.org/snowflakedb/gosnowflake.svg?branch=master https://goreportcard.com/badge/github.com/snowflakedb/gosnowflake

This topic provides instructions for installing, running, and modifying the Go Snowflake Driver. The driver supports Go's database/sql package.

Prerequisites

The following software packages are required to use the Go Snowflake Driver.

Go

The driver requires the Go language 1.10 or higher. The supported operating systems are Linux, Mac OS, and Windows, but you may run the driver on other platforms if the Go language works correctly on those platforms.

Installation

Get Gosnowflake source code and dep (dependency managment tool), if not installed, and ensure the dependent libraries are installed.

go get -u github.com/snowflakedb/gosnowflake
go get -u github.com/golang/dep/cmd/dep
cd $GOPATH/src/github.com/snowflakedb/gosnowflake/
dep ensure

Logging Settings

Unless you implement your own glog and would like to plug in that glog to dump messages generated from the Gosnowflake driver, we strongly recommend using snowflake's implementation of glog.

To use snowflake's glog, add the following block to your Gopkg.toml

[[override]]
name = "github.com/golang/glog"
source = "https://github.com/snowflakedb/glog.git"
revision = "f5055e6f21ce71153a199e6460664045b3af8e50"

Run dep ensure to download the snowflake's glog

Docs

For detailed documentation and basic usage examples, please see the documentation at godoc.org.

Sample Programs

Snowflake provides a set of sample programs to test with. Set the environment variable $GOPATH to the top directory of your workspace, e.g., ~/go and make certain to include $GOPATH/bin in the environment variable $PATH. Run the make command to build all sample programs.

make install

In the following example, the program select1.go is built and installed in $GOPATH/bin and can be run from the command line:

SNOWFLAKE_TEST_ACCOUNT=<your_account> \
SNOWFLAKE_TEST_USER=<your_user> \
SNOWFLAKE_TEST_PASSWORD=<your_password> \
select1
Congrats! You have successfully run SELECT 1 with Snowflake DB!

Development

The developer notes are hosted with the source code on GitHub.

Testing Code

Set the Snowflake connection info in parameters.json:

{
    "testconnection": {
        "SNOWFLAKE_TEST_USER":      "<your_user>",
        "SNOWFLAKE_TEST_PASSWORD":  "<your_password>",
        "SNOWFLAKE_TEST_ACCOUNT":   "<your_account>",
        "SNOWFLAKE_TEST_WAREHOUSE": "<your_warehouse>",
        "SNOWFLAKE_TEST_DATABASE":  "<your_database>",
        "SNOWFLAKE_TEST_SCHEMA":    "<your_schema>",
        "SNOWFLAKE_TEST_ROLE":      "<your_role>"
    }
}

Install jq so that the parameters can get parsed correctly, and run make test in your Go development environment:

make test

Submitting Pull Requests

You may use your preferred editor to edit the driver code. Make certain to run make fmt lint before submitting any pull request to Snowflake. This command formats your source code according to the standard Go style and detects any coding style issues.

Support

For official support, contact Snowflake support at: https://support.snowflake.net/