pgtk 0.5.1 → 0.6.0
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 +4 -4
- data/lib/pgtk/pool.rb +5 -0
- data/lib/pgtk/version.rb +1 -1
- data/test/test_pool.rb +7 -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: 7293e42c36671150eaed8552af95773be01e5cd4e4b14b8676ea344ef2605b7b
|
4
|
+
data.tar.gz: 64b75a87d6a4da5f1d08838b6cf78b33d04b803c045d94bb1e8417b604159a90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a0f3303e20d5db61f551c92f9bab742ba7054a6dc1eb8b0d6f509ab7107fdbd34e25328e08e49d099e361bede1772524b31bc46bb4c228104929b6646a9bf2f
|
7
|
+
data.tar.gz: a38b061fea757147e8b482702ef22953c00a71697f1d24a9b43166be22052fec451440d504fef45798056dae2c71ec70d9fcd661fc9b9a5e5b3b0dc5adcce0fc
|
data/lib/pgtk/pool.rb
CHANGED
@@ -57,6 +57,11 @@ class Pgtk::Pool
|
|
57
57
|
@log = Log.new(log)
|
58
58
|
end
|
59
59
|
|
60
|
+
# Get the version of PostgreSQL server.
|
61
|
+
def version
|
62
|
+
@version ||= exec('SHOW server_version')[0]['server_version']
|
63
|
+
end
|
64
|
+
|
60
65
|
# Start it with a fixed number of connections. The amount of connections
|
61
66
|
# is specified in +max+ argument and should be big enough to handle
|
62
67
|
# the amount of parallel connections you may have to the database. However,
|
data/lib/pgtk/version.rb
CHANGED
data/test/test_pool.rb
CHANGED
@@ -33,6 +33,13 @@ require_relative '../lib/pgtk/pool'
|
|
33
33
|
# Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
|
34
34
|
# License:: MIT
|
35
35
|
class TestPool < Minitest::Test
|
36
|
+
def test_reads_version
|
37
|
+
bootstrap do |pool|
|
38
|
+
ver = pool.version
|
39
|
+
assert(ver.start_with?('1'))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
36
43
|
def test_basic
|
37
44
|
bootstrap do |pool|
|
38
45
|
id = pool.exec(
|
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.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|