athens 0.3.1 → 0.3.2

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: 29669376828c5d70eff208ef500bb16c16a6b8a3d20a2015fcbe4da7fc7a94c2
4
- data.tar.gz: 890e8479a158b000eed78784064c4e7773c06eca9ddcc1b8223edc4f0d96a03f
3
+ metadata.gz: aeee2d9b7817273521ffe4d0f54865b8f5ce21d185175381ce9d8f013b4efca6
4
+ data.tar.gz: c7ed5eacc1231fb5d81061bdfd700ca96bcab9f2e6635f3a9a24512de2f27107
5
5
  SHA512:
6
- metadata.gz: 9741ed71a51d70125c76392cc6eff06eaf2d2ba403f525a9cc953f1152e392fe2c1f8d76508e53e5ffd6a9e1b52f194fd05eaabfa9d907ba2a5de2509d5ac826
7
- data.tar.gz: ff41822fb3ae5bf379c36a7901150db1ee130f4c21315b5ec2b11c254574b55bd9d0f29acd28c169706737eaacedcaefb582bf42df2434de07adfea58b55b736
6
+ metadata.gz: 78c927b03a064c1e9d8ce3ae471aa6fc6f1852ba192abe69a14deae61bf8e020cebda5b3dcc6e8607a9944e373192df9f3ccb3ba23d9b8277ac4ac8b4043f006
7
+ data.tar.gz: a0cc740c6bf5a6238e3ecf192257c187d94f8e05a34422661d538949a4207abb856d1930263cf489d2a1950770724e1e047f4b30185cdbd7a7e0fc8193d85f54
@@ -1,3 +1,7 @@
1
+ ## 0.3.2 / 2020-11-24
2
+
3
+ * Added optional `request_token` and `work_group` parameters to the query execute method (thanks [mediafinger](https://github.com/mediafinger))
4
+
1
5
  ## 0.3.1 / 2020-07-20
2
6
 
3
7
  * Bumped development rake version from 0.10 to 0.13 for security fixes
data/README.md CHANGED
@@ -146,6 +146,13 @@ query.cancel # Attempts to cancel an in-progress query, returns true or false
146
146
  query.to_a(header_row: false) # If you want your query results returned without a header row of column names
147
147
  ```
148
148
 
149
+ The execute method also optionally supports the `request_token` and `work_group` [parameters](https://docs.aws.amazon.com/athena/latest/APIReference/API_StartQueryExecution.html#API_StartQueryExecution_RequestSyntax):
150
+
151
+ ```ruby
152
+ conn = Athens::Connection.new(database: 'sample')
153
+ query = conn.execute("SELECT * FROM mytable", request_token: single_use_token, work_group: my_work_group)
154
+ ```
155
+
149
156
  ## Development
150
157
 
151
158
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
1
  require "bundler/gem_tasks"
2
- task :default => :spec
@@ -8,7 +8,7 @@ module Athens
8
8
  def initialize(database: nil, aws_client_override: {})
9
9
  @database_name = database
10
10
 
11
- client_config = {
11
+ client_config = {
12
12
  access_key_id: Athens.configuration.aws_access_key,
13
13
  secret_access_key: Athens.configuration.aws_secret_key,
14
14
  region: Athens.configuration.aws_region
@@ -19,26 +19,28 @@ module Athens
19
19
 
20
20
  # Runs a query against Athena, returning an Athens::Query object
21
21
  # that you can use to wait for it to finish or get the results
22
- def execute(query)
22
+ def execute(query, request_token: nil, work_group: nil)
23
23
  if @database_name
24
24
  resp = @client.start_query_execution(
25
25
  query_string: query,
26
26
  query_execution_context: context,
27
- result_configuration: result_config
27
+ result_configuration: result_config,
28
+ client_request_token: request_token,
29
+ work_group: work_group
28
30
  )
29
31
  else
30
32
  resp = @client.start_query_execution(
31
33
  query_string: query,
32
34
  result_configuration: result_config
33
35
  )
34
- end
36
+ end
35
37
 
36
38
  return Athens::Query.new(self, resp.query_execution_id)
37
39
  end
38
40
 
39
41
  private
40
42
 
41
- def context
43
+ def context
42
44
  Aws::Athena::Types::QueryExecutionContext.new(database: @database_name)
43
45
  end
44
46
 
@@ -1,3 +1,3 @@
1
1
  module Athens
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: athens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schulte
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-20 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-athena