You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-9
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,13 @@ This driver currently does not support GCP regional endpoints. Please ensure tha
56
56
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
57
57
include ``$GOPATH/bin`` in the environment variable ``$PATH``. Run the ``make`` command to build all sample programs.
58
58
59
-
```
59
+
```sh
60
60
make install
61
61
```
62
62
63
63
In the following example, the program ``select1.go`` is built and installed in ``$GOPATH/bin`` and can be run from the command line:
64
64
65
-
```
65
+
```sh
66
66
SNOWFLAKE_TEST_ACCOUNT=<your_account> \
67
67
SNOWFLAKE_TEST_USER=<your_user> \
68
68
SNOWFLAKE_TEST_PASSWORD=<your_password> \
@@ -79,7 +79,7 @@ The developer notes are hosted with the source code on [GitHub](https://github.c
79
79
80
80
Set the Snowflake connection info in ``parameters.json``:
81
81
82
-
```
82
+
```json
83
83
{
84
84
"testconnection": {
85
85
"SNOWFLAKE_TEST_USER": "<your_user>",
@@ -88,21 +88,25 @@ Set the Snowflake connection info in ``parameters.json``:
88
88
"SNOWFLAKE_TEST_WAREHOUSE": "<your_warehouse>",
89
89
"SNOWFLAKE_TEST_DATABASE": "<your_database>",
90
90
"SNOWFLAKE_TEST_SCHEMA": "<your_schema>",
91
-
"SNOWFLAKE_TEST_ROLE": "<your_role>"
91
+
"SNOWFLAKE_TEST_ROLE": "<your_role>",
92
+
"SNOWFLAKE_TEST_DEBUG": "false"
92
93
}
93
94
}
94
95
```
95
96
96
97
Install [jq](https://stedolan.github.io/jq) so that the parameters can get parsed correctly, and run ``make test`` in your Go development environment:
97
98
98
-
```
99
+
```sh
99
100
make test
100
101
```
101
102
103
+
### Setting debug mode during tests
104
+
This is for debugging Large SQL statements (greater than 300 characters). If you want to enable debug mode, set `SNOWFLAKE_TEST_DEBUG` to `true` in `parameters.json`, or export it in your shell instance.
105
+
102
106
## customizing Logging Tags
103
107
104
108
If you would like to ensure that certain tags are always present in the logs, `RegisterClientLogContextHook` can be used in your init function. See example below.
105
-
```
109
+
```go
106
110
import"github.com/snowflakedb/gosnowflake"
107
111
108
112
funcinit() {
@@ -116,7 +120,7 @@ func init() {
116
120
117
121
## Setting Log Level
118
122
If you want to change the log level, `SetLogLevel` can be used in your init function like this:
119
-
```
123
+
```go
120
124
import"github.com/snowflakedb/gosnowflake"
121
125
122
126
funcinit() {
@@ -138,15 +142,15 @@ The following is a list of options you can pass in to set the level from least t
138
142
139
143
Configure your testing environment as described above and run ``make cov``. The coverage percentage will be printed on the console when the testing completes.
140
144
141
-
```
145
+
```sh
142
146
make cov
143
147
```
144
148
145
149
For more detailed analysis, results are printed to ``coverage.txt`` in the project directory.
0 commit comments