sqlui 0.1.81 → 0.1.83
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.release-version +1 -1
- data/app/github/tree_client.rb +2 -15
- data/app/server.rb +7 -3
- data/client/resources/sqlui.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5625b1229d609f4ed5ded6463cba24291b1dd606ea8fff44b64b8352b7eea00
|
4
|
+
data.tar.gz: 26d7083c243f813d8f4a592fac971cdd21de499ca83fdb434d3fc84139079d7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e017c148185dbc8514b26765bcf2a30628fe27f4e3a1052e54a7e9836c4a2f0028877f93a03d50b4684c505848dcd049dce8b28821c8823bf2352f4d8661af0
|
7
|
+
data.tar.gz: 7d6d9d3c7826fa9c6035564612b306352d6de09aaf6884049f79cdfed713bd9f522006f5bec3fb50f04937a41f51d3d4ff32e60939844aee06366874543352d8
|
data/.release-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.83
|
data/app/github/tree_client.rb
CHANGED
@@ -53,8 +53,8 @@ module Github
|
|
53
53
|
latch = CountDownLatch.new(tree_size)
|
54
54
|
response['tree'].each do |blob|
|
55
55
|
TreeClient.thread_pool.post do
|
56
|
-
blob['
|
57
|
-
|
56
|
+
blob_response = @client.get_with_caching(blob['url'], cache_for: DEFAULT_MAX_FILE_CACHE_AGE_SECONDS)
|
57
|
+
blob['content'] = Base64.decode64(blob_response['content'])
|
58
58
|
ensure
|
59
59
|
latch.count_down
|
60
60
|
end
|
@@ -133,18 +133,5 @@ module Github
|
|
133
133
|
}
|
134
134
|
)
|
135
135
|
end
|
136
|
-
|
137
|
-
private
|
138
|
-
|
139
|
-
# Returns the contents of the file at the specified path. Uses the cache.
|
140
|
-
def get_file_content_with_caching(owner:, repo:, path:, ref:)
|
141
|
-
check_non_empty_string(owner: owner, repo: repo, sha: ref, path: path)
|
142
|
-
|
143
|
-
response = @client.get_with_caching(
|
144
|
-
"https://api.github.com/repos/#{owner}/#{repo}/contents/#{path}?ref=#{ref}",
|
145
|
-
cache_for: DEFAULT_MAX_FILE_CACHE_AGE_SECONDS
|
146
|
-
)
|
147
|
-
Base64.decode64(response['content'])
|
148
|
-
end
|
149
136
|
end
|
150
137
|
end
|
data/app/server.rb
CHANGED
@@ -123,7 +123,6 @@ class Server < Sinatra::Base
|
|
123
123
|
)
|
124
124
|
# Prefetch all trees on startup. This should happen before the health endpoint is available.
|
125
125
|
unless ENV.fetch('DISABLE_PREFETCH', '0') == '1'
|
126
|
-
Sqlui.logger.info 'prefetch'
|
127
126
|
tree_client.get_tree(
|
128
127
|
owner: saved_config.owner,
|
129
128
|
repo: saved_config.repo,
|
@@ -379,7 +378,12 @@ class Server < Sinatra::Base
|
|
379
378
|
return Github::Cache.new({}, logger: Sqlui.logger) unless ENV['USE_LOCAL_SAVED_FILES']
|
380
379
|
|
381
380
|
paths = Dir.glob('sql/**/*.sql')
|
382
|
-
blobs = paths.map
|
381
|
+
blobs = paths.map do |path|
|
382
|
+
{
|
383
|
+
'path' => path,
|
384
|
+
'url' => "https://api.github.com/repos/nicholasdower/sqlui/git/blobs/#{Base64.encode64(path)}"
|
385
|
+
}
|
386
|
+
end
|
383
387
|
github_cache_hash = {
|
384
388
|
'https://api.github.com/repos/nicholasdower/sqlui/git/trees/master?recursive=true' =>
|
385
389
|
Github::Cache::Entry.new(
|
@@ -391,7 +395,7 @@ class Server < Sinatra::Base
|
|
391
395
|
)
|
392
396
|
}
|
393
397
|
paths.each do |path|
|
394
|
-
github_cache_hash["https://api.github.com/repos/nicholasdower/sqlui/
|
398
|
+
github_cache_hash["https://api.github.com/repos/nicholasdower/sqlui/git/blobs/#{Base64.encode64(path)}"] =
|
395
399
|
Github::Cache::Entry.new(
|
396
400
|
{
|
397
401
|
'content' => Base64.encode64(File.read(path))
|
data/client/resources/sqlui.js
CHANGED
@@ -24931,12 +24931,12 @@
|
|
24931
24931
|
|
24932
24932
|
addEventListener('#submit-dropdown-button-copy-csv', 'click', () => {
|
24933
24933
|
if (window.sqlFetch?.result) {
|
24934
|
-
copyTextToClipboard(toCsv(window.sqlFetch.result.columns, window.sqlFetch.result.rows));
|
24934
|
+
copyTextToClipboard(toCsv(window.sqlFetch.result.columns, window.sqlFetch.result.rows) + '\n');
|
24935
24935
|
}
|
24936
24936
|
});
|
24937
24937
|
addEventListener('#submit-dropdown-button-copy-tsv', 'click', () => {
|
24938
24938
|
if (window.sqlFetch?.result) {
|
24939
|
-
copyTextToClipboard(toTsv(window.sqlFetch.result.columns, window.sqlFetch.result.rows));
|
24939
|
+
copyTextToClipboard(toTsv(window.sqlFetch.result.columns, window.sqlFetch.result.rows) + '\n');
|
24940
24940
|
}
|
24941
24941
|
});
|
24942
24942
|
addEventListener('#first-button', 'click', () => {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.83
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Dower
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|