pgtk 0.32.1 → 0.32.3

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: 99d205db0612071b4a609acd0cc94bea3c032742cf3bacbe37aa05c8213a88f3
4
- data.tar.gz: f9ba543f04eb5639d276472ab2cc8a5ab0c9a714a22f8b042d1b6d63d2b5b51b
3
+ metadata.gz: 88d74c18619134011d6187d976ef4b2156e1d5e629399ce8accf9962458e011f
4
+ data.tar.gz: 76cfad9774a3c1872ea8204112b441bdf92f5b34fce1845356e7cf37496e21d8
5
5
  SHA512:
6
- metadata.gz: 3a3e45f7f09b28830164913bc952d6835f3deeab8f6e02f984a9364d694ea3eca82dd6924da8d3378317e46db55997c82834804eb342a140b3646ee73f56ab0d
7
- data.tar.gz: f5f76023aee057117b9e03fece17928a76c628e8371d3e94d6cccff0ad5a86695585aae0b7f5350653f7ecfa31aee93c2ba3f68088518e94716bc5183ab4f5db
6
+ metadata.gz: 1c4d9b98f94558363813c59d0a55a6a60a40ceefa7c25e9e831aa588175b90c8ee65f41e0c9b0bf89c52f0823ceffc80381ad741dad2d12e8a81c368880b36b0
7
+ data.tar.gz: 16995fbc6540edcd37982b69b0b3222d8bb5d9b4094ba5477500d3250795c672282ecc1611443bb1357f675cf5534d115d0742b13d9c42f30abc0b77c198e7cf
data/Gemfile.lock CHANGED
@@ -35,7 +35,7 @@ GEM
35
35
  tago (~> 0.1)
36
36
  ellipsized (0.3.0)
37
37
  joined (0.4.0)
38
- json (2.19.4)
38
+ json (2.19.5)
39
39
  language_server-protocol (3.17.0.5)
40
40
  lint_roller (1.1.0)
41
41
  logger (1.7.0)
@@ -52,21 +52,21 @@ GEM
52
52
  minitest (>= 5.0, < 7)
53
53
  ruby-progressbar
54
54
  minitest-stub-const (0.6)
55
- nokogiri (1.19.2-aarch64-linux-gnu)
55
+ nokogiri (1.19.3-aarch64-linux-gnu)
56
56
  racc (~> 1.4)
57
- nokogiri (1.19.2-aarch64-linux-musl)
57
+ nokogiri (1.19.3-aarch64-linux-musl)
58
58
  racc (~> 1.4)
59
- nokogiri (1.19.2-arm-linux-gnu)
59
+ nokogiri (1.19.3-arm-linux-gnu)
60
60
  racc (~> 1.4)
61
- nokogiri (1.19.2-arm-linux-musl)
61
+ nokogiri (1.19.3-arm-linux-musl)
62
62
  racc (~> 1.4)
63
- nokogiri (1.19.2-arm64-darwin)
63
+ nokogiri (1.19.3-arm64-darwin)
64
64
  racc (~> 1.4)
65
- nokogiri (1.19.2-x86_64-darwin)
65
+ nokogiri (1.19.3-x86_64-darwin)
66
66
  racc (~> 1.4)
67
- nokogiri (1.19.2-x86_64-linux-gnu)
67
+ nokogiri (1.19.3-x86_64-linux-gnu)
68
68
  racc (~> 1.4)
69
- nokogiri (1.19.2-x86_64-linux-musl)
69
+ nokogiri (1.19.3-x86_64-linux-musl)
70
70
  racc (~> 1.4)
71
71
  os (1.1.4)
72
72
  parallel (2.0.1)
@@ -94,7 +94,7 @@ GEM
94
94
  tago (~> 0.0)
95
95
  regexp_parser (2.12.0)
96
96
  rexml (3.4.4)
97
- rubocop (1.86.1)
97
+ rubocop (1.86.2)
98
98
  json (~> 2.3)
99
99
  language_server-protocol (~> 3.17.0.2)
100
100
  lint_roller (~> 1.1.0)
data/lib/pgtk/stash.rb CHANGED
@@ -32,12 +32,16 @@ class Pgtk::Stash
32
32
  MODS = %w[INSERT DELETE UPDATE LOCK VACUUM TRANSACTION COMMIT ROLLBACK REINDEX TRUNCATE CREATE ALTER DROP SET].freeze
33
33
  MODS_RE = Regexp.new("(^|\\s)(#{MODS.join('|')})(\\s|$)")
34
34
 
35
+ IDENT = '[a-z_][a-z0-9_]*'
36
+
35
37
  ALTS = ['UPDATE', 'INSERT INTO', 'DELETE FROM', 'TRUNCATE', 'ALTER TABLE', 'DROP TABLE'].freeze
36
- ALTS_RE = Regexp.new("(?<=^|\\s)(?:#{ALTS.join('|')})\\s([a-z]+)(?=[^a-z]|$)")
38
+ ALTS_RE = Regexp.new("(?<=^|\\s)(?:#{ALTS.join('|')})\\s(#{IDENT})(?=[^a-z0-9_]|$)")
39
+
40
+ READS_RE = Regexp.new("(?<=^|\\s)(?:FROM|JOIN)\\s(#{IDENT})(?=\\s|;|$)")
37
41
 
38
42
  SEPARATOR = ' --%*@#~($-- '
39
43
 
40
- private_constant :MODS, :ALTS, :MODS_RE, :ALTS_RE, :SEPARATOR
44
+ private_constant :MODS, :ALTS, :IDENT, :MODS_RE, :ALTS_RE, :READS_RE, :SEPARATOR
41
45
 
42
46
  # Initialize a new Stash with query caching.
43
47
  #
@@ -223,10 +227,11 @@ class Pgtk::Stash
223
227
  @entrance.with_write_lock do
224
228
  affected.each do |t|
225
229
  old = @stash[:table_mod][t]
226
- @stash[:table_mod][t] = old && old > now ? old : now
230
+ stamp = old && old > now ? old : now
231
+ @stash[:table_mod][t] = stamp
227
232
  @stash[:tables][t]&.each do |q|
228
233
  @stash[:queries][q]&.each_key do |key|
229
- @stash[:queries][q][key][:stale] = now
234
+ @stash[:queries][q][key][:stale] = stamp
230
235
  end
231
236
  end
232
237
  end
@@ -238,7 +243,7 @@ class Pgtk::Stash
238
243
  key = params.join(SEPARATOR)
239
244
  ret = @stash.dig(:queries, pure, key, :ret)
240
245
  if ret.nil? || @stash.dig(:queries, pure, key, :stale)
241
- tables = pure.scan(/(?<=^|\s)(?:FROM|JOIN) ([a-z_]+)(?=\s|;|$)/).flatten
246
+ tables = pure.scan(READS_RE).flatten
242
247
  tables.uniq!
243
248
  marks = tables.to_h { |t| [t, @stash[:table_mod][t]] }
244
249
  ret = @pool.exec(pure, params, result)
data/lib/pgtk/version.rb CHANGED
@@ -10,5 +10,5 @@ require_relative '../pgtk'
10
10
  # Copyright:: Copyright (c) 2019-2026 Yegor Bugayenko
11
11
  # License:: MIT
12
12
  module Pgtk
13
- VERSION = '0.32.1' unless defined?(VERSION)
13
+ VERSION = '0.32.3' unless defined?(VERSION)
14
14
  end
data/resources/pom.xml CHANGED
@@ -11,7 +11,7 @@
11
11
  <packaging>pom</packaging>
12
12
  <properties>
13
13
  <postgresql.version>42.7.11</postgresql.version>
14
- <liquibase.version>5.0.2</liquibase.version>
14
+ <liquibase.version>5.0.3</liquibase.version>
15
15
  </properties>
16
16
  <dependencies>
17
17
  <dependency>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgtk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.1
4
+ version: 0.32.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko