Skip to content

Commit

Permalink
Merge branch 'master' of github.com:snowflakedb/gosnowflake into SNOW…
Browse files Browse the repository at this point in the history
…-893925-OCSPRespondersInPrivatelink
  • Loading branch information
sfc-gh-dheyman committed Sep 13, 2023
2 parents 0b7f5ed + 59aa15b commit 944acc5
Show file tree
Hide file tree
Showing 29 changed files with 2,201 additions and 1,666 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/snyk-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:

concurrency: snyk-issue

permissions:
contents: read
issues: write
pull-requests: write

jobs:
whitesource:
snyk:
runs-on: ubuntu-latest
steps:
- name: checkout action
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/snyk-pr.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: snyk-pr

on:
pull_request:
branches:
- master

permissions:
contents: read
issues: write
pull-requests: write

jobs:
whitesource:
snyk:
runs-on: ubuntu-latest
permissions: write-all
if: ${{ github.event.pull_request.user.login == 'sfc-gh-snyk-sca-sa' }}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ The latest driver requires the [Go language](https://golang.org/) 1.19 or higher

# Installation

If you don't have a project initialized, set it up.

```sh
go mod init example.com/snowflake
```

Get Gosnowflake source code, if not installed.

```sh
Expand Down
21 changes: 21 additions & 0 deletions arrow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ import (
"time"
)

//A test just to show Snowflake version
func TestCheckVersion(t *testing.T) {
conn := openConn(t)
defer conn.Close()

rows, err := conn.QueryContext(context.Background(), "SELECT current_version()")
if err != nil {
t.Error(err)
}
defer rows.Close()

if !rows.Next() {
t.Fatalf("failed to find any row")
}
var s string
if err = rows.Scan(&s); err != nil {
t.Fatal(err)
}
println(s)
}

func TestArrowBigInt(t *testing.T) {
conn := openConn(t)
defer conn.Close()
Expand Down
2 changes: 1 addition & 1 deletion async.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (sr *snowflakeRestful) getAsync(

}

sc := &snowflakeConn{rest: sr, cfg: cfg}
sc := &snowflakeConn{rest: sr, cfg: cfg, queryContextCache: (&queryContextCache{}).init()}
if respd.Success {
if resType == execResultType {
res.insertID = -1
Expand Down
36 changes: 17 additions & 19 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,26 +368,24 @@ func postAuthCheckExternalBrowserFailed(_ context.Context, _ *snowflakeRestful,
}

func getDefaultSnowflakeConn() *snowflakeConn {
cfg := Config{
Account: "a",
User: "u",
Password: "p",
Database: "d",
Schema: "s",
Warehouse: "w",
Role: "r",
Region: "",
Params: make(map[string]*string),
PasscodeInPassword: false,
Passcode: "",
Application: "testapp",
}
sr := &snowflakeRestful{
TokenAccessor: getSimpleTokenAccessor(),
}
sc := &snowflakeConn{
rest: sr,
cfg: &cfg,
rest: &snowflakeRestful{
TokenAccessor: getSimpleTokenAccessor(),
},
cfg: &Config{
Account: "a",
User: "u",
Password: "p",
Database: "d",
Schema: "s",
Warehouse: "w",
Role: "r",
Region: "",
Params: make(map[string]*string),
PasscodeInPassword: false,
Passcode: "",
Application: "testapp",
},
telemetry: &snowflakeTelemetry{enabled: false},
}
return sc
Expand Down
Loading

0 comments on commit 944acc5

Please sign in to comment.