pg 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +3 -0
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/BSDL +22 -0
- data/ChangeLog +6595 -0
- data/Contributors.rdoc +46 -0
- data/History.rdoc +492 -0
- data/LICENSE +56 -0
- data/Manifest.txt +72 -0
- data/POSTGRES +23 -0
- data/README-OS_X.rdoc +68 -0
- data/README-Windows.rdoc +56 -0
- data/README.ja.rdoc +14 -0
- data/README.rdoc +178 -0
- data/Rakefile +215 -0
- data/Rakefile.cross +298 -0
- data/ext/errorcodes.def +968 -0
- data/ext/errorcodes.rb +45 -0
- data/ext/errorcodes.txt +478 -0
- data/ext/extconf.rb +94 -0
- data/ext/gvl_wrappers.c +17 -0
- data/ext/gvl_wrappers.h +241 -0
- data/ext/pg.c +640 -0
- data/ext/pg.h +365 -0
- data/ext/pg_binary_decoder.c +229 -0
- data/ext/pg_binary_encoder.c +162 -0
- data/ext/pg_coder.c +549 -0
- data/ext/pg_connection.c +4252 -0
- data/ext/pg_copy_coder.c +596 -0
- data/ext/pg_errors.c +95 -0
- data/ext/pg_result.c +1501 -0
- data/ext/pg_text_decoder.c +981 -0
- data/ext/pg_text_encoder.c +682 -0
- data/ext/pg_tuple.c +541 -0
- data/ext/pg_type_map.c +166 -0
- data/ext/pg_type_map_all_strings.c +116 -0
- data/ext/pg_type_map_by_class.c +239 -0
- data/ext/pg_type_map_by_column.c +312 -0
- data/ext/pg_type_map_by_mri_type.c +284 -0
- data/ext/pg_type_map_by_oid.c +355 -0
- data/ext/pg_type_map_in_ruby.c +299 -0
- data/ext/util.c +149 -0
- data/ext/util.h +65 -0
- data/ext/vc/pg.sln +26 -0
- data/ext/vc/pg_18/pg.vcproj +216 -0
- data/ext/vc/pg_19/pg_19.vcproj +209 -0
- data/lib/pg.rb +74 -0
- data/lib/pg/basic_type_mapping.rb +459 -0
- data/lib/pg/binary_decoder.rb +22 -0
- data/lib/pg/coder.rb +83 -0
- data/lib/pg/connection.rb +291 -0
- data/lib/pg/constants.rb +11 -0
- data/lib/pg/exceptions.rb +11 -0
- data/lib/pg/result.rb +31 -0
- data/lib/pg/text_decoder.rb +47 -0
- data/lib/pg/text_encoder.rb +69 -0
- data/lib/pg/tuple.rb +30 -0
- data/lib/pg/type_map_by_column.rb +15 -0
- data/spec/data/expected_trace.out +26 -0
- data/spec/data/random_binary_data +0 -0
- data/spec/helpers.rb +380 -0
- data/spec/pg/basic_type_mapping_spec.rb +508 -0
- data/spec/pg/connection_spec.rb +1872 -0
- data/spec/pg/connection_sync_spec.rb +41 -0
- data/spec/pg/result_spec.rb +491 -0
- data/spec/pg/tuple_spec.rb +280 -0
- data/spec/pg/type_map_by_class_spec.rb +138 -0
- data/spec/pg/type_map_by_column_spec.rb +222 -0
- data/spec/pg/type_map_by_mri_type_spec.rb +136 -0
- data/spec/pg/type_map_by_oid_spec.rb +149 -0
- data/spec/pg/type_map_in_ruby_spec.rb +164 -0
- data/spec/pg/type_map_spec.rb +22 -0
- data/spec/pg/type_spec.rb +949 -0
- data/spec/pg_spec.rb +50 -0
- metadata +322 -0
- metadata.gz.sig +0 -0
data/spec/pg_spec.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# -*- rspec -*-
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
require_relative 'helpers'
|
5
|
+
|
6
|
+
require 'pg'
|
7
|
+
|
8
|
+
describe PG do
|
9
|
+
|
10
|
+
it "knows what version of the libpq library is loaded" do
|
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)
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
it "knows whether or not the library is threadsafe" do
|
31
|
+
expect( PG ).to be_threadsafe()
|
32
|
+
end
|
33
|
+
|
34
|
+
it "does have hierarchical error classes" do
|
35
|
+
expect( PG::UndefinedTable.ancestors[0,4] ).to eq([
|
36
|
+
PG::UndefinedTable,
|
37
|
+
PG::SyntaxErrorOrAccessRuleViolation,
|
38
|
+
PG::ServerError,
|
39
|
+
PG::Error
|
40
|
+
])
|
41
|
+
|
42
|
+
expect( PG::InvalidSchemaName.ancestors[0,3] ).to eq([
|
43
|
+
PG::InvalidSchemaName,
|
44
|
+
PG::ServerError,
|
45
|
+
PG::Error
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
metadata
ADDED
@@ -0,0 +1,322 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Granger
|
8
|
+
- Lars Kanis
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
15
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0xODExMjAxODI5NTlaFw0xOTExMjAxODI5
|
16
|
+
NTlaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
17
|
+
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
18
|
+
L60U0p0euIurpv84op9CNK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33
|
+
tkSyLrfZ+RZcH535Hyvif7ZxB0v5OxXXoec+N2vrUsEUMRDL9dg4/WFdN8hIOixF
|
34
|
+
3IPKpZ1ho0Ya5q7yhygtBK9/NBFHw+nbJjcltfPDBXleRe8u73gnQo8AZIhStYSP
|
35
|
+
v4qqqa27Bs468d6SoPxjSm8a2mM9HZ4OdWhq4tFsbTeXDVquCfi64OTEaTt2xQdR
|
36
|
+
JnC4lpJfCP6aCXa5h2XAQfPSH636cQap
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: hoe-mercurial
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.4'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.4'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: hoe-deveiate
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.10'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0.10'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: hoe-highline
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0.2'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.2'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rake-compiler
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rake-compiler-dock
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.7.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.7.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: hoe-bundler
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '1.0'
|
117
|
+
type: :development
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '1.0'
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: rspec
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '3.5'
|
131
|
+
type: :development
|
132
|
+
prerelease: false
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '3.5'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: rdoc
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '5.1'
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '5.1'
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: hoe
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '3.16'
|
159
|
+
type: :development
|
160
|
+
prerelease: false
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '3.16'
|
166
|
+
description: |-
|
167
|
+
Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
|
168
|
+
|
169
|
+
It works with {PostgreSQL 9.2 and later}[http://www.postgresql.org/support/versioning/].
|
170
|
+
|
171
|
+
A small example usage:
|
172
|
+
|
173
|
+
#!/usr/bin/env ruby
|
174
|
+
|
175
|
+
require 'pg'
|
176
|
+
|
177
|
+
# Output a table of current connections to the DB
|
178
|
+
conn = PG.connect( dbname: 'sales' )
|
179
|
+
conn.exec( "SELECT * FROM pg_stat_activity" ) do |result|
|
180
|
+
puts " PID | User | Query"
|
181
|
+
result.each do |row|
|
182
|
+
puts " %7d | %-16s | %s " %
|
183
|
+
row.values_at('procpid', 'usename', 'current_query')
|
184
|
+
end
|
185
|
+
end
|
186
|
+
email:
|
187
|
+
- ged@FaerieMUD.org
|
188
|
+
- lars@greiz-reinsdorf.de
|
189
|
+
executables: []
|
190
|
+
extensions:
|
191
|
+
- ext/extconf.rb
|
192
|
+
extra_rdoc_files:
|
193
|
+
- Contributors.rdoc
|
194
|
+
- History.rdoc
|
195
|
+
- Manifest.txt
|
196
|
+
- README-OS_X.rdoc
|
197
|
+
- README-Windows.rdoc
|
198
|
+
- README.ja.rdoc
|
199
|
+
- README.rdoc
|
200
|
+
- ext/errorcodes.txt
|
201
|
+
- POSTGRES
|
202
|
+
- LICENSE
|
203
|
+
- ext/gvl_wrappers.c
|
204
|
+
- ext/pg.c
|
205
|
+
- ext/pg_binary_decoder.c
|
206
|
+
- ext/pg_binary_encoder.c
|
207
|
+
- ext/pg_coder.c
|
208
|
+
- ext/pg_connection.c
|
209
|
+
- ext/pg_copy_coder.c
|
210
|
+
- ext/pg_errors.c
|
211
|
+
- ext/pg_result.c
|
212
|
+
- ext/pg_text_decoder.c
|
213
|
+
- ext/pg_text_encoder.c
|
214
|
+
- ext/pg_tuple.c
|
215
|
+
- ext/pg_type_map.c
|
216
|
+
- ext/pg_type_map_all_strings.c
|
217
|
+
- ext/pg_type_map_by_class.c
|
218
|
+
- ext/pg_type_map_by_column.c
|
219
|
+
- ext/pg_type_map_by_mri_type.c
|
220
|
+
- ext/pg_type_map_by_oid.c
|
221
|
+
- ext/pg_type_map_in_ruby.c
|
222
|
+
- ext/util.c
|
223
|
+
files:
|
224
|
+
- ".gemtest"
|
225
|
+
- BSDL
|
226
|
+
- ChangeLog
|
227
|
+
- Contributors.rdoc
|
228
|
+
- History.rdoc
|
229
|
+
- LICENSE
|
230
|
+
- Manifest.txt
|
231
|
+
- POSTGRES
|
232
|
+
- README-OS_X.rdoc
|
233
|
+
- README-Windows.rdoc
|
234
|
+
- README.ja.rdoc
|
235
|
+
- README.rdoc
|
236
|
+
- Rakefile
|
237
|
+
- Rakefile.cross
|
238
|
+
- ext/errorcodes.def
|
239
|
+
- ext/errorcodes.rb
|
240
|
+
- ext/errorcodes.txt
|
241
|
+
- ext/extconf.rb
|
242
|
+
- ext/gvl_wrappers.c
|
243
|
+
- ext/gvl_wrappers.h
|
244
|
+
- ext/pg.c
|
245
|
+
- ext/pg.h
|
246
|
+
- ext/pg_binary_decoder.c
|
247
|
+
- ext/pg_binary_encoder.c
|
248
|
+
- ext/pg_coder.c
|
249
|
+
- ext/pg_connection.c
|
250
|
+
- ext/pg_copy_coder.c
|
251
|
+
- ext/pg_errors.c
|
252
|
+
- ext/pg_result.c
|
253
|
+
- ext/pg_text_decoder.c
|
254
|
+
- ext/pg_text_encoder.c
|
255
|
+
- ext/pg_tuple.c
|
256
|
+
- ext/pg_type_map.c
|
257
|
+
- ext/pg_type_map_all_strings.c
|
258
|
+
- ext/pg_type_map_by_class.c
|
259
|
+
- ext/pg_type_map_by_column.c
|
260
|
+
- ext/pg_type_map_by_mri_type.c
|
261
|
+
- ext/pg_type_map_by_oid.c
|
262
|
+
- ext/pg_type_map_in_ruby.c
|
263
|
+
- ext/util.c
|
264
|
+
- ext/util.h
|
265
|
+
- ext/vc/pg.sln
|
266
|
+
- ext/vc/pg_18/pg.vcproj
|
267
|
+
- ext/vc/pg_19/pg_19.vcproj
|
268
|
+
- lib/pg.rb
|
269
|
+
- lib/pg/basic_type_mapping.rb
|
270
|
+
- lib/pg/binary_decoder.rb
|
271
|
+
- lib/pg/coder.rb
|
272
|
+
- lib/pg/connection.rb
|
273
|
+
- lib/pg/constants.rb
|
274
|
+
- lib/pg/exceptions.rb
|
275
|
+
- lib/pg/result.rb
|
276
|
+
- lib/pg/text_decoder.rb
|
277
|
+
- lib/pg/text_encoder.rb
|
278
|
+
- lib/pg/tuple.rb
|
279
|
+
- lib/pg/type_map_by_column.rb
|
280
|
+
- spec/data/expected_trace.out
|
281
|
+
- spec/data/random_binary_data
|
282
|
+
- spec/helpers.rb
|
283
|
+
- spec/pg/basic_type_mapping_spec.rb
|
284
|
+
- spec/pg/connection_spec.rb
|
285
|
+
- spec/pg/connection_sync_spec.rb
|
286
|
+
- spec/pg/result_spec.rb
|
287
|
+
- spec/pg/tuple_spec.rb
|
288
|
+
- spec/pg/type_map_by_class_spec.rb
|
289
|
+
- spec/pg/type_map_by_column_spec.rb
|
290
|
+
- spec/pg/type_map_by_mri_type_spec.rb
|
291
|
+
- spec/pg/type_map_by_oid_spec.rb
|
292
|
+
- spec/pg/type_map_in_ruby_spec.rb
|
293
|
+
- spec/pg/type_map_spec.rb
|
294
|
+
- spec/pg/type_spec.rb
|
295
|
+
- spec/pg_spec.rb
|
296
|
+
homepage: https://bitbucket.org/ged/ruby-pg
|
297
|
+
licenses:
|
298
|
+
- BSD-3-Clause
|
299
|
+
metadata: {}
|
300
|
+
post_install_message:
|
301
|
+
rdoc_options:
|
302
|
+
- "--main"
|
303
|
+
- README.rdoc
|
304
|
+
require_paths:
|
305
|
+
- lib
|
306
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
307
|
+
requirements:
|
308
|
+
- - ">="
|
309
|
+
- !ruby/object:Gem::Version
|
310
|
+
version: 2.0.0
|
311
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
|
+
requirements:
|
313
|
+
- - ">="
|
314
|
+
- !ruby/object:Gem::Version
|
315
|
+
version: '0'
|
316
|
+
requirements: []
|
317
|
+
rubyforge_project:
|
318
|
+
rubygems_version: 2.7.8
|
319
|
+
signing_key:
|
320
|
+
specification_version: 4
|
321
|
+
summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]
|
322
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|