rb_snowflake_client 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 360d25c32a7cc3a3604d286a35eabdf11cd42cb766d41ce079756db869f28509
4
- data.tar.gz: aa32d0ae97fb42712bde20c8cbd700e109568f5700d95917f22cb671dc36e9bf
3
+ metadata.gz: af3e56d97ebae43ae931c9c50784d7a3af0fe0e4a70f7e2a28c932d30371eff5
4
+ data.tar.gz: cdd2e9f55805e8d27e344925b8917b6d292aa1b07ed87ac8443060d31e224ccc
5
5
  SHA512:
6
- metadata.gz: a92653723f1a69391177a9b7514de5c74985045dab8aeb1d6fc61b5df29d4e33e8ffbb6f420424e2c253a2229f96ee3f616562fa0d735f3529fe33b5b96a58b0
7
- data.tar.gz: 00e3ea7dae6d516363814967310b8e7b0bc5078bb9f36d2590393c7f03e7ec39de9923baf6bf19d7654d1da8fa9a20ce586f9d9a616dbc6485736cbbdb8753b1
6
+ metadata.gz: 3c3aae7bf833cab432ea952419e951f51584100766eccd07d3a978c449fd1a2fd532a5756a0789242ff1baa7319dc360a162ba608d502d12436837f456033b97
7
+ data.tar.gz: cf1828f9a00b3be7c6030c5bc3e6f1be834206e364be477aa944faffaaf3638dc65a61bbc215c6f7428fd103ee62a1077e9658fa08055479e632b29d15f008f7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rb_snowflake_client (1.0.4)
4
+ rb_snowflake_client (1.0.6)
5
5
  concurrent-ruby (>= 1.2)
6
6
  connection_pool (>= 2.4)
7
7
  dotenv (>= 2.8)
data/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  The available options for connecting from Ruby to Snowflake include:
6
6
  * ODBC - which works, but can be very slow, especially for a lot of data, which is probably why you're using Snowflake
7
- * The [ruby snowflake client][https://github.com/rinsed-org/ruby-snowflake-client] that wraps the go client. This is probably the fastest single threaded option, which we also created. However, that library takes the ruby GVL and so stops all other processing in your ruby process (threads).
7
+ * The [ruby snowflake client](https://github.com/rinsed-org/ruby-snowflake-client) that wraps the go client. This is probably the fastest single threaded option, which we also created. However, that library takes the ruby GVL and so stops all other processing in your ruby process (threads).
8
8
 
9
9
  This library is implemented in ruby and while it leverages some libraries that have native extensions, doesn't currently include anything itself. Depending on network latency and the shape of the data this library can be faster or slower than the go wrapper. The big advantages are:
10
10
  * It uses about half the memory when you pull a full result set into memory
11
- * It does not hold onto the [ruby GVL][https://www.speedshop.co/2020/05/11/the-ruby-gvl-and-scaling.html] and so does not block other threads while waiting on IO like the go wrapper client.
11
+ * It does not hold onto the [ruby GVL](https://www.speedshop.co/2020/05/11/the-ruby-gvl-and-scaling.html) and so does not block other threads while waiting on IO like the go wrapper client.
12
12
  * It will consume more resources for the same data, because it's using the HTTP v2 API and getting JSON back, there is just more work to as compared to the go or python clients that use Apache Arrow under the covers.
13
13
 
14
14
  # Usage
@@ -128,7 +128,7 @@ module RubySnowflake
128
128
  @_enable_polling_queries = false
129
129
  end
130
130
 
131
- def query(query, warehouse: nil, streaming: false, database: nil)
131
+ def query(query, warehouse: nil, streaming: false, database: nil, schema: nil)
132
132
  warehouse ||= @default_warehouse
133
133
  database ||= @default_database
134
134
 
@@ -136,8 +136,11 @@ module RubySnowflake
136
136
  response = nil
137
137
  connection_pool.with do |connection|
138
138
  request_body = {
139
- "statement" => query, "warehouse" => warehouse&.upcase,
140
- "database" => database&.upcase, "timeout" => @query_timeout
139
+ "database" => database&.upcase,
140
+ "schema" => schema&.upcase,
141
+ "statement" => query,
142
+ "timeout" => @query_timeout,
143
+ "warehouse" => warehouse&.upcase,
141
144
  }
142
145
 
143
146
  response = request_with_auth_and_headers(
@@ -190,6 +193,7 @@ module RubySnowflake
190
193
  request.body = body unless body.nil?
191
194
 
192
195
  Retryable.retryable(tries: @http_retries + 1,
196
+ sleep: lambda {|n| 2**n }, # 1, 2, 4, 8, etc
193
197
  on: [RetryableBadResponseError, OpenSSL::SSL::SSLError],
194
198
  log_method: retryable_log_method) do
195
199
  response = nil
@@ -1,3 +1,3 @@
1
1
  module RubySnowflake
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb_snowflake_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rinsed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby