pgtk 0.21.1 → 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: 7aafa6855949c2d53a9dbe211ea2fa398127195d82f295885ca1c2bea3f44c6d
4
- data.tar.gz: 2b667ab6b48c439342897bde8ff23eaa43123ca1ca343bb742f9cef91282aeaf
3
+ metadata.gz: 8c4312f7ff754c9a2d026c15f22742314ca720868e13a5702d6f6ee523bbe584
4
+ data.tar.gz: d5d2cfed230f56c980cb2c2d98210c9a7a38afa22e607e27d476b91b60a41f72
5
5
  SHA512:
6
- metadata.gz: a2d6cd764921a72746bc2f7128d90f0a63e9d526a06950a03f5f8937da2c0384bd5956245dce3eaa40db91f85089c492dec8bc2c6c48e9d516ddeec9deff4779
7
- data.tar.gz: 3c34258ea93eb76b81813c3d1702d46d1df9843cda66bf58f7b5b53e6034ada597630c778efb54d3efa09c0aa9693992ca4d723a57097ca9d843026fa92605ff
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/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.1'
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.1
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko