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 +4 -4
- checksums.yaml.gz.sig +2 -2
- data/.github/workflows/source-gem.yml +0 -1
- data/ext/pg_connection.c +23 -14
- data/lib/2.5/pg_ext.so +0 -0
- data/lib/2.6/pg_ext.so +0 -0
- data/lib/2.7/pg_ext.so +0 -0
- data/lib/3.0/pg_ext.so +0 -0
- data/lib/pg/connection.rb +8 -1
- data/lib/pg/version.rb +1 -1
- data/lib/pg.rb +2 -2
- data/lib/x64-mingw32/libpq.dll +0 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c8dd86a0ff7573d4ee5160db7ba24bfcb8a60b0b8a1f8ba024c4f4df4f474ce
|
4
|
+
data.tar.gz: 267098a841b2930912910d7ff679d74224f5f7e45dc3636b7151ad7f513ca40d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2141632efe8c5ef6442d960d6d0e4351ba019cf7bdfe894d8feec6b55b3daa218a1e652c66005f4deb073508c8357d8f7f85b13fff73eb713ecc3f65e9825c82
|
7
|
+
data.tar.gz: 1d937df566d35602d7e75c6b82552fdfc774519fd9725f7679ead731160f20592944f9dd1bc147a7b4a2fb1fbaee12f236c8225e2d42f8a4fc3cd26d10ec4bb9
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
l}J���쁩"�DB�#��^���^3�=ϯ=���l���_�B���4"fd����/qE���羞�����(�y.�Vp��2^CQ�5�Ő��Qa�:Bζ��}�B�"w�Z&=��>�n-x�F�L�� ��;>�uTP��H����_^���꺧�a�¼җ��������S�s�%��ChX�2'�=j��v����q���]�jW]�'�V����AW�c��}����ᶆ���*O�5S�ŜTΆF�n�����iH�M"���W͇���j9t�(i�b�l�Jp��F���d߂�8�\�B�VI+��狁�/,K����1�U�q��@=p��h���KD
|
2
|
+
H��n$�I^���g�!�=V$*=Vwi���>!
|
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
|
-
*
|
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
|
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
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
}
|
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
|
-
|
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 =
|
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(
|
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 &
|
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
|
3024
|
+
* To avoid this call pg_rb_io_wait() and PQconsumeInput() without rb_raise().
|
3017
3025
|
*/
|
3018
3026
|
while( gvl_PQisBusy(conn) ){
|
3019
|
-
|
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
|
-
|
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 =
|
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
data/lib/pg.rb
CHANGED
data/lib/x64-mingw32/libpq.dll
CHANGED
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.
|
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-
|
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
|