pgtk 0.16.0 → 0.16.2

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: f5d316eba88319837e0e0076de690cb533c6d384e84c3bf02caf4bc71737ce76
4
- data.tar.gz: ffee85649afc871e9a639769ebee131019e93ad11a23a93726d4cc0768eb1186
3
+ metadata.gz: 0b04cd90c1011ad093997ba7f21cf0136104a7b4fb4de8d842c21794d3cf90ee
4
+ data.tar.gz: 2c042b596ccebaaffb4f0597d3211ed53c9b02918e0daf400c0f8706135f0854
5
5
  SHA512:
6
- metadata.gz: 38d446cdd29cd57eff8ba863f7c6f9a1fb9b18f490e6655eac0259c6945d5da2f6f0f5c18a6a4e7f55f7184c0408bc5f03228514ccbb1375c3974081b176450f
7
- data.tar.gz: d8fba0d7db2ea8645f33f843d2e304a24d3b4579854b0581a408258fa2d28eb455b05005b6a7a70ff44ec2643268632c2ab8bfc8f0ac7ddaf7f566414d03bb26
6
+ metadata.gz: cc9383ef551950dc82b2c825c11cc797965d38a29c2e4f1569b112035ea9ecf019e2437c6c50718fe001ff1bb8da0320da3d6b73fc305ce4ad3ab3d691bcea48
7
+ data.tar.gz: e72d1e3321a6326d9e8afa66b819e4ceee68d4dd0d5708c27c73df584b5979ea02708070d0c185c333177f430f6925693a3c700aad1658d4dee2e9ad3bdaa63f
data/.gitignore CHANGED
@@ -1,12 +1,12 @@
1
+
1
2
  .bundle/
2
3
  .DS_Store
3
4
  .idea/
4
5
  .yardoc/
5
6
  *.gem
7
+ **/.claude/settings.local.json
6
8
  coverage/
7
9
  doc/
8
10
  node_modules/
9
11
  rdoc/
10
12
  vendor/
11
-
12
- **/.claude/settings.local.json
data/Gemfile.lock CHANGED
@@ -25,8 +25,8 @@ GEM
25
25
  loog (> 0)
26
26
  tago (> 0)
27
27
  joined (0.1.0)
28
- json (2.11.3)
29
- language_server-protocol (3.17.0.4)
28
+ json (2.12.0)
29
+ language_server-protocol (3.17.0.5)
30
30
  lint_roller (1.1.0)
31
31
  logger (1.7.0)
32
32
  loog (0.6.1)
@@ -50,7 +50,7 @@ GEM
50
50
  pg (1.5.9)
51
51
  pg (1.5.9-x64-mingw-ucrt)
52
52
  prism (1.4.0)
53
- qbash (0.4.0)
53
+ qbash (0.4.5)
54
54
  backtrace (> 0)
55
55
  elapsed (> 0)
56
56
  loog (> 0)
@@ -63,7 +63,7 @@ GEM
63
63
  tago (> 0)
64
64
  regexp_parser (2.10.0)
65
65
  rexml (3.4.1)
66
- rubocop (1.75.5)
66
+ rubocop (1.75.6)
67
67
  json (~> 2.3)
68
68
  language_server-protocol (~> 3.17.0.2)
69
69
  lint_roller (~> 1.1.0)
data/lib/pgtk/stash.rb CHANGED
@@ -61,7 +61,7 @@ class Pgtk::Stash
61
61
  ret = @stash[:queries][pure][key]
62
62
  if ret.nil?
63
63
  ret = @pgsql.exec(pure, params)
64
- unless /(?<=^|\s)(NOW\(\)|COMMIT|ROLLBACK|START TRANSACTION|TRUNCATE|TO WARNING)(?=;|\s|$)/.match?(pure)
64
+ if pure.start_with?('SELECT ') && !pure.include?(' NOW() ')
65
65
  @entrance.with_write_lock do
66
66
  @stash[:queries][pure] ||= {}
67
67
  @stash[:queries][pure][key] = ret
data/lib/pgtk/version.rb CHANGED
@@ -11,5 +11,5 @@ require_relative '../pgtk'
11
11
  # License:: MIT
12
12
  module Pgtk
13
13
  # Current version of the library.
14
- VERSION = '0.16.0'
14
+ VERSION = '0.16.2'
15
15
  end
data/test/test_stash.rb CHANGED
@@ -22,6 +22,25 @@ class TestStash < Pgtk::Test
22
22
  end
23
23
  end
24
24
 
25
+ def test_non_trivial_queries
26
+ fake_pool do |pool|
27
+ pg = Pgtk::Stash.new(pool)
28
+ [
29
+ 'VACUUM FULL',
30
+ 'START TRANSACTION',
31
+ 'REINDEX TABLE book',
32
+ 'TRUNCATE book',
33
+ 'CREATE TABLE tmp (id INT)',
34
+ 'ALTER TABLE tmp ADD COLUMN foo INT',
35
+ 'DROP TABLE tmp',
36
+ 'SET client_min_messages TO WARNING',
37
+ "SET TIME ZONE 'America/Los_Angeles'"
38
+ ].each do |q|
39
+ pg.exec(q)
40
+ end
41
+ end
42
+ end
43
+
25
44
  def test_caching
26
45
  fake_pool do |pool|
27
46
  stash = Pgtk::Stash.new(pool)
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.16.0
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko