• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H17-Aug-2021-

benchmark/H17-Aug-2021-

ci/H17-Aug-2021-

cmd/H17-Aug-2021-

test_data/H03-May-2022-

vendor/H03-May-2022-

.gitignoreH A D17-Aug-2021164

.pre-commit-config.yamlH A D17-Aug-2021188

.semgrep.ymlH A D17-Aug-20216.5 KiB

CONTRIBUTING.mdH A D17-Aug-2021816

LICENSEH A D17-Aug-202111.1 KiB

MakefileH A D17-Aug-20211 KiB

README.rstH A D17-Aug-20214 KiB

async_test.goH A D17-Aug-20212.4 KiB

auth.goH A D17-Aug-202114.3 KiB

auth_test.goH A D17-Aug-202113.9 KiB

authexternalbrowser.goH A D17-Aug-20216.8 KiB

authokta.goH A D17-Aug-202110 KiB

authokta_test.goH A D17-Aug-20217.9 KiB

azure_util.goH A D17-Aug-20215.9 KiB

bind_uploader.goH A D17-Aug-20216.5 KiB

bindings_test.goH A D17-Aug-202113.5 KiB

cacert.goH A D17-Aug-2021217.2 KiB

chunk.goH A D17-Aug-20216.5 KiB

chunk_arrow.goH A D17-Aug-20211.6 KiB

chunk_downloader.goH A D17-Aug-202117.1 KiB

chunk_test.goH A D17-Aug-20219.8 KiB

client.goH A D17-Aug-2021927

client_test.goH A D17-Aug-20211.5 KiB

connection.goH A D17-Aug-202127.9 KiB

connection_test.goH A D17-Aug-20218.9 KiB

connector.goH A D17-Aug-20211 KiB

connector_test.goH A D17-Aug-20211.1 KiB

converter.goH A D17-Aug-202119.9 KiB

converter_test.goH A D17-Aug-202116.5 KiB

ctx_test.goH A D17-Aug-20211.1 KiB

datatype.goH A D17-Aug-20215.1 KiB

datatype_test.goH A D17-Aug-20211.2 KiB

debug.goH A D17-Aug-2021134

doc.goH A D17-Aug-202137.9 KiB

driver.goH A D17-Aug-20211 KiB

driver_ocsp_test.goH A D17-Aug-202119.4 KiB

driver_test.goH A D17-Aug-202155.9 KiB

dsn.goH A D17-Aug-202115.7 KiB

dsn_test.goH A D17-Aug-202124.9 KiB

encrypt_util.goH A D17-Aug-20217.3 KiB

encrypt_util_test.goH A D17-Aug-20214 KiB

errors.goH A D17-Aug-202110.9 KiB

errors_test.goH A D17-Aug-20212.1 KiB

file_compression_type.goH A D17-Aug-20212.3 KiB

file_transfer_agent.goH A D17-Aug-202131.8 KiB

file_util.goH A D17-Aug-20214.3 KiB

gcs_util.goH A D17-Aug-20219 KiB

go.modH A D17-Aug-2021772

go.sumH A D17-Aug-20219.8 KiB

gosnowflake.makH A D17-Aug-20211,001

heartbeat.goH A D17-Aug-20212.4 KiB

local_util.goH A D17-Aug-20212.2 KiB

location.goH A D17-Aug-20212.1 KiB

location_test.goH A D17-Aug-20211.9 KiB

log.goH A D17-Aug-20217.8 KiB

multistatement_test.goH A D17-Aug-20219.6 KiB

ocsp.goH A D17-Aug-202127.6 KiB

ocsp_test.goH A D17-Aug-202114.9 KiB

old_driver_test.goH A D17-Aug-20215 KiB

parameters.json.tmplH A D17-Aug-2021383

prepared_statement_test.goH A D17-Aug-20211.8 KiB

priv_key_test.goH A D17-Aug-20213.7 KiB

priv_key_test_coding_helper.goH A D17-Aug-2021894

put_get_test.goH A D17-Aug-202111.6 KiB

put_get_user_stage_test.goH A D17-Aug-20214.7 KiB

put_get_with_aws_test.goH A D17-Aug-20217.2 KiB

put_get_with_azure_test.goH A D17-Aug-202188

put_get_with_gcp_test.goH A D17-Aug-202188

query.goH A D17-Aug-20218.2 KiB

release.goH A D17-Aug-202194

restful.goH A D17-Aug-202115.6 KiB

restful_test.goH A D17-Aug-202116.7 KiB

result.goH A D17-Aug-20211.7 KiB

retry.goH A D17-Aug-20218 KiB

retry_test.goH A D17-Aug-20217 KiB

rows.goH A D17-Aug-20215.7 KiB

rows_test.goH A D17-Aug-202111.2 KiB

s3_util.goH A D17-Aug-20216.6 KiB

s3_util_test.goH A D17-Aug-20218 KiB

sqlstate.goH A D17-Aug-2021899

statement.goH A D17-Aug-20211.3 KiB

statement_test.goH A D17-Aug-20213.9 KiB

storage_client.goH A D17-Aug-20216.8 KiB

telemetry.goH A D17-Aug-20212.1 KiB

telemetry_test.goH A D17-Aug-20211 KiB

transaction.goH A D17-Aug-2021756

util.goH A D17-Aug-20216.6 KiB

util_test.goH A D17-Aug-20215.9 KiB

version.goH A D17-Aug-2021202

README.rst

1********************************************************************************
2Go Snowflake Driver
3********************************************************************************
4
5.. image:: https://github.com/snowflakedb/gosnowflake/workflows/Build%20and%20Test/badge.svg?branch=master
6    :target: https://github.com/snowflakedb/gosnowflake/actions?query=workflow%3A%22Build+and+Test%22
7
8.. image:: http://img.shields.io/:license-Apache%202-brightgreen.svg
9    :target: http://www.apache.org/licenses/LICENSE-2.0.txt
10
11.. image:: https://goreportcard.com/badge/github.com/snowflakedb/gosnowflake
12    :target: https://goreportcard.com/report/github.com/snowflakedb/gosnowflake
13
14This topic provides instructions for installing, running, and modifying the Go Snowflake Driver. The driver supports Go's `database/sql <https://golang.org/pkg/database/sql/>`_ package.
15
16Prerequisites
17================================================================================
18
19The following software packages are required to use the Go Snowflake Driver.
20
21Go
22----------------------------------------------------------------------
23
24The latest driver requires the `Go language <https://golang.org/>`_ 1.14 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.
25
26
27Installation
28================================================================================
29
30Get Gosnowflake source code, if not installed.
31
32.. code-block:: bash
33
34    go get -u github.com/snowflakedb/gosnowflake
35
36Docs
37====
38
39For detailed documentation and basic usage examples, please see the documentation at
40`godoc.org <https://godoc.org/github.com/snowflakedb/gosnowflake/>`_.
41
42Sample Programs
43================================================================================
44
45Snowflake 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
46include ``$GOPATH/bin`` in the environment variable ``$PATH``. Run the ``make`` command to build all sample programs.
47
48.. code-block:: go
49
50    make install
51
52In the following example, the program ``select1.go`` is built and installed in ``$GOPATH/bin`` and can be run from the command line:
53
54.. code-block:: bash
55
56    SNOWFLAKE_TEST_ACCOUNT=<your_account> \
57    SNOWFLAKE_TEST_USER=<your_user> \
58    SNOWFLAKE_TEST_PASSWORD=<your_password> \
59    select1
60    Congrats! You have successfully run SELECT 1 with Snowflake DB!
61
62Development
63================================================================================
64
65The developer notes are hosted with the source code on `GitHub <https://github.com/snowflakedb/gosnowflake>`_.
66
67Testing Code
68----------------------------------------------------------------------
69
70Set the Snowflake connection info in ``parameters.json``:
71
72.. code-block:: json
73
74    {
75        "testconnection": {
76            "SNOWFLAKE_TEST_USER":      "<your_user>",
77            "SNOWFLAKE_TEST_PASSWORD":  "<your_password>",
78            "SNOWFLAKE_TEST_ACCOUNT":   "<your_account>",
79            "SNOWFLAKE_TEST_WAREHOUSE": "<your_warehouse>",
80            "SNOWFLAKE_TEST_DATABASE":  "<your_database>",
81            "SNOWFLAKE_TEST_SCHEMA":    "<your_schema>",
82            "SNOWFLAKE_TEST_ROLE":      "<your_role>"
83        }
84    }
85
86Install `jq <https://stedolan.github.io/jq/>`_ so that the parameters can get parsed correctly, and run ``make test`` in your Go development environment:
87
88.. code-block:: bash
89
90    make test
91
92Submitting Pull Requests
93----------------------------------------------------------------------
94
95You 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.
96
97Support
98----------------------------------------------------------------------
99
100For official support, contact Snowflake support at:
101https://support.snowflake.net/
102
103