pgtk 0.21.1 → 0.21.3

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: 96d8784e334eb788333eb79d26c99c47f129ea8de8e522732fa37fa333b99a35
4
+ data.tar.gz: ec5caad7117ec1f22784c718316b2897effb907f03cd1043e7305a057d9412ee
5
5
  SHA512:
6
- metadata.gz: a2d6cd764921a72746bc2f7128d90f0a63e9d526a06950a03f5f8937da2c0384bd5956245dce3eaa40db91f85089c492dec8bc2c6c48e9d516ddeec9deff4779
7
- data.tar.gz: 3c34258ea93eb76b81813c3d1702d46d1df9843cda66bf58f7b5b53e6034ada597630c778efb54d3efa09c0aa9693992ca4d723a57097ca9d843026fa92605ff
6
+ metadata.gz: 2266b9797e6f49cecdd4f5e4b198f4d06d9060544a6e2eb89ca99c8f0a05a93e6674b6237af30569e6d474c08e13b02ac706cf9a96daf07938021cd61d518e51
7
+ data.tar.gz: 1b723ca7237b8d1e5381481599fd0850e2685fa411a37551360d78548ca0b29ea38da50b849dbad37c8cac1d65422cdcb488b1edd45d9025ccf67336ea586048
@@ -70,7 +70,7 @@ class Pgtk::Impatient
70
70
 
71
71
  # Start a new connection pool with the given arguments.
72
72
  def start!(*)
73
- @pool.start!
73
+ @pool.start!(*)
74
74
  end
75
75
 
76
76
  # Get the version of PostgreSQL server.
@@ -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/spy.rb CHANGED
@@ -58,7 +58,7 @@ class Pgtk::Spy
58
58
 
59
59
  # Start a new connection pool with the given arguments.
60
60
  def start!(*)
61
- @pool.start!
61
+ @pool.start!(*)
62
62
  end
63
63
 
64
64
  # Get the version of PostgreSQL server.
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.3'
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko