pg 1.3.4-x64-mingw32 → 1.3.5-x64-mingw32

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: 1981a4769812c249e6947ba779c35c0676ebf209336b11454bca586c143c4614
4
- data.tar.gz: 8a3c4cc4583b858054640d5174beffc9ba723740343304d69ec2fcf0eaba7baa
3
+ metadata.gz: 7965cb8a9df4211aebf7f99b750c0ef69dc83605910c85664df63eb5c7d588c7
4
+ data.tar.gz: dea515def7a213a64bcf0b32a429560de2c9fedc83f6d2cfde346bbcb6f553b3
5
5
  SHA512:
6
- metadata.gz: 6dca120d41d0c07ae7994b5098f74aaf04057effdd8a5362605a7dcfd7056ce7dcdb5b6dd36677cb7b504ec7527ce147dc15f7b757eab10b8367de3eb17c337d
7
- data.tar.gz: ea12c4f6f73f0b6ce4e61bffdd47ebf5baf9e74fb7cff961db76d5a424211ffc50b16571531737ad44c2d6b87e920b7a4f508f5f186c0d404572c8998195a1c3
6
+ metadata.gz: 2baa94ea0e464d83fa02fac4012c91f5e26d7b48b6535534ca7291668f37f1b91014996690a1e2ece295e31243d8673716fa7e7320b4a830b2bca91b7ec953eb
7
+ data.tar.gz: ab595e6481dca8acb22ce66649c44b232a8b4dd72039bd1a1db80d5e3d3f3e6c9e32308e39aced78e25949e1c0361416dd9cfbea857f5f252dd5fbe1ebfc04b7
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/2.5/pg_ext.so CHANGED
Binary file
data/lib/2.6/pg_ext.so CHANGED
Binary file
data/lib/2.7/pg_ext.so CHANGED
Binary file
data/lib/3.0/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-mingw32
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.
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
179
  version: '2.5'
180
180
  - - "<"
181
181
  - !ruby/object:Gem::Version
182
- version: 3.2.dev
182
+ version: 3.1.dev
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="
metadata.gz.sig CHANGED
Binary file