sqlui 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sqlui.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 419351d0941030d9b1ab17842fd289a7550a6b78a45d59213e2143b29442e363
|
4
|
+
data.tar.gz: 7c66542a8e6503c7a38f05f5fc02fc17e022c08cf0303f411053968d4138e683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fd9196bda8b7ba45082d03a8a0bc2606875cc0ca0b38371b4c3e924b612eb4d6d148452bfde1ba6a06ca75c4132f48312defe447dd64aaa4e94a19bdf0189fb
|
7
|
+
data.tar.gz: de9b1c4ceb3caaf8a364a1964214002cd73161911aedd194fda78a72d24ea843e09982c86234e5265ee2dc55cabd396f6b209bf0a11689175e0da04b04fffeda
|
data/lib/sqlui.rb
CHANGED
@@ -5,11 +5,11 @@ require 'set'
|
|
5
5
|
class SQLUI
|
6
6
|
MAX_ROWS = 1_000
|
7
7
|
|
8
|
-
def initialize(name:, saved_path:, max_rows: MAX_ROWS
|
8
|
+
def initialize(client:, name:, saved_path:, max_rows: MAX_ROWS)
|
9
|
+
@client = client
|
9
10
|
@name = name
|
10
11
|
@saved_path = saved_path
|
11
12
|
@max_rows = max_rows
|
12
|
-
@queryer = block
|
13
13
|
@resources_dir = File.join(File.expand_path('..', File.dirname(__FILE__)), 'resources')
|
14
14
|
end
|
15
15
|
|
@@ -77,7 +77,7 @@ class SQLUI
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def load_metadata
|
80
|
-
stats_result = @
|
80
|
+
stats_result = @client.query(
|
81
81
|
<<~SQL
|
82
82
|
select
|
83
83
|
table_schema,
|
@@ -131,7 +131,7 @@ class SQLUI
|
|
131
131
|
column[:column_name] = row['column_name']
|
132
132
|
end
|
133
133
|
|
134
|
-
column_result = @
|
134
|
+
column_result = @client.query(
|
135
135
|
<<~SQL
|
136
136
|
select
|
137
137
|
table_schema,
|
@@ -173,7 +173,7 @@ class SQLUI
|
|
173
173
|
end
|
174
174
|
|
175
175
|
def execute_query(sql)
|
176
|
-
result = @
|
176
|
+
result = @client.query(sql)
|
177
177
|
rows = result.map { |row| row.values }
|
178
178
|
columns = result.first&.keys || []
|
179
179
|
column_types = columns.map { |_| 'string' }
|