pg 1.5.0-x64-mingw-ucrt → 1.5.2-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: 18c93713ebd1134c694cd9210ba170ac048db77d2d30550c4e98ffae7effdf4c
4
- data.tar.gz: ce42d9ef7379fe65fac77c9d61177b5c9b02640bf192f49258f56a04ac38777a
3
+ metadata.gz: 860e2bf9a722057b6b73f7c3cb72a33efc5dc592cf59b3317430e7bb080da281
4
+ data.tar.gz: c5937c718428eeda41763485b1a526443961047149220c78001118d22c45fd54
5
5
  SHA512:
6
- metadata.gz: b675b84b81b9b8b4a84e75cc8eba0827b062f6b6baa9177501c8652a9f969174ff0b6a0f76d62486a306a0069f239409a3315d9b30889c60c30ec1fd002afa43
7
- data.tar.gz: d772604e57ac051aecb2c7f4721cb582f8064c57867b7af0a31c95b009cb96e861511953702e5e7cec9e211cf419ce8e5a14b63b9601f6dc935072d4df7d5d7e
6
+ metadata.gz: 260bc87a40313f4c72f57bd875c310a04610cd45f4b4a81ef4bade0d83881682f254f36ddac7a5a69d0d084c79ba5f20847d61c1b4d6565335b49336d4aee9ac
7
+ data.tar.gz: 73ff82bfabe5f1ed4b7a8518fc00f5dd5e93fc4719e2af0441a6282562865b31799048e83383d10248792ed261a4622f6df1eeee487ff6e9e25b568497e53cf7
checksums.yaml.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v1.5.1 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ - Don't overwrite flags of timestamp coders. [#524](https://github.com/ged/ruby-pg/pull/524)
4
+ Fixes a regression in rails: https://github.com/rails/rails/issues/48049
5
+
6
+
1
7
  ## v1.5.0 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
2
8
 
3
9
  Enhancements:
@@ -7,19 +7,19 @@ module PG
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
9
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC, **hash, **kwargs)
10
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampUtcToLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
15
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
16
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
16
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
17
17
  end
18
18
  end
19
19
  class TimestampLocal < Timestamp
20
20
  def initialize(hash={}, **kwargs)
21
21
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
22
- super(flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
22
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL)
23
23
  end
24
24
  end
25
25
  end
@@ -7,13 +7,13 @@ module PG
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
9
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
- super(flags: PG::Coder::TIMESTAMP_DB_UTC, **hash, **kwargs)
10
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
15
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
16
- super(flags: PG::Coder::TIMESTAMP_DB_LOCAL, **hash, **kwargs)
16
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL)
17
17
  end
18
18
  end
19
19
  end
data/lib/pg/connection.rb CHANGED
@@ -166,6 +166,14 @@ class PG::Connection
166
166
  # conn.put_copy_data ['more', 'data', 'to', 'copy']
167
167
  # end
168
168
  #
169
+ # Also PG::BinaryEncoder::CopyRow can be used to send data in binary format to the server.
170
+ # In this case copy_data generates the header and trailer data automatically:
171
+ # enco = PG::BinaryEncoder::CopyRow.new
172
+ # conn.copy_data "COPY my_table FROM STDIN (FORMAT binary)", enco do
173
+ # conn.put_copy_data ['some', 'data', 'to', 'copy']
174
+ # conn.put_copy_data ['more', 'data', 'to', 'copy']
175
+ # end
176
+ #
169
177
  # Example with CSV output format:
170
178
  # conn.copy_data "COPY my_table TO STDOUT CSV" do
171
179
  # while row=conn.get_copy_data
@@ -187,6 +195,18 @@ class PG::Connection
187
195
  # This receives all rows of +my_table+ as ruby array:
188
196
  # ["some", "data", "to", "copy"]
189
197
  # ["more", "data", "to", "copy"]
198
+ #
199
+ # Also PG::BinaryDecoder::CopyRow can be used to retrieve data in binary format from the server.
200
+ # In this case the header and trailer data is processed by the decoder and the remaining +nil+ from get_copy_data is processed by copy_data, so that binary data can be processed equally to text data:
201
+ # deco = PG::BinaryDecoder::CopyRow.new
202
+ # conn.copy_data "COPY my_table TO STDOUT (FORMAT binary)", deco do
203
+ # while row=conn.get_copy_data
204
+ # p row
205
+ # end
206
+ # end
207
+ # This receives all rows of +my_table+ as ruby array:
208
+ # ["some", "data", "to", "copy"]
209
+ # ["more", "data", "to", "copy"]
190
210
 
191
211
  def copy_data( sql, coder=nil )
192
212
  raise PG::NotInBlockingMode.new("copy_data can not be used in nonblocking mode", connection: self) if nonblocking?
@@ -195,7 +215,7 @@ class PG::Connection
195
215
  case res.result_status
196
216
  when PGRES_COPY_IN
197
217
  begin
198
- if res.binary_tuples == 1
218
+ if coder && res.binary_tuples == 1
199
219
  # Binary file header (11 byte signature, 32 bit flags and 32 bit extension length)
200
220
  put_copy_data(BinarySignature + ("\x00" * 8))
201
221
  end
@@ -219,7 +239,7 @@ class PG::Connection
219
239
  begin
220
240
  self.encoder_for_put_copy_data = old_coder if coder
221
241
 
222
- if res.binary_tuples == 1
242
+ if coder && res.binary_tuples == 1
223
243
  put_copy_data("\xFF\xFF") # Binary file trailer 16 bit "-1"
224
244
  end
225
245
 
@@ -244,8 +264,9 @@ class PG::Connection
244
264
  discard_results
245
265
  raise
246
266
  else
247
- if res.binary_tuples == 1
248
- # there are two end markers in binary mode: file trailer and the final nil
267
+ if coder && res.binary_tuples == 1
268
+ # There are two end markers in binary mode: file trailer and the final nil.
269
+ # The file trailer is expected to be processed by BinaryDecoder::CopyRow and already returns nil, so that the remaining NULL from PQgetCopyData is retrieved here:
249
270
  if get_copy_data
250
271
  discard_results
251
272
  raise PG::NotAllCopyDataRetrieved.new("Not all binary COPY data retrieved", connection: self)
@@ -7,19 +7,19 @@ module PG
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
9
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC, **hash, **kwargs)
10
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampUtcToLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
15
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
16
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
16
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
17
17
  end
18
18
  end
19
19
  class TimestampLocal < Timestamp
20
20
  def initialize(hash={}, **kwargs)
21
21
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
22
- super(flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
22
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL)
23
23
  end
24
24
  end
25
25
 
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.5.0'
3
+ VERSION = '1.5.2'
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.5.0
4
+ version: 1.5.2
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Michael Granger
@@ -34,7 +34,7 @@ cert_chain:
34
34
  Dzx/gFSOrRoCt2mXNgrmcAfr386AfaMvCh7cXqdxZwmVo7ILZCYXck0pajvubsDd
35
35
  NUIIFkVXvd1odFyK9LF1RFAtxn/iAmpx
36
36
  -----END CERTIFICATE-----
37
- date: 2023-04-24 00:00:00.000000000 Z
37
+ date: 2023-04-26 00:00:00.000000000 Z
38
38
  dependencies: []
39
39
  description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
40
40
  9.3 and later.
metadata.gz.sig CHANGED
Binary file