pgtk 0.21.0 → 0.21.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: e46e57835cc795fd4c73ef4016911c17cf3e088ddadda330f72a25efe56aa8c5
4
- data.tar.gz: e921ed037a9b9ea1291513959bc73809fb615dac2e1f35a5f74d272514596396
3
+ metadata.gz: 8c4312f7ff754c9a2d026c15f22742314ca720868e13a5702d6f6ee523bbe584
4
+ data.tar.gz: d5d2cfed230f56c980cb2c2d98210c9a7a38afa22e607e27d476b91b60a41f72
5
5
  SHA512:
6
- metadata.gz: bdffbbdd4ee6e868ec6b61a7cc9d674f4ba17db9cf968b49fa6dbc3e6a92f9edc25d31f439fa30bbb3aab6a6d7ceac12a4b63e752bde38659f54dafa0ea2d67f
7
- data.tar.gz: af7a104cffffd53bbdcb6a4a25666115fae8f0b5f312971a1244ce28030acdca11d673d244fb4303fcfe9594928e107ea69fc9070ebecc2e23f6d7533dbb4376
6
+ metadata.gz: '0284be738c2c460451cf56de2f3f48fbd317c1dc095f0540029123a8ead67d3736f80f34ebf5c37f33350a4740b4cc3e0030f0d7d8dbdf21678136b24f9fa2b9'
7
+ data.tar.gz: 3c470182199839217c6091fd7e99ed6c5551a21f79a8e0b93c2eb4227eb9d8f4194543e2342c9d5579b6b1758c250ad4de48e690f984c7fcdb4b9c0723dc5715
@@ -92,11 +92,12 @@ class Pgtk::Impatient
92
92
 
93
93
  # Execute a SQL query with a timeout.
94
94
  #
95
- # @param [String] sql The SQL query with params inside (possibly)
95
+ # @param [String, Array] query The SQL query with params inside (possibly)
96
96
  # @param [Array] args List of arguments
97
97
  # @return [Array] Result rows
98
98
  # @raise [Timeout::Error] If the query takes too long
99
- def exec(sql, *args)
99
+ def exec(query, *args)
100
+ sql = query.is_a?(Array) ? query.join(' ') : query
100
101
  return @pool.exec(sql, *args) if @off.any? { |re| re.match?(sql) }
101
102
  start = Time.now
102
103
  token = SecureRandom.uuid
data/lib/pgtk/pool.rb CHANGED
@@ -70,10 +70,11 @@ class Pgtk::Pool
70
70
  # @return [String] Summary of inner state
71
71
  def dump
72
72
  [
73
- "PgSQL version: #{version}",
74
- "#{@pool.size} connections:",
73
+ 'Pgtk::Pool',
74
+ " PgSQL version: #{version}",
75
+ " #{@pool.size} connections:",
75
76
  @pool.map do |c|
76
- " ##{c.backend_pid} #{c.pipeline_status} #{c.status} #{c.transaction_status}"
77
+ " ##{c.backend_pid} #{c.pipeline_status} #{c.status} #{c.transaction_status}"
77
78
  end
78
79
  ].flatten.join("\n")
79
80
  end
data/lib/pgtk/retry.rb CHANGED
@@ -57,6 +57,11 @@ class Pgtk::Retry
57
57
  @attempts = attempts
58
58
  end
59
59
 
60
+ # Start a new connection pool with the given arguments.
61
+ def start!(*)
62
+ @pool.start!(*)
63
+ end
64
+
60
65
  # Get the version of PostgreSQL server.
61
66
  #
62
67
  # @return [String] Version of PostgreSQL server
data/lib/pgtk/stash.rb CHANGED
@@ -66,6 +66,12 @@ class Pgtk::Stash
66
66
  @loog = loog
67
67
  end
68
68
 
69
+ # Start a new connection pool with the given arguments.
70
+ def start!(*)
71
+ launch!
72
+ @pool.start!(*)
73
+ end
74
+
69
75
  # Get the PostgreSQL server version.
70
76
  # @return [String] Version string of the database server
71
77
  def version
@@ -162,12 +168,6 @@ class Pgtk::Stash
162
168
  end
163
169
  end
164
170
 
165
- # Start a new connection pool with the given arguments.
166
- def start!(*)
167
- launch!
168
- @pool.start!(*)
169
- end
170
-
171
171
  private
172
172
 
173
173
  def launch!
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.21.0'
14
+ VERSION = '0.21.2'
15
15
  end
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.21.0
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko