pg 1.3.0.rc2-x86-mingw32 → 1.3.0.rc3-x86-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: fbf738a155a8bfb9b2476e2dc0e6d96e81beeb996b26eaed3d8f81e404493010
4
- data.tar.gz: fb06a6941a5ff08ac1a56f86f2fe7a19eb1e5a888fb02ff56621071c91d1c759
3
+ metadata.gz: 5bef00da7bdb5806dec24d5bbf7bae1169e8d68bb03158a0f16869bebf70cab4
4
+ data.tar.gz: b9faa4e1655663d53156fb27fa1da4d1435008f3e95d2d88dfc826a7efb60ef0
5
5
  SHA512:
6
- metadata.gz: 1711b8d508ce6fb63e4ad8a3735d11cdee732c232f833a68ae11254f6837b4ee9873ff2bdd810a6786f9e0e19738e1155210c0739f967d6d1bfc6193817ac6b1
7
- data.tar.gz: 9159739ae3b2ef97e38bdcee2a2a5e2a060060230e53731ea9b1a6fc131f456d845f65814282ee7ad403ec3ecc0671c180f2b00682ce2383e425b0a7cf3a7343
6
+ metadata.gz: e998da24080f6d3f7b2111eb549f694053539a262fdf131cb1a21be236fe070f03c8fe107faacb46dec3602cdb29e5ec28e64f225b19580ae8503d9d68d3d6c3
7
+ data.tar.gz: 9a0610d0323686408b86cf13013ce376de4fcc1629c79ed92f4cf57da0dc11f571978f94b1a97b323b50b538ed95362b383ebf5c3fd979ba50f38a050821e6f5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -113,7 +113,6 @@ jobs:
113
113
  - run: bundle install
114
114
 
115
115
  - run: gem install --local *.gem --verbose
116
- continue-on-error: ${{ matrix.ruby == 'truffleruby-head' }}
117
116
 
118
117
  - name: Run specs
119
118
  continue-on-error: ${{ matrix.ruby == 'truffleruby-head' }}
data/ext/pg_connection.c CHANGED
@@ -968,8 +968,8 @@ static VALUE pgconn_sync_exec_params( int, VALUE *, VALUE );
968
968
  * However #async_exec has two advantages:
969
969
  *
970
970
  * 1. #async_exec can be aborted by signals (like Ctrl-C), while #exec blocks signal processing until the query is answered.
971
- * 2. Ruby VM gets notified about IO blocked operations.
972
- * It can therefore schedule things like garbage collection, while queries are running like in this proposal: https://bugs.ruby-lang.org/issues/14723
971
+ * 2. Ruby VM gets notified about IO blocked operations and can pass them through <tt>Fiber.scheduler</tt>.
972
+ * So only <tt>async_*</tt> methods are compatible to event based schedulers like the async gem.
973
973
  */
974
974
  static VALUE
975
975
  pgconn_sync_exec(int argc, VALUE *argv, VALUE self)
@@ -2208,17 +2208,25 @@ pgconn_notifies(VALUE self)
2208
2208
  }
2209
2209
 
2210
2210
 
2211
- #if !defined(HAVE_RB_IO_WAIT)
2211
+ #if defined(HAVE_RB_IO_WAIT)
2212
+
2213
+ /* Use our own function and constants names, to avoid conflicts with truffleruby-head on its road to ruby-3.0 compatibility. */
2214
+ #define pg_rb_io_wait rb_io_wait
2215
+ #define PG_RUBY_IO_READABLE RUBY_IO_READABLE
2216
+ #define PG_RUBY_IO_WRITABLE RUBY_IO_WRITABLE
2217
+ #define PG_RUBY_IO_PRIORITY RUBY_IO_PRIORITY
2218
+
2219
+ #else
2212
2220
  /* For compat with ruby < 3.0 */
2213
2221
 
2214
2222
  typedef enum {
2215
- RUBY_IO_READABLE = RB_WAITFD_IN,
2216
- RUBY_IO_WRITABLE = RB_WAITFD_OUT,
2217
- RUBY_IO_PRIORITY = RB_WAITFD_PRI,
2218
- } rb_io_event_t;
2223
+ PG_RUBY_IO_READABLE = RB_WAITFD_IN,
2224
+ PG_RUBY_IO_WRITABLE = RB_WAITFD_OUT,
2225
+ PG_RUBY_IO_PRIORITY = RB_WAITFD_PRI,
2226
+ } pg_rb_io_event_t;
2219
2227
 
2220
2228
  static VALUE
2221
- rb_io_wait(VALUE io, VALUE events, VALUE timeout) {
2229
+ pg_rb_io_wait(VALUE io, VALUE events, VALUE timeout) {
2222
2230
  rb_io_t *fptr;
2223
2231
  struct timeval waittime;
2224
2232
  int res;
@@ -2267,7 +2275,7 @@ wait_socket_readable( VALUE self, struct timeval *ptimeout, void *(*is_readable)
2267
2275
  /* Is the given timeout valid? */
2268
2276
  if( !ptimeout || (waittime.tv_sec >= 0 && waittime.tv_usec >= 0) ){
2269
2277
  /* Wait for the socket to become readable before checking again */
2270
- ret = rb_io_wait(socket_io, RB_INT2NUM(RUBY_IO_READABLE), wait_timeout);
2278
+ ret = pg_rb_io_wait(socket_io, RB_INT2NUM(PG_RUBY_IO_READABLE), wait_timeout);
2271
2279
  } else {
2272
2280
  ret = Qfalse;
2273
2281
  }
@@ -2304,9 +2312,9 @@ pgconn_async_flush(VALUE self)
2304
2312
  /* wait for the socket to become read- or write-ready */
2305
2313
  int events;
2306
2314
  VALUE socket_io = pgconn_socket_io(self);
2307
- events = RB_NUM2INT(rb_io_wait(socket_io, RB_INT2NUM(RUBY_IO_READABLE | RUBY_IO_WRITABLE), Qnil));
2315
+ events = RB_NUM2INT(pg_rb_io_wait(socket_io, RB_INT2NUM(PG_RUBY_IO_READABLE | PG_RUBY_IO_WRITABLE), Qnil));
2308
2316
 
2309
- if (events & RUBY_IO_READABLE)
2317
+ if (events & PG_RUBY_IO_READABLE)
2310
2318
  pgconn_consume_input(self);
2311
2319
  }
2312
2320
  return Qtrue;
@@ -3013,10 +3021,10 @@ pgconn_discard_results(VALUE self)
3013
3021
  int status;
3014
3022
 
3015
3023
  /* pgconn_block() raises an exception in case of errors.
3016
- * To avoid this call rb_io_wait() and PQconsumeInput() without rb_raise().
3024
+ * To avoid this call pg_rb_io_wait() and PQconsumeInput() without rb_raise().
3017
3025
  */
3018
3026
  while( gvl_PQisBusy(conn) ){
3019
- rb_io_wait(socket_io, RB_INT2NUM(RUBY_IO_READABLE), Qnil);
3027
+ pg_rb_io_wait(socket_io, RB_INT2NUM(PG_RUBY_IO_READABLE), Qnil);
3020
3028
  if ( PQconsumeInput(conn) == 0 ) {
3021
3029
  pgconn_close_socket_io(self);
3022
3030
  return Qfalse;
@@ -3037,7 +3045,7 @@ pgconn_discard_results(VALUE self)
3037
3045
  int st = gvl_PQgetCopyData(conn, &buffer, 1);
3038
3046
  if( st == 0 ) {
3039
3047
  /* would block -> wait for readable data */
3040
- rb_io_wait(socket_io, RB_INT2NUM(RUBY_IO_READABLE), Qnil);
3048
+ pg_rb_io_wait(socket_io, RB_INT2NUM(PG_RUBY_IO_READABLE), Qnil);
3041
3049
  if ( PQconsumeInput(conn) == 0 ) {
3042
3050
  pgconn_close_socket_io(self);
3043
3051
  return Qfalse;
@@ -3076,6 +3084,7 @@ pgconn_discard_results(VALUE self)
3076
3084
  * #exec is an alias for #async_exec which is almost identical to #sync_exec .
3077
3085
  * #sync_exec is implemented on the simpler synchronous command processing API of libpq, whereas
3078
3086
  * #async_exec is implemented on the asynchronous API and on ruby's IO mechanisms.
3087
+ * Only #async_exec is compatible to <tt>Fiber.scheduler</tt> based asynchronous IO processing introduced in ruby-3.0.
3079
3088
  * Both methods ensure that other threads can process while waiting for the server to
3080
3089
  * complete the request, but #sync_exec blocks all signals to be processed until the query is finished.
3081
3090
  * This is most notably visible by a delayed reaction to Control+C.
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
data/lib/3.1/pg_ext.so CHANGED
Binary file
data/lib/pg/connection.rb CHANGED
@@ -21,6 +21,13 @@ require 'socket'
21
21
  #
22
22
  # See the PG::Result class for information on working with the results of a query.
23
23
  #
24
+ # Many methods of this class have three variants kind of:
25
+ # 1. #exec - the base method which is an alias to #async_exec .
26
+ # This is the method that should be used in general.
27
+ # 2. #async_exec - the async aware version of the method, implemented by libpq's async API.
28
+ # 3. #sync_exec - the method version that is implemented by blocking function(s) of libpq.
29
+ #
30
+ # Sync and async version of the method can be switched by Connection.async_api= , however it is not recommended to change the default.
24
31
  class PG::Connection
25
32
 
26
33
  # The order the options are passed to the ::connect method.
@@ -690,7 +697,7 @@ class PG::Connection
690
697
  #
691
698
  # Raises a PG::Error if the connection fails.
692
699
  def new(*args, **kwargs)
693
- conn = PG::Connection.connect_start(*args, **kwargs ) or
700
+ conn = self.connect_start(*args, **kwargs ) or
694
701
  raise(PG::Error, "Unable to create a new connection")
695
702
 
696
703
  raise(PG::ConnectionBad, conn.error_message) if conn.status == PG::CONNECTION_BAD
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.3.0.rc2'
3
+ VERSION = '1.3.0.rc3'
4
4
  end
data/lib/pg.rb CHANGED
@@ -63,8 +63,8 @@ module PG
63
63
 
64
64
 
65
65
  ### Convenience alias for PG::Connection.new.
66
- def self::connect( *args )
67
- return PG::Connection.new( *args )
66
+ def self::connect( *args, **kwargs )
67
+ return PG::Connection.new( *args, **kwargs )
68
68
  end
69
69
 
70
70
 
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.0.rc2
4
+ version: 1.3.0.rc3
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  d5T9wAD7jW/0seVujw+76/YOJWO3Dft+FQmMBbdd8s3J47HbN9R2mDt6fl6he+X/
37
37
  gw==
38
38
  -----END CERTIFICATE-----
39
- date: 2022-01-08 00:00:00.000000000 Z
39
+ date: 2022-01-13 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.
metadata.gz.sig CHANGED
Binary file