pg 0.21.0 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.rdoc +98 -0
- data/Manifest.txt +5 -1
- data/README.rdoc +14 -4
- data/Rakefile +4 -5
- data/Rakefile.cross +17 -21
- data/ext/errorcodes.def +12 -0
- data/ext/errorcodes.rb +1 -1
- data/ext/errorcodes.txt +4 -1
- data/ext/extconf.rb +14 -32
- data/ext/gvl_wrappers.c +4 -0
- data/ext/gvl_wrappers.h +23 -39
- data/ext/pg.c +23 -50
- data/ext/pg.h +51 -81
- data/ext/pg_binary_decoder.c +73 -6
- data/ext/pg_coder.c +52 -3
- data/ext/pg_connection.c +369 -219
- data/ext/pg_copy_coder.c +10 -5
- data/ext/pg_result.c +343 -119
- data/ext/pg_text_decoder.c +597 -37
- data/ext/pg_text_encoder.c +6 -7
- data/ext/pg_tuple.c +541 -0
- data/ext/util.c +6 -6
- data/ext/util.h +2 -2
- data/lib/pg.rb +5 -7
- data/lib/pg/basic_type_mapping.rb +40 -7
- data/lib/pg/binary_decoder.rb +22 -0
- data/lib/pg/coder.rb +1 -1
- data/lib/pg/connection.rb +27 -3
- data/lib/pg/constants.rb +1 -1
- data/lib/pg/exceptions.rb +1 -1
- data/lib/pg/result.rb +1 -1
- data/lib/pg/text_decoder.rb +19 -23
- data/lib/pg/text_encoder.rb +35 -1
- data/lib/pg/tuple.rb +30 -0
- data/lib/pg/type_map_by_column.rb +1 -1
- data/spec/helpers.rb +49 -21
- data/spec/pg/basic_type_mapping_spec.rb +230 -27
- data/spec/pg/connection_spec.rb +473 -277
- data/spec/pg/connection_sync_spec.rb +41 -0
- data/spec/pg/result_spec.rb +48 -13
- data/spec/pg/tuple_spec.rb +280 -0
- data/spec/pg/type_map_by_class_spec.rb +1 -1
- data/spec/pg/type_map_by_column_spec.rb +1 -1
- data/spec/pg/type_map_by_mri_type_spec.rb +1 -1
- data/spec/pg/type_map_by_oid_spec.rb +1 -1
- data/spec/pg/type_map_in_ruby_spec.rb +1 -1
- data/spec/pg/type_map_spec.rb +1 -1
- data/spec/pg/type_spec.rb +184 -12
- data/spec/pg_spec.rb +2 -2
- metadata +37 -33
- metadata.gz.sig +0 -0
- data/lib/pg/deprecated_constants.rb +0 -21
data/spec/pg/type_map_spec.rb
CHANGED
data/spec/pg/type_spec.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
# -*- rspec -*-
|
2
2
|
# encoding: utf-8
|
3
3
|
|
4
4
|
require 'pg'
|
5
|
+
require 'time'
|
5
6
|
|
6
7
|
|
7
8
|
describe "PG::Type derivations" do
|
@@ -15,6 +16,9 @@ describe "PG::Type derivations" do
|
|
15
16
|
let!(:textdec_string) { PG::TextDecoder::String.new }
|
16
17
|
let!(:textenc_timestamp) { PG::TextEncoder::TimestampWithoutTimeZone.new }
|
17
18
|
let!(:textdec_timestamp) { PG::TextDecoder::TimestampWithoutTimeZone.new }
|
19
|
+
let!(:textenc_timestamputc) { PG::TextEncoder::TimestampUtc.new }
|
20
|
+
let!(:textdec_timestamputc) { PG::TextDecoder::TimestampUtc.new }
|
21
|
+
let!(:textdec_timestampul) { PG::TextDecoder::TimestampUtcToLocal.new }
|
18
22
|
let!(:textenc_timestamptz) { PG::TextEncoder::TimestampWithTimeZone.new }
|
19
23
|
let!(:textdec_timestamptz) { PG::TextDecoder::TimestampWithTimeZone.new }
|
20
24
|
let!(:textenc_bytea) { PG::TextEncoder::Bytea.new }
|
@@ -75,7 +79,7 @@ describe "PG::Type derivations" do
|
|
75
79
|
expect( intdec_incrementer.decode("3") ).to eq( 4 )
|
76
80
|
end
|
77
81
|
|
78
|
-
it "should decode integers of different lengths
|
82
|
+
it "should decode integers of different lengths from text format" do
|
79
83
|
30.times do |zeros|
|
80
84
|
expect( textdec_int.decode("1" + "0"*zeros) ).to eq( 10 ** zeros )
|
81
85
|
expect( textdec_int.decode(zeros==0 ? "0" : "9"*zeros) ).to eq( 10 ** zeros - 1 )
|
@@ -96,21 +100,41 @@ describe "PG::Type derivations" do
|
|
96
100
|
end
|
97
101
|
|
98
102
|
context 'timestamps' do
|
99
|
-
it 'decodes timestamps without timezone' do
|
100
|
-
expect( textdec_timestamp.decode('2016-01-02 23:23:59.123456') ).
|
101
|
-
to
|
103
|
+
it 'decodes timestamps without timezone as local time' do
|
104
|
+
expect( textdec_timestamp.decode('2016-01-02 23:23:59.123456').iso8601(5) ).
|
105
|
+
to eq( Time.new(2016,1,2, 23,23,59.123456).iso8601(5) )
|
106
|
+
expect( textdec_timestamp.decode('2016-08-02 23:23:59.123456').iso8601(5) ).
|
107
|
+
to eq( Time.new(2016,8,2, 23,23,59.123456).iso8601(5) )
|
108
|
+
end
|
109
|
+
it 'decodes timestamps with UTC time and returns UTC timezone' do
|
110
|
+
expect( textdec_timestamputc.decode('2016-01-02 23:23:59.123456').iso8601(5) ).
|
111
|
+
to eq( Time.utc(2016,1,2, 23,23,59.123456).iso8601(5) )
|
112
|
+
expect( textdec_timestamputc.decode('2016-08-02 23:23:59.123456').iso8601(5) ).
|
113
|
+
to eq( Time.utc(2016,8,2, 23,23,59.123456).iso8601(5) )
|
114
|
+
end
|
115
|
+
it 'decodes timestamps with UTC time and returns local timezone' do
|
116
|
+
expect( textdec_timestampul.decode('2016-01-02 23:23:59.123456').iso8601(5) ).
|
117
|
+
to eq( Time.utc(2016,1,2, 23,23,59.123456).getlocal.iso8601(5) )
|
118
|
+
expect( textdec_timestampul.decode('2016-08-02 23:23:59.123456').iso8601(5) ).
|
119
|
+
to eq( Time.utc(2016,8,2, 23,23,59.123456).getlocal.iso8601(5) )
|
102
120
|
end
|
103
121
|
it 'decodes timestamps with hour timezone' do
|
104
|
-
expect( textdec_timestamptz.decode('
|
105
|
-
to
|
106
|
-
expect( textdec_timestamptz.decode('
|
107
|
-
to
|
122
|
+
expect( textdec_timestamptz.decode('2016-01-02 23:23:59.123456-04').iso8601(5) ).
|
123
|
+
to eq( Time.new(2016,1,2, 23,23,59.123456, "-04:00").iso8601(5) )
|
124
|
+
expect( textdec_timestamptz.decode('2016-08-02 23:23:59.123456+10').iso8601(5) ).
|
125
|
+
to eq( Time.new(2016,8,2, 23,23,59.123456, "+10:00").iso8601(5) )
|
126
|
+
expect( textdec_timestamptz.decode('1913-12-31 23:58:59.1231-03').iso8601(5) ).
|
127
|
+
to eq( Time.new(1913, 12, 31, 23, 58, 59.1231, "-03:00").iso8601(5) )
|
128
|
+
expect( textdec_timestamptz.decode('4714-11-24 23:58:59.1231-03 BC').iso8601(5) ).
|
129
|
+
to eq( Time.new(-4713, 11, 24, 23, 58, 59.1231, "-03:00").iso8601(5) )
|
130
|
+
expect( textdec_timestamptz.decode('294276-12-31 23:58:59.1231+03').iso8601(5) ).
|
131
|
+
to eq( Time.new(294276, 12, 31, 23, 58, 59.1231, "+03:00").iso8601(5) )
|
108
132
|
end
|
109
133
|
it 'decodes timestamps with hour:minute timezone' do
|
110
134
|
expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511-04:15') ).
|
111
135
|
to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "-04:15") )
|
112
|
-
expect( textdec_timestamptz.decode('2015-
|
113
|
-
to be_within(0.000001).of( Time.new(2015,
|
136
|
+
expect( textdec_timestamptz.decode('2015-07-26 17:26:42.691511-04:30') ).
|
137
|
+
to be_within(0.000001).of( Time.new(2015,07,26, 17, 26, 42.691511, "-04:30") )
|
114
138
|
expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511+10:45') ).
|
115
139
|
to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "+10:45") )
|
116
140
|
end
|
@@ -121,6 +145,81 @@ describe "PG::Type derivations" do
|
|
121
145
|
expect( textdec_timestamptz.decode('1916-01-01 00:00:00-00:25:21') ).
|
122
146
|
to be_within(0.000001).of( Time.new(1916, 1, 1, 0, 0, 0, "-00:25:21") )
|
123
147
|
end
|
148
|
+
it 'decodes timestamps with date before 1823' do
|
149
|
+
expect( textdec_timestamp.decode('1822-01-02 23:23:59.123456').iso8601(5) ).
|
150
|
+
to eq( Time.new(1822,01,02, 23, 23, 59.123456).iso8601(5) )
|
151
|
+
expect( textdec_timestamputc.decode('1822-01-02 23:23:59.123456').iso8601(5) ).
|
152
|
+
to eq( Time.utc(1822,01,02, 23, 23, 59.123456).iso8601(5) )
|
153
|
+
expect( textdec_timestampul.decode('1822-01-02 23:23:59.123456').iso8601(5) ).
|
154
|
+
to eq( Time.utc(1822,01,02, 23, 23, 59.123456).getlocal.iso8601(5) )
|
155
|
+
expect( textdec_timestamptz.decode('1822-01-02 23:23:59.123456+04').iso8601(5) ).
|
156
|
+
to eq( Time.new(1822,01,02, 23, 23, 59.123456, "+04:00").iso8601(5) )
|
157
|
+
end
|
158
|
+
it 'decodes timestamps with date after 2116' do
|
159
|
+
expect( textdec_timestamp.decode('2117-01-02 23:23:59.123456').iso8601(5) ).
|
160
|
+
to eq( Time.new(2117,01,02, 23, 23, 59.123456).iso8601(5) )
|
161
|
+
expect( textdec_timestamputc.decode('2117-01-02 23:23:59.123456').iso8601(5) ).
|
162
|
+
to eq( Time.utc(2117,01,02, 23, 23, 59.123456).iso8601(5) )
|
163
|
+
expect( textdec_timestampul.decode('2117-01-02 23:23:59.123456').iso8601(5) ).
|
164
|
+
to eq( Time.utc(2117,01,02, 23, 23, 59.123456).getlocal.iso8601(5) )
|
165
|
+
expect( textdec_timestamptz.decode('2117-01-02 23:23:59.123456+04').iso8601(5) ).
|
166
|
+
to eq( Time.new(2117,01,02, 23, 23, 59.123456, "+04:00").iso8601(5) )
|
167
|
+
end
|
168
|
+
it 'decodes timestamps with variable number of digits for the useconds part' do
|
169
|
+
sec = "59.12345678912345"
|
170
|
+
(4..sec.length).each do |i|
|
171
|
+
expect( textdec_timestamp.decode("2016-01-02 23:23:#{sec[0,i]}") ).
|
172
|
+
to be_within(0.000001).of( Time.new(2016,01,02, 23, 23, sec[0,i].to_f) )
|
173
|
+
end
|
174
|
+
end
|
175
|
+
it 'decodes timestamps with leap-second' do
|
176
|
+
expect( textdec_timestamp.decode('1998-12-31 23:59:60.1234') ).
|
177
|
+
to be_within(0.000001).of( Time.new(1998,12,31, 23, 59, 60.1234) )
|
178
|
+
end
|
179
|
+
|
180
|
+
def textdec_timestamptz_decode_should_fail(str)
|
181
|
+
expect(textdec_timestamptz.decode(str)).to eq(str)
|
182
|
+
end
|
183
|
+
|
184
|
+
it 'fails when the timestamp is an empty string' do
|
185
|
+
textdec_timestamptz_decode_should_fail('')
|
186
|
+
end
|
187
|
+
it 'fails when the timestamp contains values with less digits than expected' do
|
188
|
+
textdec_timestamptz_decode_should_fail('2016-0-02 23:23:59.123456+00:25:21')
|
189
|
+
textdec_timestamptz_decode_should_fail('2016-01-0 23:23:59.123456+00:25:21')
|
190
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 2:23:59.123456+00:25:21')
|
191
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:2:59.123456+00:25:21')
|
192
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:5.123456+00:25:21')
|
193
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.+00:25:21')
|
194
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+0:25:21')
|
195
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:2:21')
|
196
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:25:2')
|
197
|
+
end
|
198
|
+
it 'fails when the timestamp contains values with more digits than expected' do
|
199
|
+
textdec_timestamptz_decode_should_fail('2016-011-02 23:23:59.123456+00:25:21')
|
200
|
+
textdec_timestamptz_decode_should_fail('2016-01-022 23:23:59.123456+00:25:21')
|
201
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 233:23:59.123456+00:25:21')
|
202
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:233:59.123456+00:25:21')
|
203
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:599.123456+00:25:21')
|
204
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+000:25:21')
|
205
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:255:21')
|
206
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:25:211')
|
207
|
+
end
|
208
|
+
it 'fails when the timestamp contains values with invalid characters' do
|
209
|
+
str = '2013-01-02 23:23:59.123456+00:25:21'
|
210
|
+
str.length.times do |i|
|
211
|
+
textdec_timestamptz_decode_should_fail(str[0,i] + "x" + str[i+1..-1])
|
212
|
+
end
|
213
|
+
end
|
214
|
+
it 'fails when the timestamp contains leading characters' do
|
215
|
+
textdec_timestamptz_decode_should_fail(' 2016-01-02 23:23:59.123456')
|
216
|
+
end
|
217
|
+
it 'fails when the timestamp contains trailing characters' do
|
218
|
+
textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456 ')
|
219
|
+
end
|
220
|
+
it 'fails when the timestamp contains non ASCII character' do
|
221
|
+
textdec_timestamptz_decode_should_fail('2016-01ª02 23:23:59.123456')
|
222
|
+
end
|
124
223
|
end
|
125
224
|
|
126
225
|
context 'identifier quotation' do
|
@@ -215,6 +314,27 @@ describe "PG::Type derivations" do
|
|
215
314
|
expect( textenc_bytea.encode("\x00\x01\x02\x03\xef".b) ).to eq( "\\x00010203ef" )
|
216
315
|
end
|
217
316
|
|
317
|
+
context 'timestamps' do
|
318
|
+
it 'encodes timestamps without timezone' do
|
319
|
+
expect( textenc_timestamp.encode(Time.new(2016,1,2, 23, 23, 59.123456, 3*60*60)) ).
|
320
|
+
to match( /^2016-01-02 23:23:59.12345\d+$/ )
|
321
|
+
expect( textenc_timestamp.encode(Time.new(2016,8,2, 23, 23, 59.123456, 3*60*60)) ).
|
322
|
+
to match( /^2016-08-02 23:23:59.12345\d+$/ )
|
323
|
+
end
|
324
|
+
it 'encodes timestamps with UTC timezone' do
|
325
|
+
expect( textenc_timestamputc.encode(Time.new(2016,1,2, 23, 23, 59.123456, 3*60*60)) ).
|
326
|
+
to match( /^2016-01-02 20:23:59.12345\d+$/ )
|
327
|
+
expect( textenc_timestamputc.encode(Time.new(2016,8,2, 23, 23, 59.123456, 3*60*60)) ).
|
328
|
+
to match( /^2016-08-02 20:23:59.12345\d+$/ )
|
329
|
+
end
|
330
|
+
it 'encodes timestamps with hour timezone' do
|
331
|
+
expect( textenc_timestamptz.encode(Time.new(2016,1,02, 23, 23, 59.123456, -4*60*60)) ).
|
332
|
+
to match( /^2016-01-02 23:23:59.12345\d+ \-04:00$/ )
|
333
|
+
expect( textenc_timestamptz.encode(Time.new(2016,8,02, 23, 23, 59.123456, 10*60*60)) ).
|
334
|
+
to match( /^2016-08-02 23:23:59.12345\d+ \+10:00$/ )
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
218
338
|
context 'identifier quotation' do
|
219
339
|
it 'should quote and escape identifier' do
|
220
340
|
quoted_type = PG::TextEncoder::Identifier.new
|
@@ -303,6 +423,7 @@ describe "PG::Type derivations" do
|
|
303
423
|
describe "Array types" do
|
304
424
|
let!(:textenc_string_array) { PG::TextEncoder::Array.new elements_type: textenc_string }
|
305
425
|
let!(:textdec_string_array) { PG::TextDecoder::Array.new elements_type: textdec_string }
|
426
|
+
let!(:textdec_string_array_raise) { PG::TextDecoder::Array.new elements_type: textdec_string, flags: PG::Coder:: FORMAT_ERROR_TO_RAISE }
|
306
427
|
let!(:textenc_int_array) { PG::TextEncoder::Array.new elements_type: textenc_int, needs_quotation: false }
|
307
428
|
let!(:textdec_int_array) { PG::TextDecoder::Array.new elements_type: textdec_int, needs_quotation: false }
|
308
429
|
let!(:textenc_float_array) { PG::TextEncoder::Array.new elements_type: textenc_float, needs_quotation: false }
|
@@ -368,6 +489,57 @@ describe "PG::Type derivations" do
|
|
368
489
|
it 'respects a different delimiter' do
|
369
490
|
expect( textdec_string_array_with_delimiter.decode(%[{1;2;3}]) ).to eq( ['1','2','3'] )
|
370
491
|
end
|
492
|
+
|
493
|
+
it 'ignores array dimensions' do
|
494
|
+
expect( textdec_string_array.decode(%[[2:4]={1,2,3}]) ).to eq( ['1','2','3'] )
|
495
|
+
expect( textdec_string_array.decode(%[[]={1,2,3}]) ).to eq( ['1','2','3'] )
|
496
|
+
expect( textdec_string_array.decode(%[ [-1:+2]= {4,3,2,1}]) ).to eq( ['4','3','2','1'] )
|
497
|
+
end
|
498
|
+
|
499
|
+
it 'ignores spaces after array' do
|
500
|
+
expect( textdec_string_array.decode(%[[2:4]={1,2,3} ]) ).to eq( ['1','2','3'] )
|
501
|
+
expect( textdec_string_array.decode(%[{1,2,3} ]) ).to eq( ['1','2','3'] )
|
502
|
+
end
|
503
|
+
|
504
|
+
describe "with malformed syntax are deprecated" do
|
505
|
+
it 'accepts broken array dimensions' do
|
506
|
+
expect( textdec_string_array.decode(%([2:4={1,2,3})) ).to eq([['1','2','3']])
|
507
|
+
expect( textdec_string_array.decode(%(2:4]={1,2,3})) ).to eq([['1','2','3']])
|
508
|
+
expect( textdec_string_array.decode(%(={1,2,3})) ).to eq([['1','2','3']])
|
509
|
+
expect( textdec_string_array.decode(%([x]={1,2,3})) ).to eq([['1','2','3']])
|
510
|
+
expect( textdec_string_array.decode(%([]{1,2,3})) ).to eq([['1','2','3']])
|
511
|
+
expect( textdec_string_array.decode(%(1,2,3)) ).to eq(['','2'])
|
512
|
+
end
|
513
|
+
|
514
|
+
it 'accepts malformed arrays' do
|
515
|
+
expect( textdec_string_array.decode(%({1,2,3)) ).to eq(['1','2'])
|
516
|
+
expect( textdec_string_array.decode(%({1,2,3}})) ).to eq(['1','2','3'])
|
517
|
+
expect( textdec_string_array.decode(%({1,2,3}x)) ).to eq(['1','2','3'])
|
518
|
+
expect( textdec_string_array.decode(%({{1,2},{2,3})) ).to eq([['1','2'],['2','3']])
|
519
|
+
expect( textdec_string_array.decode(%({{1,2},{2,3}}x)) ).to eq([['1','2'],['2','3']])
|
520
|
+
expect( textdec_string_array.decode(%({[1,2},{2,3}}})) ).to eq(['[1','2'])
|
521
|
+
end
|
522
|
+
end
|
523
|
+
|
524
|
+
describe "with malformed syntax are raised with pg-2.0+" do
|
525
|
+
it 'complains about broken array dimensions' do
|
526
|
+
expect{ textdec_string_array_raise.decode(%([2:4={1,2,3})) }.to raise_error(TypeError)
|
527
|
+
expect{ textdec_string_array_raise.decode(%(2:4]={1,2,3})) }.to raise_error(TypeError)
|
528
|
+
expect{ textdec_string_array_raise.decode(%(={1,2,3})) }.to raise_error(TypeError)
|
529
|
+
expect{ textdec_string_array_raise.decode(%([x]={1,2,3})) }.to raise_error(TypeError)
|
530
|
+
expect{ textdec_string_array_raise.decode(%([]{1,2,3})) }.to raise_error(TypeError)
|
531
|
+
expect{ textdec_string_array_raise.decode(%(1,2,3)) }.to raise_error(TypeError)
|
532
|
+
end
|
533
|
+
|
534
|
+
it 'complains about malformed array' do
|
535
|
+
expect{ textdec_string_array_raise.decode(%({1,2,3)) }.to raise_error(TypeError)
|
536
|
+
expect{ textdec_string_array_raise.decode(%({1,2,3}})) }.to raise_error(TypeError)
|
537
|
+
expect{ textdec_string_array_raise.decode(%({1,2,3}x)) }.to raise_error(TypeError)
|
538
|
+
expect{ textdec_string_array_raise.decode(%({{1,2},{2,3})) }.to raise_error(TypeError)
|
539
|
+
expect{ textdec_string_array_raise.decode(%({{1,2},{2,3}}x)) }.to raise_error(TypeError)
|
540
|
+
expect{ textdec_string_array_raise.decode(%({[1,2},{2,3}}})) }.to raise_error(TypeError)
|
541
|
+
end
|
542
|
+
end
|
371
543
|
end
|
372
544
|
|
373
545
|
context 'bytea' do
|
@@ -746,7 +918,7 @@ describe "PG::Type derivations" do
|
|
746
918
|
end
|
747
919
|
|
748
920
|
describe '#decode' do
|
749
|
-
it "should decode
|
921
|
+
it "should decode COPY text format to array of strings" do
|
750
922
|
expect( decoder.decode("123\t \0#\t#\n#\r#\\ \t234\t#\x01#\002\n".gsub("#", "\\"))).to eq( ["123", " \0\t\n\r\\ ", "234", "\x01\x02"] )
|
751
923
|
end
|
752
924
|
|
data/spec/pg_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# -*- rspec -*-
|
2
2
|
# encoding: utf-8
|
3
3
|
|
4
4
|
require_relative 'helpers'
|
@@ -7,7 +7,7 @@ require 'pg'
|
|
7
7
|
|
8
8
|
describe PG do
|
9
9
|
|
10
|
-
it "knows what version of the libpq library is loaded"
|
10
|
+
it "knows what version of the libpq library is loaded" do
|
11
11
|
expect( PG.library_version ).to be_an( Integer )
|
12
12
|
expect( PG.library_version ).to be >= 90100
|
13
13
|
end
|
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:
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -11,32 +11,31 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
+
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
p4vpx2kUSFSAGjtCbDGTNV2AH8w9OU4xEmNz8c5lyoA=
|
14
|
+
MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
15
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0xODExMjAxODI5NTlaFw0xOTExMjAxODI5
|
16
|
+
NTlaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
17
|
+
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
18
|
+
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
|
19
|
+
M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm5FO+Vew8tSQmlDsosxLUx+VB7DrVFO
|
20
|
+
5PU2AEbf04GGSrmqADGWXeaslaoRdb1fu/0M5qfPTRn5V39sWD9umuDAF9qqil/x
|
21
|
+
Sl6phTvgBrG8GExHbNZpLARd3xrBYLEFsX7RvBn2UPfgsrtvpdXjsHGfpT3IPN+B
|
22
|
+
vQ66lts4alKC69TE5cuKasWBm+16A4aEe3XdZBRNmtOu/g81gvwA7fkJHKllJuaI
|
23
|
+
dXzdHqq+zbGZVSQ7pRYHYomD0IiDe1DbIouFnPWmagaBnGHwXkDT2bKKP+s2v21m
|
24
|
+
ozilJg4aar2okb/RA6VS87o+d7g6LpDDMMQjH4G9OPnJENLdhu8KnPw/ivSVvQw7
|
25
|
+
N2I4L/ZOIe2DIVuYH7aLHfjZDQv/mNgpAgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYD
|
26
|
+
VR0PBAQDAgSwMB0GA1UdDgQWBBRyjf55EbrHagiRLqt5YAd3yb8k4DAcBgNVHREE
|
27
|
+
FTATgRFnZWRARmFlcmllTVVELm9yZzAcBgNVHRIEFTATgRFnZWRARmFlcmllTVVE
|
28
|
+
Lm9yZzANBgkqhkiG9w0BAQsFAAOCAYEAP9Ffkvg4e8CjIWi8SykQ8oJSS8jbmbgF
|
29
|
+
abke3vXWLG6V9kFiObuJd5wZRBluJANu7bEtjgc3fFaGVP2XxVdCpVjNbmMDg4Qp
|
30
|
+
ovvczP53X6pQP2RSZgxF6Lblvy8y11RziUTVRG/Z2aJHsElo6gI7vQznE/OSDrhC
|
31
|
+
gEhr8uaIUt7D+HZWRbU0+MkKPpL5uMqaFuJbqXEvSwPTuUuYkDfNfsjQO7ruWBac
|
32
|
+
bxHCrvpZ6Tijc0nrlyXi6gPOCLeaqhau2xFnlvKgELwsGYSoKBJyDwqtQ5kwrOlU
|
33
|
+
tkSyLrfZ+RZcH535Hyvif7ZxB0v5OxXXoec+N2vrUsEUMRDL9dg4/WFdN8hIOixF
|
34
|
+
3IPKpZ1ho0Ya5q7yhygtBK9/NBFHw+nbJjcltfPDBXleRe8u73gnQo8AZIhStYSP
|
35
|
+
v4qqqa27Bs468d6SoPxjSm8a2mM9HZ4OdWhq4tFsbTeXDVquCfi64OTEaTt2xQdR
|
36
|
+
JnC4lpJfCP6aCXa5h2XAQfPSH636cQap
|
38
37
|
-----END CERTIFICATE-----
|
39
|
-
date:
|
38
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
40
39
|
dependencies:
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: hoe-mercurial
|
@@ -58,14 +57,14 @@ dependencies:
|
|
58
57
|
requirements:
|
59
58
|
- - "~>"
|
60
59
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
60
|
+
version: '0.10'
|
62
61
|
type: :development
|
63
62
|
prerelease: false
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
65
64
|
requirements:
|
66
65
|
- - "~>"
|
67
66
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
67
|
+
version: '0.10'
|
69
68
|
- !ruby/object:Gem::Dependency
|
70
69
|
name: hoe-highline
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +99,14 @@ dependencies:
|
|
100
99
|
requirements:
|
101
100
|
- - "~>"
|
102
101
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
102
|
+
version: 0.7.0
|
104
103
|
type: :development
|
105
104
|
prerelease: false
|
106
105
|
version_requirements: !ruby/object:Gem::Requirement
|
107
106
|
requirements:
|
108
107
|
- - "~>"
|
109
108
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
109
|
+
version: 0.7.0
|
111
110
|
- !ruby/object:Gem::Dependency
|
112
111
|
name: hoe-bundler
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,7 +166,7 @@ dependencies:
|
|
167
166
|
description: |-
|
168
167
|
Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
|
169
168
|
|
170
|
-
It works with {PostgreSQL 9.
|
169
|
+
It works with {PostgreSQL 9.2 and later}[http://www.postgresql.org/support/versioning/].
|
171
170
|
|
172
171
|
A small example usage:
|
173
172
|
|
@@ -212,6 +211,7 @@ extra_rdoc_files:
|
|
212
211
|
- ext/pg_result.c
|
213
212
|
- ext/pg_text_decoder.c
|
214
213
|
- ext/pg_text_encoder.c
|
214
|
+
- ext/pg_tuple.c
|
215
215
|
- ext/pg_type_map.c
|
216
216
|
- ext/pg_type_map_all_strings.c
|
217
217
|
- ext/pg_type_map_by_class.c
|
@@ -252,6 +252,7 @@ files:
|
|
252
252
|
- ext/pg_result.c
|
253
253
|
- ext/pg_text_decoder.c
|
254
254
|
- ext/pg_text_encoder.c
|
255
|
+
- ext/pg_tuple.c
|
255
256
|
- ext/pg_type_map.c
|
256
257
|
- ext/pg_type_map_all_strings.c
|
257
258
|
- ext/pg_type_map_by_class.c
|
@@ -266,21 +267,24 @@ files:
|
|
266
267
|
- ext/vc/pg_19/pg_19.vcproj
|
267
268
|
- lib/pg.rb
|
268
269
|
- lib/pg/basic_type_mapping.rb
|
270
|
+
- lib/pg/binary_decoder.rb
|
269
271
|
- lib/pg/coder.rb
|
270
272
|
- lib/pg/connection.rb
|
271
273
|
- lib/pg/constants.rb
|
272
|
-
- lib/pg/deprecated_constants.rb
|
273
274
|
- lib/pg/exceptions.rb
|
274
275
|
- lib/pg/result.rb
|
275
276
|
- lib/pg/text_decoder.rb
|
276
277
|
- lib/pg/text_encoder.rb
|
278
|
+
- lib/pg/tuple.rb
|
277
279
|
- lib/pg/type_map_by_column.rb
|
278
280
|
- spec/data/expected_trace.out
|
279
281
|
- spec/data/random_binary_data
|
280
282
|
- spec/helpers.rb
|
281
283
|
- spec/pg/basic_type_mapping_spec.rb
|
282
284
|
- spec/pg/connection_spec.rb
|
285
|
+
- spec/pg/connection_sync_spec.rb
|
283
286
|
- spec/pg/result_spec.rb
|
287
|
+
- spec/pg/tuple_spec.rb
|
284
288
|
- spec/pg/type_map_by_class_spec.rb
|
285
289
|
- spec/pg/type_map_by_column_spec.rb
|
286
290
|
- spec/pg/type_map_by_mri_type_spec.rb
|
@@ -311,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
315
|
version: '0'
|
312
316
|
requirements: []
|
313
317
|
rubyforge_project:
|
314
|
-
rubygems_version: 2.
|
318
|
+
rubygems_version: 2.7.8
|
315
319
|
signing_key:
|
316
320
|
specification_version: 4
|
317
321
|
summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]
|