swa 0.7.5 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1db2fa774c68dc5fc72812a3c9962eac1b532bbea246f163fdb705e301d80343
4
- data.tar.gz: 3752e1fbb76dcd2fc3eeb84fe7b703420f5d87ad36559b05c178d3bdbe043508
3
+ metadata.gz: 6d195d1632c4f915a413f9a7b4f40127eff5497a45b6217159147a392ec4089d
4
+ data.tar.gz: 40720608d5be447d93641459922835fa71d4b698c9d1270eb25d8322db9c87fa
5
5
  SHA512:
6
- metadata.gz: 82fe2ee12f547a35efa664798fd5d52d6313ad60957c6045e13956de5f31662f728636d541a2661031d1068c4a5d110ad255a56c81b9d3ae280270f224f8be62
7
- data.tar.gz: ffdf5f146091814f926b1af310a44c198dba8b64573d1f3e75f92b50fc50979698f433d9611bb3c0097ffa70f987ecf1fb290591ab0dfa562bb5922fbdbcebc5
6
+ metadata.gz: 0a7a37485d2d422b1cf1625f8359ea33a798b450d55c2c4b539995ce302f305340a6893344db6de7c5a8ffcf26224d30b468fe92a7fc7a3638e55f9f476877b4
7
+ data.tar.gz: 157497f4a9da0f7361a2db3435855cdd40ed9aed25c2cae91f9648c34c3bb4577dcb745bce30b3f9c3410fa06efe81d44126540f8de85b1ab1653dd080302802
@@ -91,24 +91,25 @@ module Swa
91
91
 
92
92
  end
93
93
 
94
- subcommand ["executions", "query-executions"], "List query executions" do
94
+ subcommand ["query", "q", "execute", "exec"], "Run a query" do
95
95
 
96
- include CollectionBehaviour
96
+ option ["--database", "-D"], "NAME", "Database name"
97
+ option ["--output-location", "-O"], "S3_URL", "S3 output location for query results"
97
98
 
98
- private
99
-
100
- def collection
101
- query_for(:list_query_executions, :query_execution_ids, Swa::Athena::QueryExecution, work_group: workgroup)
102
- end
103
-
104
- end
105
-
106
- subcommand ["query", "q", "run"], "Run a query" do
107
-
108
- parameter "QUERY", "SQL query"
99
+ parameter "[QUERY]", "SQL query", :default => "STDIN"
109
100
 
110
101
  def execute
111
- start_query_response = athena_client.start_query_execution(query_string: query, work_group: workgroup)
102
+ start_query_response = athena_client.start_query_execution(
103
+ query_execution_context: {
104
+ catalog: catalog,
105
+ database: database
106
+ },
107
+ query_string: query,
108
+ result_configuration: {
109
+ output_location: output_location
110
+ },
111
+ work_group: workgroup
112
+ )
112
113
  wait_for_query(start_query_response.query_execution_id)
113
114
  query_results = athena_client.get_query_results(query_execution_id: start_query_response.query_execution_id)
114
115
  output_results_as_csv(query_results.result_set)
@@ -116,6 +117,10 @@ module Swa
116
117
 
117
118
  private
118
119
 
120
+ def default_query
121
+ $stdin.read
122
+ end
123
+
119
124
  def wait_for_query(query_execution_id)
120
125
  QueryCompletionWaiter.new(client: athena_client).wait(query_execution_id: query_execution_id)
121
126
  rescue Aws::Waiters::Errors::FailureStateError => error
@@ -120,7 +120,7 @@ module Swa
120
120
 
121
121
  option "--prefix", "PREFIX", "object prefix"
122
122
 
123
- self.default_subcommand = "prefixes"
123
+ self.default_subcommand = "list"
124
124
 
125
125
  subcommand ["list", "ls"], "One-line summary" do
126
126
 
@@ -31,11 +31,11 @@ module Swa
31
31
  delegate :prefix
32
32
 
33
33
  def column1
34
- ""
34
+ "-"
35
35
  end
36
36
 
37
37
  def column2
38
- ""
38
+ "-"
39
39
  end
40
40
 
41
41
  def uri
data/lib/swa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Swa
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-16 00:00:00.000000000 Z
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler