pg 1.3.4-x64-mingw-ucrt → 1.3.5-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac325d3ce81fa0ce0f2fd03cd42ed77283da2cb8bb62c3d84e018ff71e384f68
4
- data.tar.gz: a777b7b738921a3e022d29d843dec3e0dee48c152944687adb12652e515e2edf
3
+ metadata.gz: 581108a2fd8cdafd26c16c788e819b412d906980f05f3155f66c61072f5106f2
4
+ data.tar.gz: ee36a17d4ea970219959b47b2a2ebd0322e7bb6f2e447d80779fa67a3c9067ca
5
5
  SHA512:
6
- metadata.gz: 1eb0261222d4fdd79ea35ae1c08bb1ab7bbdc0c247dd338b22eef5aca9bb62a86b7b203c75d3515d92513b86bb6949a1c9e6035df3009b56c9516b7febbd5c2d
7
- data.tar.gz: 789053bd4aba6588628ed5f1f3c7ee87eadae9ad913d516f93f6e3d13a7ecfa232a16e57de4f77ad9a870a3414fcd46332f4e73104443dc850ef7e0bf64dc692
6
+ metadata.gz: 44121e313bb5d53b42d546f50908e1ba72703ba5593ccbccddf33e370134c0065a7f3d5b8a497ca8d422db718f601c7acacfa6772f79cb6ecb5b2a6755f4c351
7
+ data.tar.gz: 26b7e27d5a551fd316f3d983f6a73c576b88b090ae73085209607841fb169c05a160aad9330ed5307d54da366f1ba7e1cf5e421854b0e422c047bad5ee17ab47
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,22 @@
1
+ == v1.3.5 [2022-03-31] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ Bugfixes:
4
+
5
+ - Handle PGRES_COMMAND_OK in pgresult_stream_any. #447
6
+ Fixes usage when trying to stream the result of a procedure call that returns no results.
7
+
8
+ Enhancements:
9
+
10
+ - Rename BasicTypeRegistry#define_default_types to #register_default_types to use a more consistent terminology.
11
+ Keeping define_default_types for compatibility.
12
+ - BasicTypeRegistry: return self instead of objects by accident.
13
+ This allows call chaining.
14
+ - Add some April fun. #449
15
+
16
+ Documentation:
17
+ - Refine documentation of conn.socket_io and conn.connect_poll
18
+
19
+
1
20
  == v1.3.4 [2022-03-10] Lars Kanis <lars@greiz-reinsdorf.de>
2
21
 
3
22
  Bugfixes:
data/ext/extconf.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # -*- encoding: utf-8 -*-
2
+
1
3
  require 'pp'
2
4
  require 'mkmf'
3
5
 
@@ -167,3 +169,32 @@ end
167
169
  create_header()
168
170
  create_makefile( "pg_ext" )
169
171
 
172
+
173
+ def message!(important_message)
174
+ message important_message
175
+ if !$stdout.tty? && File.chardev?('/dev/tty')
176
+ File.open('/dev/tty', 'w') do |tty|
177
+ tty.print important_message
178
+ end
179
+ end
180
+ rescue
181
+ end
182
+
183
+ if "2022-04-01" == Time.now.strftime("%Y-%m-%d")
184
+ message! <<-EOM
185
+ ===================================================================
186
+ HEADS UP! Prepare for pg-1.4.2022 ! 🎉🎉🎉
187
+
188
+ Now that psycopg3 has most of the features of ruby-pg, we plan to
189
+ switch to using it as our foundation for the next pg release.
190
+ It will run through pycall and requires a working python setup.
191
+ This will minimize our development and maintenance efforts, since
192
+ it allows us to use one and the same code base for both programming
193
+ languages - ruby and python. 👏😃
194
+
195
+ And we follow the recent merge of the Django and Rails teams! ❤️
196
+
197
+ Stay up-to-date at https://github.com/ged/ruby-pg/issues/449
198
+ ===================================================================
199
+ EOM
200
+ end
data/ext/pg_connection.c CHANGED
@@ -450,17 +450,18 @@ pgconn_s_encrypt_password(VALUE self, VALUE password, VALUE username)
450
450
  * the asynchronous connection is ready
451
451
  *
452
452
  * Example:
453
- * conn = PG::Connection.connect_start("dbname=mydatabase")
454
- * socket = conn.socket_io
453
+ * require "io/wait"
454
+ *
455
+ * conn = PG::Connection.connect_start(dbname: 'mydatabase')
455
456
  * status = conn.connect_poll
456
457
  * while(status != PG::PGRES_POLLING_OK) do
457
458
  * # do some work while waiting for the connection to complete
458
459
  * if(status == PG::PGRES_POLLING_READING)
459
- * if(not select([socket], [], [], 10.0))
460
+ * unless conn.socket_io.wait_readable(10.0)
460
461
  * raise "Asynchronous connection timed out!"
461
462
  * end
462
463
  * elsif(status == PG::PGRES_POLLING_WRITING)
463
- * if(not select([], [socket], [], 10.0))
464
+ * unless conn.socket_io.wait_writable(10.0)
464
465
  * raise "Asynchronous connection timed out!"
465
466
  * end
466
467
  * end
@@ -818,13 +819,15 @@ pgconn_socket(VALUE self)
818
819
  * call-seq:
819
820
  * conn.socket_io() -> IO
820
821
  *
821
- * Fetch a memorized IO object created from the Connection's underlying socket.
822
- * This object can be used for IO.select to wait for events while running
823
- * asynchronous API calls.
822
+ * Fetch an IO object created from the Connection's underlying socket.
823
+ * This object can be used per <tt>socket_io.wait_readable</tt>, <tt>socket_io.wait_writable</tt> or for <tt>IO.select</tt> to wait for events while running asynchronous API calls.
824
+ * <tt>IO#wait_*able</tt> is is <tt>Fiber.scheduler</tt> compatible in contrast to <tt>IO.select</tt>.
825
+ *
826
+ * The IO object can change while the connection is established, but is memorized afterwards.
827
+ * So be sure not to cache the IO object, but repeat calling <tt>conn.socket_io</tt> instead.
824
828
  *
825
- * Using this instead of #socket avoids the problem of the underlying connection
826
- * being closed by Ruby when an IO created using <tt>IO.for_fd(conn.socket)</tt>
827
- * goes out of scope. In contrast to #socket, it also works on Windows.
829
+ * Using this method also works on Windows in contrast to using #socket .
830
+ * It also avoids the problem of the underlying connection being closed by Ruby when an IO created using <tt>IO.for_fd(conn.socket)</tt> goes out of scope.
828
831
  */
829
832
  static VALUE
830
833
  pgconn_socket_io(VALUE self)
@@ -344,10 +344,12 @@ record_isspace(char ch)
344
344
  * oids = conn.exec( "SELECT (NULL::complex).*" )
345
345
  * # Build a type map (PG::TypeMapByColumn) for decoding the "complex" type
346
346
  * dtm = PG::BasicTypeMapForResults.new(conn).build_column_map( oids )
347
- * # Register a record decoder for decoding our type "complex"
348
- * PG::BasicTypeRegistry.register_coder(PG::TextDecoder::Record.new(type_map: dtm, name: "complex"))
349
- * # Apply the basic type registry to all results retrieved from the server
350
- * conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn)
347
+ * # Build a type map and populate with basic types
348
+ * btr = PG::BasicTypeRegistry.new.register_default_types
349
+ * # Register a new record decoder for decoding our type "complex"
350
+ * btr.register_coder(PG::TextDecoder::Record.new(type_map: dtm, name: "complex"))
351
+ * # Apply our basic type registry to all results retrieved from the server
352
+ * conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn, registry: btr)
351
353
  * # Now queries decode the "complex" type (and many basic types) automatically
352
354
  * conn.exec("SELECT * FROM my_table").to_a
353
355
  * # => [{"v1"=>[2.0, 3.0], "v2"=>[4.0, 5.0]}, {"v1"=>[6.0, 7.0], "v2"=>[8.0, 9.0]}]
data/ext/pg_result.c CHANGED
@@ -1457,6 +1457,7 @@ pgresult_stream_any(VALUE self, void (*yielder)(VALUE, int, int, void*), void* d
1457
1457
 
1458
1458
  switch( PQresultStatus(pgresult) ){
1459
1459
  case PGRES_TUPLES_OK:
1460
+ case PGRES_COMMAND_OK:
1460
1461
  if( ntuples == 0 )
1461
1462
  return self;
1462
1463
  rb_raise( rb_eInvalidResultStatus, "PG::Result is not in single row mode");
data/lib/3.1/pg_ext.so CHANGED
Binary file
@@ -22,7 +22,7 @@ require 'pg' unless defined?( PG )
22
22
  # end
23
23
  #
24
24
  # conn = PG.connect
25
- # regi = PG::BasicTypeRegistry.new.define_default_types
25
+ # regi = PG::BasicTypeRegistry.new.register_default_types
26
26
  # regi.register_type(0, 'inet', InetEncoder, InetDecoder)
27
27
  # conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn, registry: regi)
28
28
  class PG::BasicTypeRegistry
@@ -184,6 +184,7 @@ class PG::BasicTypeRegistry
184
184
  name = coder.name || raise(ArgumentError, "name of #{coder.inspect} must be defined")
185
185
  h[:encoder][name] = coder if coder.respond_to?(:encode)
186
186
  h[:decoder][name] = coder if coder.respond_to?(:decode)
187
+ self
187
188
  end
188
189
 
189
190
  # Register the given +encoder_class+ and/or +decoder_class+ for casting a PostgreSQL type.
@@ -193,6 +194,7 @@ class PG::BasicTypeRegistry
193
194
  def register_type(format, name, encoder_class, decoder_class)
194
195
  register_coder(encoder_class.new(name: name, format: format)) if encoder_class
195
196
  register_coder(decoder_class.new(name: name, format: format)) if decoder_class
197
+ self
196
198
  end
197
199
 
198
200
  # Alias the +old+ type to the +new+ type.
@@ -205,10 +207,11 @@ class PG::BasicTypeRegistry
205
207
  @coders_by_name[format][ende].delete(new)
206
208
  end
207
209
  end
210
+ self
208
211
  end
209
212
 
210
213
  # Populate the registry with all builtin types of ruby-pg
211
- def define_default_types
214
+ def register_default_types
212
215
  register_type 0, 'int2', PG::TextEncoder::Integer, PG::TextDecoder::Integer
213
216
  alias_type 0, 'int4', 'int2'
214
217
  alias_type 0, 'int8', 'int2'
@@ -281,8 +284,10 @@ class PG::BasicTypeRegistry
281
284
  self
282
285
  end
283
286
 
287
+ alias define_default_types register_default_types
288
+
284
289
  # @private
285
- DEFAULT_TYPE_REGISTRY = PG::BasicTypeRegistry.new.define_default_types
290
+ DEFAULT_TYPE_REGISTRY = PG::BasicTypeRegistry.new.register_default_types
286
291
 
287
292
  # Delegate class method calls to DEFAULT_TYPE_REGISTRY
288
293
  class << self
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.3.4'
3
+ VERSION = '1.3.5'
4
4
  end
Binary file
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  oL1mUdzB8KrZL4/WbG5YNX6UTtJbIOu9qEFbBAy4/jtIkJX+dlNoFwd4GXQW1YNO
37
37
  nA==
38
38
  -----END CERTIFICATE-----
39
- date: 2022-03-10 00:00:00.000000000 Z
39
+ date: 2022-03-31 00:00:00.000000000 Z
40
40
  dependencies: []
41
41
  description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
42
42
  9.3 and later.
@@ -173,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - ">="
175
175
  - !ruby/object:Gem::Version
176
- version: '2.5'
176
+ version: '3.1'
177
177
  - - "<"
178
178
  - !ruby/object:Gem::Version
179
179
  version: 3.2.dev
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- a�S��!��%V
2
- ,d
1
+ �S�B���Viq��MHn����� @��d'Š6�g�!�c=?�_����x0�T��2
2
+ t��d#�� ����Mt>;��y`���w�p`RѨ��.��S�T�w�Sˋ���_�kK%䟐������Ԭ�y)i�,P��D�π|V�����52�c���n�a��)�U�Y��m�7���#)�VBيN�R�qrs�k�����%�� �k&jMY1�+�f���8ݑc��Q��`}�AϨc�u?�z�9�����ԭ9��&�Źm��՜zE�