pg 1.3.0.rc2-x64-mingw32 → 1.3.0.rc3-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: 41acb016111b1a403c907386e51811541869bacec6523042e95491def8b820d3
4
- data.tar.gz: 00c0d9ceddda6fe84b6fe1ccb1561a566c3c380ad6b9c35009e596b4df773229
3
+ metadata.gz: 1c8dd86a0ff7573d4ee5160db7ba24bfcb8a60b0b8a1f8ba024c4f4df4f474ce
4
+ data.tar.gz: 267098a841b2930912910d7ff679d74224f5f7e45dc3636b7151ad7f513ca40d
5
5
  SHA512:
6
- metadata.gz: 2bcc301c930009cef1586d590ce1b84e2afa3ce96c8fbb69e33cc93732d4862e7001f1a5a0fa687eb1436359e8984fdb7ddba86d83af9c9df66aad40e42f1343
7
- data.tar.gz: cba31ff2d6a877e288022d7bb6c7ebf56641f6483275606ed1645758f009bbe58e90c002cb85cd6ddb573916cc540ed754a322e6915d8264c82fd03f45de50b0
6
+ metadata.gz: 2141632efe8c5ef6442d960d6d0e4351ba019cf7bdfe894d8feec6b55b3daa218a1e652c66005f4deb073508c8357d8f7f85b13fff73eb713ecc3f65e9825c82
7
+ data.tar.gz: 1d937df566d35602d7e75c6b82552fdfc774519fd9725f7679ead731160f20592944f9dd1bc147a7b4a2fb1fbaee12f236c8225e2d42f8a4fc3cd26d10ec4bb9
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- U�l���<�����l��S+�P���٢M��q��eC o��OH1%�ڤ�>��UvQ91�\<��/IQ�~&��!�(U v\"�&��vH튢�g��D&�u(���/ʿ+r�%�^�|�`(tu]���I��X���A5r��٨��cY���pT5���D_����nW=�|ՊCz��U
2
- �jv����Cމ'��m_{�:�COʰ�z��&(�\m;�䕀&�ޢ�DM�5��H �5g��ft`��vn�X�m%�1�n�(b�r��y��`�����e��������u��%��
1
+ l}J���쁩"�DB�#��^���^3�=ϯ=���l���_�B���4"fd����/qE���羞�����(�y.�Vp��2^CQ�5�Ő��Qa�:Bζ��}�B"wZ&=��>�n-x�F�L�� ��;>�uTP��H� ���_^���꺧�a�¼җ��������Ss�%��ChX�2'�=j��v����q���]�jW]�'�V����AW�c��}����ᶆ���*O�5S�ŜTΆF�n�����iH�M "���W͇���j9t�(iblJp��F���d߂�8�\�BVI+��狁�/,K����1�U�q��@=p��h ���KD
2
+ H��n$�I^���g�!�=V$*=Vwi���>!
@@ -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/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: x64-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