pg 0.17.1 → 0.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/ChangeLog +2407 -2
  4. data/History.rdoc +68 -0
  5. data/Manifest.txt +29 -1
  6. data/README-Windows.rdoc +15 -26
  7. data/README.rdoc +52 -2
  8. data/Rakefile +56 -18
  9. data/Rakefile.cross +77 -49
  10. data/ext/extconf.rb +33 -26
  11. data/ext/pg.c +142 -21
  12. data/ext/pg.h +242 -6
  13. data/ext/pg_binary_decoder.c +162 -0
  14. data/ext/pg_binary_encoder.c +162 -0
  15. data/ext/pg_coder.c +479 -0
  16. data/ext/pg_connection.c +858 -553
  17. data/ext/pg_copy_coder.c +561 -0
  18. data/ext/pg_errors.c +6 -0
  19. data/ext/pg_result.c +479 -128
  20. data/ext/pg_text_decoder.c +421 -0
  21. data/ext/pg_text_encoder.c +663 -0
  22. data/ext/pg_type_map.c +159 -0
  23. data/ext/pg_type_map_all_strings.c +116 -0
  24. data/ext/pg_type_map_by_class.c +239 -0
  25. data/ext/pg_type_map_by_column.c +312 -0
  26. data/ext/pg_type_map_by_mri_type.c +284 -0
  27. data/ext/pg_type_map_by_oid.c +355 -0
  28. data/ext/pg_type_map_in_ruby.c +299 -0
  29. data/ext/util.c +149 -0
  30. data/ext/util.h +65 -0
  31. data/lib/pg/basic_type_mapping.rb +399 -0
  32. data/lib/pg/coder.rb +83 -0
  33. data/lib/pg/connection.rb +81 -29
  34. data/lib/pg/result.rb +13 -3
  35. data/lib/pg/text_decoder.rb +44 -0
  36. data/lib/pg/text_encoder.rb +27 -0
  37. data/lib/pg/type_map_by_column.rb +15 -0
  38. data/lib/pg.rb +12 -2
  39. data/spec/{lib/helpers.rb → helpers.rb} +101 -39
  40. data/spec/pg/basic_type_mapping_spec.rb +251 -0
  41. data/spec/pg/connection_spec.rb +516 -218
  42. data/spec/pg/result_spec.rb +216 -112
  43. data/spec/pg/type_map_by_class_spec.rb +138 -0
  44. data/spec/pg/type_map_by_column_spec.rb +222 -0
  45. data/spec/pg/type_map_by_mri_type_spec.rb +136 -0
  46. data/spec/pg/type_map_by_oid_spec.rb +149 -0
  47. data/spec/pg/type_map_in_ruby_spec.rb +164 -0
  48. data/spec/pg/type_map_spec.rb +22 -0
  49. data/spec/pg/type_spec.rb +697 -0
  50. data/spec/pg_spec.rb +24 -18
  51. data.tar.gz.sig +0 -0
  52. metadata +111 -45
  53. metadata.gz.sig +0 -0
data/spec/pg_spec.rb CHANGED
@@ -1,43 +1,49 @@
1
1
  #!/usr/bin/env rspec
2
2
  # encoding: utf-8
3
3
 
4
- BEGIN {
5
- require 'pathname'
4
+ require_relative 'helpers'
6
5
 
7
- basedir = Pathname( __FILE__ ).dirname.parent
8
- libdir = basedir + 'lib'
9
-
10
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
11
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
12
- }
13
-
14
- require 'rspec'
15
- require 'spec/lib/helpers'
16
6
  require 'pg'
17
7
 
18
8
  describe PG do
19
9
 
20
10
  it "knows what version of the libpq library is loaded", :postgresql_91 do
21
- PG.library_version.should be_an( Integer )
22
- PG.library_version.should >= 90100
11
+ expect( PG.library_version ).to be_an( Integer )
12
+ expect( PG.library_version ).to be >= 90100
13
+ end
14
+
15
+ it "can select which of both security libraries to initialize" do
16
+ # This setting does nothing here, because there is already a connection
17
+ # to the server, at this point in time.
18
+ PG.init_openssl(false, true)
19
+ PG.init_openssl(1, 0)
20
+ end
21
+
22
+ it "can select whether security libraries to initialize" do
23
+ # This setting does nothing here, because there is already a connection
24
+ # to the server, at this point in time.
25
+ PG.init_ssl(false)
26
+ PG.init_ssl(1)
23
27
  end
24
28
 
25
29
 
26
30
  it "knows whether or not the library is threadsafe" do
27
- PG.should be_threadsafe()
31
+ expect( PG ).to be_threadsafe()
28
32
  end
29
33
 
30
34
  it "does have hierarchical error classes" do
31
- PG::UndefinedTable.ancestors[0,4].should == [
35
+ expect( PG::UndefinedTable.ancestors[0,4] ).to eq([
32
36
  PG::UndefinedTable,
33
37
  PG::SyntaxErrorOrAccessRuleViolation,
34
38
  PG::ServerError,
35
- PG::Error]
39
+ PG::Error
40
+ ])
36
41
 
37
- PG::InvalidSchemaName.ancestors[0,3].should == [
42
+ expect( PG::InvalidSchemaName.ancestors[0,3] ).to eq([
38
43
  PG::InvalidSchemaName,
39
44
  PG::ServerError,
40
- PG::Error]
45
+ PG::Error
46
+ ])
41
47
  end
42
48
 
43
49
  end
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: 0.17.1
4
+ version: 0.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -13,7 +13,7 @@ cert_chain:
13
13
  -----BEGIN CERTIFICATE-----
14
14
  MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQwwCgYDVQQDDANnZWQx
15
15
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
16
- HhcNMTMwMjI3MTY0ODU4WhcNMTQwMjI3MTY0ODU4WjA+MQwwCgYDVQQDDANnZWQx
16
+ HhcNMTUwNDAxMjEyNDEzWhcNMTYwMzMxMjEyNDEzWjA+MQwwCgYDVQQDDANnZWQx
17
17
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
18
18
  ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDb92mkyYwuGBg1oRxt2tkH
19
19
  +Uo3LAsaL/APBfSLzy8o3+B3AUHKCjMUaVeBoZdWtMHB75X3VQlvXfZMyBxj59Vo
@@ -24,113 +24,141 @@ cert_chain:
24
24
  AgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBSZ0hCV
25
25
  qoHr122fGKelqffzEQBhszAcBgNVHREEFTATgRFnZWRARmFlcmllTVVELm9yZzAc
26
26
  BgNVHRIEFTATgRFnZWRARmFlcmllTVVELm9yZzANBgkqhkiG9w0BAQUFAAOCAQEA
27
- Vlcfyq6GwyE8i0QuFPCeVOwJaneSvcwx316DApjy9/tt2YD2HomLbtpXtji5QXor
28
- ON6oln4tWBIB3Klbr3szq5oR3Rc1D02SaBTalxSndp4M6UkW9hRFu5jn98pDB4fq
29
- 5l8wMMU0Xdmqx1VYvysVAjVFVC/W4NNvlmg+2mEgSVZP5K6Tc9qDh3eMQInoYw6h
30
- t1YA6RsUJHp5vGQyhP1x34YpLAaly8icbns/8PqOf7Osn9ztmg8bOMJCeb32eQLj
31
- 6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
32
- /YSusaiDXHKU2O3Akc3htA==
27
+ lUKo3NXePpuvN3QGsOLJ6QhNd4+Q9Rz75GipuMrCl296V8QFkd2gg9EG44Pqtk+9
28
+ Zac8TkKc9bCSR0snakp+cCPplVvZF0/gMzkSTUJkDBHlNV16z73CyWpbQQa+iLJ4
29
+ uisI6gF2ZXK919MYLn2bFJfb7OsCvVfyTPqq8afPY+rq9vlf9ZPwU49AlD8bPRic
30
+ 0LX0gO5ykvETIOv+WgGcqp96ceNi9XVuJMh20uWuw6pmv/Ub2RqAf82jQSbpz09G
31
+ G8LHR7EjtPPmqCCunfyecJ6MmCNaiJCBxq2NYzyNmluPyHT8+0fuB5kccUVZm6CD
32
+ xn3DzOkDE6NYbk8gC9rTsA==
33
33
  -----END CERTIFICATE-----
34
- date: 2013-12-19 00:00:00.000000000 Z
34
+ date: 2015-11-13 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe-mercurial
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 1.4.0
42
+ version: '1.4'
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 1.4.0
49
+ version: '1.4'
50
+ - !ruby/object:Gem::Dependency
51
+ name: hoe-deveiate
52
+ requirement: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '0.7'
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0.7'
50
64
  - !ruby/object:Gem::Dependency
51
65
  name: hoe-highline
52
66
  requirement: !ruby/object:Gem::Requirement
53
67
  requirements:
54
- - - ~>
68
+ - - "~>"
55
69
  - !ruby/object:Gem::Version
56
- version: 0.1.0
70
+ version: '0.2'
57
71
  type: :development
58
72
  prerelease: false
59
73
  version_requirements: !ruby/object:Gem::Requirement
60
74
  requirements:
61
- - - ~>
75
+ - - "~>"
62
76
  - !ruby/object:Gem::Version
63
- version: 0.1.0
77
+ version: '0.2'
64
78
  - !ruby/object:Gem::Dependency
65
79
  name: rdoc
66
80
  requirement: !ruby/object:Gem::Requirement
67
81
  requirements:
68
- - - ~>
82
+ - - "~>"
69
83
  - !ruby/object:Gem::Version
70
84
  version: '4.0'
71
85
  type: :development
72
86
  prerelease: false
73
87
  version_requirements: !ruby/object:Gem::Requirement
74
88
  requirements:
75
- - - ~>
89
+ - - "~>"
76
90
  - !ruby/object:Gem::Version
77
91
  version: '4.0'
78
92
  - !ruby/object:Gem::Dependency
79
93
  name: rake-compiler
80
94
  requirement: !ruby/object:Gem::Requirement
81
95
  requirements:
82
- - - ~>
96
+ - - "~>"
83
97
  - !ruby/object:Gem::Version
84
98
  version: '0.9'
85
99
  type: :development
86
100
  prerelease: false
87
101
  version_requirements: !ruby/object:Gem::Requirement
88
102
  requirements:
89
- - - ~>
103
+ - - "~>"
90
104
  - !ruby/object:Gem::Version
91
105
  version: '0.9'
92
106
  - !ruby/object:Gem::Dependency
93
- name: hoe
107
+ name: rake-compiler-dock
94
108
  requirement: !ruby/object:Gem::Requirement
95
109
  requirements:
96
- - - ~>
110
+ - - "~>"
97
111
  - !ruby/object:Gem::Version
98
- version: 3.5.1
112
+ version: '0.3'
99
113
  type: :development
100
114
  prerelease: false
101
115
  version_requirements: !ruby/object:Gem::Requirement
102
116
  requirements:
103
- - - ~>
117
+ - - "~>"
104
118
  - !ruby/object:Gem::Version
105
- version: 3.5.1
119
+ version: '0.3'
106
120
  - !ruby/object:Gem::Dependency
107
- name: hoe-deveiate
121
+ name: hoe
108
122
  requirement: !ruby/object:Gem::Requirement
109
123
  requirements:
110
- - - ~>
124
+ - - "~>"
111
125
  - !ruby/object:Gem::Version
112
- version: '0.2'
126
+ version: '3.12'
113
127
  type: :development
114
128
  prerelease: false
115
129
  version_requirements: !ruby/object:Gem::Requirement
116
130
  requirements:
117
- - - ~>
131
+ - - "~>"
118
132
  - !ruby/object:Gem::Version
119
- version: '0.2'
133
+ version: '3.12'
120
134
  - !ruby/object:Gem::Dependency
121
135
  name: hoe-bundler
122
136
  requirement: !ruby/object:Gem::Requirement
123
137
  requirements:
124
- - - ~>
138
+ - - "~>"
125
139
  - !ruby/object:Gem::Version
126
140
  version: '1.0'
127
141
  type: :development
128
142
  prerelease: false
129
143
  version_requirements: !ruby/object:Gem::Requirement
130
144
  requirements:
131
- - - ~>
145
+ - - "~>"
132
146
  - !ruby/object:Gem::Version
133
147
  version: '1.0'
148
+ - !ruby/object:Gem::Dependency
149
+ name: rspec
150
+ requirement: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: '3.0'
155
+ type: :development
156
+ prerelease: false
157
+ version_requirements: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: '3.0'
134
162
  description: |-
135
163
  Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
136
164
 
@@ -170,11 +198,25 @@ extra_rdoc_files:
170
198
  - LICENSE
171
199
  - ext/gvl_wrappers.c
172
200
  - ext/pg.c
201
+ - ext/pg_binary_decoder.c
202
+ - ext/pg_binary_encoder.c
203
+ - ext/pg_coder.c
173
204
  - ext/pg_connection.c
205
+ - ext/pg_copy_coder.c
174
206
  - ext/pg_errors.c
175
207
  - ext/pg_result.c
208
+ - ext/pg_text_decoder.c
209
+ - ext/pg_text_encoder.c
210
+ - ext/pg_type_map.c
211
+ - ext/pg_type_map_all_strings.c
212
+ - ext/pg_type_map_by_class.c
213
+ - ext/pg_type_map_by_column.c
214
+ - ext/pg_type_map_by_mri_type.c
215
+ - ext/pg_type_map_by_oid.c
216
+ - ext/pg_type_map_in_ruby.c
217
+ - ext/util.c
176
218
  files:
177
- - .gemtest
219
+ - ".gemtest"
178
220
  - BSDL
179
221
  - ChangeLog
180
222
  - Contributors.rdoc
@@ -196,17 +238,37 @@ files:
196
238
  - ext/gvl_wrappers.h
197
239
  - ext/pg.c
198
240
  - ext/pg.h
241
+ - ext/pg_binary_decoder.c
242
+ - ext/pg_binary_encoder.c
243
+ - ext/pg_coder.c
199
244
  - ext/pg_connection.c
245
+ - ext/pg_copy_coder.c
200
246
  - ext/pg_errors.c
201
247
  - ext/pg_result.c
248
+ - ext/pg_text_decoder.c
249
+ - ext/pg_text_encoder.c
250
+ - ext/pg_type_map.c
251
+ - ext/pg_type_map_all_strings.c
252
+ - ext/pg_type_map_by_class.c
253
+ - ext/pg_type_map_by_column.c
254
+ - ext/pg_type_map_by_mri_type.c
255
+ - ext/pg_type_map_by_oid.c
256
+ - ext/pg_type_map_in_ruby.c
257
+ - ext/util.c
258
+ - ext/util.h
202
259
  - ext/vc/pg.sln
203
260
  - ext/vc/pg_18/pg.vcproj
204
261
  - ext/vc/pg_19/pg_19.vcproj
205
262
  - lib/pg.rb
263
+ - lib/pg/basic_type_mapping.rb
264
+ - lib/pg/coder.rb
206
265
  - lib/pg/connection.rb
207
266
  - lib/pg/constants.rb
208
267
  - lib/pg/exceptions.rb
209
268
  - lib/pg/result.rb
269
+ - lib/pg/text_decoder.rb
270
+ - lib/pg/text_encoder.rb
271
+ - lib/pg/type_map_by_column.rb
210
272
  - sample/array_insert.rb
211
273
  - sample/async_api.rb
212
274
  - sample/async_copyto.rb
@@ -227,9 +289,17 @@ files:
227
289
  - sample/warehouse_partitions.rb
228
290
  - spec/data/expected_trace.out
229
291
  - spec/data/random_binary_data
230
- - spec/lib/helpers.rb
292
+ - spec/helpers.rb
293
+ - spec/pg/basic_type_mapping_spec.rb
231
294
  - spec/pg/connection_spec.rb
232
295
  - spec/pg/result_spec.rb
296
+ - spec/pg/type_map_by_class_spec.rb
297
+ - spec/pg/type_map_by_column_spec.rb
298
+ - spec/pg/type_map_by_mri_type_spec.rb
299
+ - spec/pg/type_map_by_oid_spec.rb
300
+ - spec/pg/type_map_in_ruby_spec.rb
301
+ - spec/pg/type_map_spec.rb
302
+ - spec/pg/type_spec.rb
233
303
  - spec/pg_spec.rb
234
304
  homepage: https://bitbucket.org/ged/ruby-pg
235
305
  licenses:
@@ -239,27 +309,23 @@ licenses:
239
309
  metadata: {}
240
310
  post_install_message:
241
311
  rdoc_options:
242
- - -f
243
- - fivefish
244
- - -t
245
- - 'pg: The Ruby Interface to PostgreSQL'
246
- - -m
312
+ - "--main"
247
313
  - README.rdoc
248
314
  require_paths:
249
315
  - lib
250
316
  required_ruby_version: !ruby/object:Gem::Requirement
251
317
  requirements:
252
- - - '>='
318
+ - - ">="
253
319
  - !ruby/object:Gem::Version
254
- version: 1.8.7
320
+ version: 1.9.3
255
321
  required_rubygems_version: !ruby/object:Gem::Requirement
256
322
  requirements:
257
- - - '>='
323
+ - - ">="
258
324
  - !ruby/object:Gem::Version
259
325
  version: '0'
260
326
  requirements: []
261
- rubyforge_project: pg
262
- rubygems_version: 2.1.11
327
+ rubyforge_project:
328
+ rubygems_version: 2.4.5.1
263
329
  signing_key:
264
330
  specification_version: 4
265
331
  summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]
metadata.gz.sig CHANGED
Binary file