pgtk 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +5 -5
- data/Gemfile.lock +37 -46
- data/lib/pgtk/pool.rb +4 -1
- data/lib/pgtk/version.rb +1 -1
- data/pgtk.gemspec +4 -4
- data/test/test_pool.rb +14 -0
- 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: ba1f564ca75057059d4841d186429184eee90fd082807e40f7a055fd7e3c8cc8
|
4
|
+
data.tar.gz: e432222b259fcc4e3eb7a21da2c66e10b17dbbaa45584dc7a837a6dab2040b66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d16b146d433c8b2ee61e0baf25fb545c7983c277f4681f132e0d16d5aaf955806f6c0eafa7cdbc6f0eef8a0d45da063c9c025219c5068aa360b6fbe14e71cc5
|
7
|
+
data.tar.gz: bdac310f79c175c21401c5ad93372897fd955fab7449a49c3f9ae7dfac5ea7767d7a79d84a2d018ad397d0a9b980e4374c83d85b783a4c59a1cb144dbdab2cfb
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -23,11 +23,11 @@
|
|
23
23
|
source 'https://rubygems.org'
|
24
24
|
gemspec
|
25
25
|
|
26
|
-
gem 'minitest', '5.
|
27
|
-
gem 'rack', '3.
|
26
|
+
gem 'minitest', '5.24.1', require: false
|
27
|
+
gem 'rack', '3.1.7', require: false
|
28
28
|
gem 'rake', '13.2.1', require: false
|
29
|
-
gem 'rspec-rails', '6.1.
|
30
|
-
gem 'rubocop', '1.
|
31
|
-
gem 'rubocop-rspec', '
|
29
|
+
gem 'rspec-rails', '6.1.3', require: false
|
30
|
+
gem 'rubocop', '1.65.0', require: false
|
31
|
+
gem 'rubocop-rspec', '3.0.2', require: false
|
32
32
|
gem 'simplecov', '0.22.0', require: false
|
33
33
|
gem 'xcop', '0.7.1', require: false
|
data/Gemfile.lock
CHANGED
@@ -10,9 +10,9 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionpack (7.1.3.
|
14
|
-
actionview (= 7.1.3.
|
15
|
-
activesupport (= 7.1.3.
|
13
|
+
actionpack (7.1.3.4)
|
14
|
+
actionview (= 7.1.3.4)
|
15
|
+
activesupport (= 7.1.3.4)
|
16
16
|
nokogiri (>= 1.8.5)
|
17
17
|
racc
|
18
18
|
rack (>= 2.2.4)
|
@@ -20,13 +20,13 @@ GEM
|
|
20
20
|
rack-test (>= 0.6.3)
|
21
21
|
rails-dom-testing (~> 2.2)
|
22
22
|
rails-html-sanitizer (~> 1.6)
|
23
|
-
actionview (7.1.3.
|
24
|
-
activesupport (= 7.1.3.
|
23
|
+
actionview (7.1.3.4)
|
24
|
+
activesupport (= 7.1.3.4)
|
25
25
|
builder (~> 3.1)
|
26
26
|
erubi (~> 1.11)
|
27
27
|
rails-dom-testing (~> 2.2)
|
28
28
|
rails-html-sanitizer (~> 1.6)
|
29
|
-
activesupport (7.1.3.
|
29
|
+
activesupport (7.1.3.4)
|
30
30
|
base64
|
31
31
|
bigdecimal
|
32
32
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -40,19 +40,19 @@ GEM
|
|
40
40
|
backtrace (0.4.0)
|
41
41
|
base64 (0.2.0)
|
42
42
|
bigdecimal (3.1.8)
|
43
|
-
builder (3.
|
44
|
-
concurrent-ruby (1.
|
43
|
+
builder (3.3.0)
|
44
|
+
concurrent-ruby (1.3.3)
|
45
45
|
connection_pool (2.4.1)
|
46
46
|
crass (1.0.6)
|
47
47
|
diff-lcs (1.5.1)
|
48
48
|
differ (0.1.2)
|
49
49
|
docile (1.4.0)
|
50
50
|
drb (2.2.1)
|
51
|
-
erubi (1.
|
51
|
+
erubi (1.13.0)
|
52
52
|
i18n (1.14.5)
|
53
53
|
concurrent-ruby (~> 1.0)
|
54
54
|
io-console (0.7.2)
|
55
|
-
irb (1.
|
55
|
+
irb (1.14.0)
|
56
56
|
rdoc (>= 4.0.0)
|
57
57
|
reline (>= 0.4.2)
|
58
58
|
json (2.7.2)
|
@@ -60,22 +60,22 @@ GEM
|
|
60
60
|
loofah (2.22.0)
|
61
61
|
crass (~> 1.0.2)
|
62
62
|
nokogiri (>= 1.12.0)
|
63
|
-
loog (0.5.
|
64
|
-
minitest (5.
|
63
|
+
loog (0.5.2)
|
64
|
+
minitest (5.24.1)
|
65
65
|
mutex_m (0.2.0)
|
66
|
-
nokogiri (1.16.
|
66
|
+
nokogiri (1.16.6-arm64-darwin)
|
67
67
|
racc (~> 1.4)
|
68
|
-
nokogiri (1.16.
|
68
|
+
nokogiri (1.16.6-x86_64-linux)
|
69
69
|
racc (~> 1.4)
|
70
|
-
parallel (1.
|
71
|
-
parser (3.3.
|
70
|
+
parallel (1.25.1)
|
71
|
+
parser (3.3.4.0)
|
72
72
|
ast (~> 2.4.1)
|
73
73
|
racc
|
74
74
|
pg (1.5.6)
|
75
75
|
psych (5.1.2)
|
76
76
|
stringio
|
77
77
|
racc (1.8.0)
|
78
|
-
rack (3.
|
78
|
+
rack (3.1.7)
|
79
79
|
rack-session (2.0.0)
|
80
80
|
rack (>= 3.0.0)
|
81
81
|
rack-test (2.1.0)
|
@@ -90,9 +90,9 @@ GEM
|
|
90
90
|
rails-html-sanitizer (1.6.0)
|
91
91
|
loofah (~> 2.21)
|
92
92
|
nokogiri (~> 1.14)
|
93
|
-
railties (7.1.3.
|
94
|
-
actionpack (= 7.1.3.
|
95
|
-
activesupport (= 7.1.3.
|
93
|
+
railties (7.1.3.4)
|
94
|
+
actionpack (= 7.1.3.4)
|
95
|
+
activesupport (= 7.1.3.4)
|
96
96
|
irb
|
97
97
|
rackup (>= 1.0.0)
|
98
98
|
rake (>= 12.2)
|
@@ -100,23 +100,23 @@ GEM
|
|
100
100
|
zeitwerk (~> 2.6)
|
101
101
|
rainbow (3.1.1)
|
102
102
|
rake (13.2.1)
|
103
|
-
random-port (0.
|
103
|
+
random-port (0.7.0)
|
104
104
|
rdoc (6.7.0)
|
105
105
|
psych (>= 4.0.0)
|
106
106
|
regexp_parser (2.9.2)
|
107
|
-
reline (0.5.
|
107
|
+
reline (0.5.9)
|
108
108
|
io-console (~> 0.5)
|
109
|
-
rexml (3.
|
110
|
-
strscan
|
109
|
+
rexml (3.3.1)
|
110
|
+
strscan
|
111
111
|
rspec-core (3.13.0)
|
112
112
|
rspec-support (~> 3.13.0)
|
113
|
-
rspec-expectations (3.13.
|
113
|
+
rspec-expectations (3.13.1)
|
114
114
|
diff-lcs (>= 1.2.0, < 2.0)
|
115
115
|
rspec-support (~> 3.13.0)
|
116
116
|
rspec-mocks (3.13.1)
|
117
117
|
diff-lcs (>= 1.2.0, < 2.0)
|
118
118
|
rspec-support (~> 3.13.0)
|
119
|
-
rspec-rails (6.1.
|
119
|
+
rspec-rails (6.1.3)
|
120
120
|
actionpack (>= 6.1)
|
121
121
|
activesupport (>= 6.1)
|
122
122
|
railties (>= 6.1)
|
@@ -125,30 +125,21 @@ GEM
|
|
125
125
|
rspec-mocks (~> 3.13)
|
126
126
|
rspec-support (~> 3.13)
|
127
127
|
rspec-support (3.13.1)
|
128
|
-
rubocop (1.
|
128
|
+
rubocop (1.65.0)
|
129
129
|
json (~> 2.3)
|
130
130
|
language_server-protocol (>= 3.17.0)
|
131
131
|
parallel (~> 1.10)
|
132
132
|
parser (>= 3.3.0.2)
|
133
133
|
rainbow (>= 2.2.2, < 4.0)
|
134
|
-
regexp_parser (>=
|
134
|
+
regexp_parser (>= 2.4, < 3.0)
|
135
135
|
rexml (>= 3.2.5, < 4.0)
|
136
136
|
rubocop-ast (>= 1.31.1, < 2.0)
|
137
137
|
ruby-progressbar (~> 1.7)
|
138
138
|
unicode-display_width (>= 2.4.0, < 3.0)
|
139
139
|
rubocop-ast (1.31.3)
|
140
140
|
parser (>= 3.3.1.0)
|
141
|
-
rubocop-
|
142
|
-
rubocop (~> 1.
|
143
|
-
rubocop-factory_bot (2.25.1)
|
144
|
-
rubocop (~> 1.41)
|
145
|
-
rubocop-rspec (2.29.2)
|
146
|
-
rubocop (~> 1.40)
|
147
|
-
rubocop-capybara (~> 2.17)
|
148
|
-
rubocop-factory_bot (~> 2.22)
|
149
|
-
rubocop-rspec_rails (~> 2.28)
|
150
|
-
rubocop-rspec_rails (2.28.3)
|
151
|
-
rubocop (~> 1.40)
|
141
|
+
rubocop-rspec (3.0.2)
|
142
|
+
rubocop (~> 1.61)
|
152
143
|
ruby-progressbar (1.13.0)
|
153
144
|
simplecov (0.22.0)
|
154
145
|
docile (~> 1.1)
|
@@ -157,7 +148,7 @@ GEM
|
|
157
148
|
simplecov-html (0.12.3)
|
158
149
|
simplecov_json_formatter (0.1.4)
|
159
150
|
slop (4.10.1)
|
160
|
-
stringio (3.1.
|
151
|
+
stringio (3.1.1)
|
161
152
|
strscan (3.1.0)
|
162
153
|
thor (1.3.1)
|
163
154
|
tzinfo (2.0.6)
|
@@ -169,20 +160,20 @@ GEM
|
|
169
160
|
nokogiri (~> 1.10)
|
170
161
|
rainbow (~> 3.0)
|
171
162
|
slop (~> 4.4)
|
172
|
-
zeitwerk (2.6.
|
163
|
+
zeitwerk (2.6.16)
|
173
164
|
|
174
165
|
PLATFORMS
|
175
166
|
arm64-darwin-22
|
176
167
|
x86_64-linux
|
177
168
|
|
178
169
|
DEPENDENCIES
|
179
|
-
minitest (= 5.
|
170
|
+
minitest (= 5.24.1)
|
180
171
|
pgtk!
|
181
|
-
rack (= 3.
|
172
|
+
rack (= 3.1.7)
|
182
173
|
rake (= 13.2.1)
|
183
|
-
rspec-rails (= 6.1.
|
184
|
-
rubocop (= 1.
|
185
|
-
rubocop-rspec (=
|
174
|
+
rspec-rails (= 6.1.3)
|
175
|
+
rubocop (= 1.65.0)
|
176
|
+
rubocop-rspec (= 3.0.2)
|
186
177
|
simplecov (= 0.22.0)
|
187
178
|
xcop (= 0.7.1)
|
188
179
|
|
data/lib/pgtk/pool.rb
CHANGED
data/lib/pgtk/version.rb
CHANGED
data/pgtk.gemspec
CHANGED
@@ -42,9 +42,9 @@ connection pool and query processor, to make SQL manipulation simpler.'
|
|
42
42
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
43
43
|
s.rdoc_options = ['--charset=UTF-8']
|
44
44
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
45
|
-
s.
|
46
|
-
s.
|
47
|
-
s.
|
48
|
-
s.
|
45
|
+
s.add_dependency 'backtrace', '~> 0.3'
|
46
|
+
s.add_dependency 'loog', '~> 0.2'
|
47
|
+
s.add_dependency 'pg', '~> 1.1'
|
48
|
+
s.add_dependency 'random-port', '~> 0.3'
|
49
49
|
s.metadata['rubygems_mfa_required'] = 'true'
|
50
50
|
end
|
data/test/test_pool.rb
CHANGED
@@ -90,6 +90,20 @@ class TestPool < Minitest::Test
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
def test_transaction_with_error
|
94
|
+
bootstrap do |pool|
|
95
|
+
pool.exec('DELETE FROM book')
|
96
|
+
assert(pool.exec('SELECT * FROM book').empty?)
|
97
|
+
assert_raises do
|
98
|
+
pool.transaction do |t|
|
99
|
+
t.exec('INSERT INTO book (title) VALUES ($1)', ['hey'])
|
100
|
+
t.exec('INSERT INTO book (error_here) VALUES ($1)', ['hey'])
|
101
|
+
end
|
102
|
+
end
|
103
|
+
assert(pool.exec('SELECT * FROM book').empty?)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
93
107
|
def test_reconnects_on_pg_error
|
94
108
|
bootstrap do |pool|
|
95
109
|
assert_raises PG::UndefinedTable do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgtk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|