sqlui 0.1.78 → 0.1.80

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: 7fdba78eccb70ef82ef3bf76e4d27009962417de920b46dad487394edd5696c7
4
- data.tar.gz: 759c063ac9108a4badc3a0c4be5e271ffa8b4296c3450ab3470107884a54aa56
3
+ metadata.gz: 2748bb417cefe4c4a644ed39d186bffc5c4d2a17efa301abcd94562a5ae3b4ce
4
+ data.tar.gz: 319aa2fa1d11cd2fde367dda908ea3ef9c452661abc40c6c6b5c44871bf76034
5
5
  SHA512:
6
- metadata.gz: 86d7f635e0e36634b096ccc1859e90469d0a90d471db6bbfbad38f24ba99f016c99123d905ef21a1f1389c2d141b68bf64b0f1fe086545f404b8d8ae787a5ca1
7
- data.tar.gz: 1c5836479a4d0c92a31288672dc92d66c3b9eb4f86df95102e03234af6563736b970461278d4e6487b022bb010453b60a631a0472f2f97e57bb797d7560e722f
6
+ metadata.gz: f7192e72ea59c7b1b2f8877600844209598821dc6ded228e959b8d72f0d716403439c84197b097d5ff1a6fecb6452a6520ece7d4c1bac1b9b9b3bdd2f43be7e9
7
+ data.tar.gz: 4f0689ecaea729efe24bc219a987c33b47c1da356dedacaedc553715f4b17b4578948ce4de4c7fd9d5343c3884d1e32e69c921b71649bcbb206fc5c96be822f5
data/.release-version CHANGED
@@ -1 +1 @@
1
- 0.1.78
1
+ 0.1.80
@@ -18,7 +18,7 @@ module Github
18
18
  class TreeClient
19
19
  include Checks
20
20
 
21
- @thread_pool = Concurrent::FixedThreadPool.new(5)
21
+ @thread_pool = Concurrent::FixedThreadPool.new(3)
22
22
 
23
23
  class << self
24
24
  attr_reader :thread_pool
@@ -60,7 +60,7 @@ module Github
60
60
  end
61
61
  end
62
62
 
63
- latch.await(timeout: [10, tree_size / 2].max)
63
+ latch.await(timeout: 10 + tree_size)
64
64
  raise 'failed to load saved files' unless response['tree'].all? { |blob| blob['content'] }
65
65
 
66
66
  Tree.for(owner: owner, repo: repo, ref: ref, tree_response: response)
data/app/server.rb CHANGED
@@ -115,19 +115,22 @@ class Server < Sinatra::Base
115
115
 
116
116
  github_cache = create_github_cache
117
117
  config.database_configs.each do |database|
118
- # Prefetch all trees on startup. This should happen before the health endpoint is available.
119
118
  if (saved_config = database.saved_config)
120
119
  tree_client = Github::TreeClient.new(
121
120
  access_token: database.saved_config.token,
122
121
  cache: github_cache,
123
122
  logger: Sqlui.logger
124
123
  )
125
- tree_client.get_tree(
126
- owner: saved_config.owner,
127
- repo: saved_config.repo,
128
- ref: saved_config.branch,
129
- regex: saved_config.regex
130
- )
124
+ # Prefetch all trees on startup. This should happen before the health endpoint is available.
125
+ unless ENV.fetch('DISABLE_PREFETCH', '0') == '1'
126
+ Sqlui.logger.info 'prefetch'
127
+ tree_client.get_tree(
128
+ owner: saved_config.owner,
129
+ repo: saved_config.repo,
130
+ ref: saved_config.branch,
131
+ regex: saved_config.regex
132
+ )
133
+ end
131
134
  end
132
135
 
133
136
  get "#{config.base_url_path}/#{database.url_path}/?" do
@@ -24239,15 +24239,6 @@
24239
24239
  quoted: `${quotedQualifiedTableName} \`${alias}\``,
24240
24240
  unquoted: `${qualifiedTableName} ${alias}`
24241
24241
  });
24242
- // Add a completion which only inserts the alias for use with "select" or "where" or "on".
24243
- tables.push({
24244
- label: `${qualifiedTableName} ${alias}`,
24245
- boost: boost + 1,
24246
- type: 'constant',
24247
- completion_types: ['alias_only'],
24248
- quoted: '`' + alias + '`',
24249
- unquoted: alias
24250
- });
24251
24242
  tables.push({
24252
24243
  label: alias,
24253
24244
  boost: boost + 1,
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.78
4
+ version: 0.1.80
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-09 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport