Closed toddtreece closed 3 years ago
Ah so by using the same key for every NewDatasource
, that causes setups with multiple Snowflake data sources to break in weird ways, as they're overwriting eachother?
I think this could be pretty easily remedied by including the data source UID in the cache key there. This feature was specifically added to allow multiple connections in 1 data source in some AWS data sources. cc @sunker
@kminehart yeah, exactly. they seem to all only be using one connection, and you can kind of reset which connection is being used if you go and do a health check on one of the data sources
This feature was specifically added to allow multiple connections in 1 data source
do you mean storing the connection in NewDatasource or storing the connection in getDB?
I can confirm the issue (I was assuming that each datasource instance would have its own sqldatasource instance but it's not working that way). See the fix at #49.
fixed in v2.3.1
It seems like the default key is always replaced when NewDatasource is called, so it seems like the latest connection is always being used. I have a temp workaround for the issue here: https://github.com/grafana/snowflake-datasource/pull/98
It's unclear how this is intended to work or if this is related to the issue, but the query's q.ConnectionArgs variable is always
nil
.Related issue: https://github.com/grafana/support-escalations/issues/999