Skip to content

Commit

Permalink
[Feature] add a cache to the FetchResult codepath to avoid API calls (#…
Browse files Browse the repository at this point in the history
…45)

lint: fix `ConnectionId`

Fix CI for current master (#47)

* lint: fix `ConnectionId`

* Test fixes for previous change (`41c90a09`)

* nit: tweaks to dsn-test

Co-authored-by: Agam Brahma <agam@sigmacomputing.com>

fix var inits (#46)
  • Loading branch information
mhseiden authored and rajsigma committed Sep 8, 2023
1 parent 83168e2 commit adc87fd
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 827 deletions.
10 changes: 10 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type snowflakeConn struct {
SQLState string
telemetry *snowflakeTelemetry
internal InternalClient
execRespCache *execRespCache
}

var (
Expand Down Expand Up @@ -235,6 +236,9 @@ func (sc *snowflakeConn) cleanup() {
}
sc.rest = nil
sc.cfg = nil

releaseExecRespCache(sc.execRespCache)
sc.execRespCache = nil
}

func (sc *snowflakeConn) Close() (err error) {
Expand Down Expand Up @@ -756,6 +760,12 @@ func buildSnowflakeConn(ctx context.Context, config Config) (*snowflakeConn, err
} else {
tokenAccessor = getSimpleTokenAccessor()
}
if sc.cfg.DisableTelemetry {
sc.telemetry = &snowflakeTelemetry{enabled: false}
}
if sc.cfg.ConnectionID != "" {
sc.execRespCache = acquireExecRespCache(sc.cfg.ConnectionID)
}

// authenticate
sc.rest = &snowflakeRestful{
Expand Down
Loading

0 comments on commit adc87fd

Please sign in to comment.