File tree Expand file tree Collapse file tree
lib/gooddata/cloud_resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 3.7.41
1+ 3.7.42
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ def build_url(url)
9393 host = matches [ 0 ] [ 0 ]
9494 port = matches [ 0 ] [ 2 ] &.to_i || MYSQL_DEFAULT_PORT
9595
96- "#{ JDBC_MYSQL_PROTOCOL } #{ host } :#{ port } /#{ @database } ?sslmode=#{ get_ssl_mode ( @ssl_mode ) } &useCursorFetch=true"
96+ "#{ JDBC_MYSQL_PROTOCOL } #{ host } :#{ port } /#{ @database } ?sslmode=#{ get_ssl_mode ( @ssl_mode ) } &useCursorFetch=true&enabledTLSProtocols=TLSv1.2 "
9797 end
9898
9999 def get_ssl_mode ( ssl_mode )
Original file line number Diff line number Diff line change 1818module GoodData
1919 module CloudResources
2020 class SnowflakeClient < CloudResourceClient
21+ SNOWFLAKE_GDC_APPLICATION_PARAMETER = 'application=GoodData_Platform'
22+ SNOWFLAKE_SEPARATOR_PARAM = '?'
23+
2124 class << self
2225 def accept? ( type )
2326 type == 'snowflake'
@@ -31,7 +34,7 @@ def initialize(options = {})
3134 @database = options [ 'snowflake_client' ] [ 'connection' ] [ 'database' ]
3235 @schema = options [ 'snowflake_client' ] [ 'connection' ] [ 'schema' ] || 'public'
3336 @warehouse = options [ 'snowflake_client' ] [ 'connection' ] [ 'warehouse' ]
34- @url = options [ 'snowflake_client' ] [ 'connection' ] [ 'url' ]
37+ @url = build_url ( options [ 'snowflake_client' ] [ 'connection' ] [ 'url' ] )
3538 @authentication = options [ 'snowflake_client' ] [ 'connection' ] [ 'authentication' ]
3639 else
3740 raise ( 'Missing connection info for Snowflake client' )
@@ -79,6 +82,20 @@ def connect
7982
8083 @connection = java . sql . DriverManager . getConnection ( @url , prop )
8184 end
85+
86+ def build_url ( url )
87+ is_contain = url . include? ( SNOWFLAKE_GDC_APPLICATION_PARAMETER )
88+ unless is_contain
89+ if url . include? ( SNOWFLAKE_SEPARATOR_PARAM )
90+ url . concat ( "&" )
91+ else
92+ url . concat ( SNOWFLAKE_SEPARATOR_PARAM )
93+ end
94+ url . concat ( SNOWFLAKE_GDC_APPLICATION_PARAMETER )
95+ end
96+
97+ url
98+ end
8299 end
83100 end
84101end
You can’t perform that action at this time.
0 commit comments