ydbd-pg 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/lib/dbd/pg/database.rb +10 -23
- data/lib/dbd/pg/statement.rb +2 -2
- data/readme.md +15 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71d83752c1f04376436c5b6b696996f5eb898559
|
4
|
+
data.tar.gz: ff2785ca777cf60f6ee4a17c5ce997998a0bf010
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1ae93a9054102f1d4c0f1cf10e8027e0f2b1ff34d2bcaa432f49010f4d53eea9b1d1a33ba6d202bedd5cb10a6fcdcbf6eb3f0ad7b93b3811d1714a5c833532a
|
7
|
+
data.tar.gz: c119b44896bd78e4318b1d5d6d7b8862702d3e17b54c7ef757cd908094ab2df35b1862fe5eaed622d9a2bf98f44c459c6e96ab987b8df35fa4c9a154e44ab088
|
data/ChangeLog
CHANGED
data/lib/dbd/pg/database.rb
CHANGED
@@ -79,7 +79,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
79
79
|
|
80
80
|
self['AutoCommit'] = true # Postgres starts in unchained mode (AutoCommit=on) by default
|
81
81
|
|
82
|
-
rescue
|
82
|
+
rescue PG::Error => err
|
83
83
|
raise DBI::OperationalError.new(err.message)
|
84
84
|
end
|
85
85
|
|
@@ -97,7 +97,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
97
97
|
else
|
98
98
|
return false
|
99
99
|
end
|
100
|
-
rescue
|
100
|
+
rescue PG::Error
|
101
101
|
return false
|
102
102
|
ensure
|
103
103
|
answer.clear if answer
|
@@ -321,19 +321,6 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
321
321
|
|
322
322
|
private
|
323
323
|
|
324
|
-
# special quoting if value is element of an array
|
325
|
-
def quote_array_elements( value )
|
326
|
-
# XXX is this method still being used?
|
327
|
-
case value
|
328
|
-
when Array
|
329
|
-
'{'+ value.collect{|v| quote_array_elements(v) }.join(',') + '}'
|
330
|
-
when String
|
331
|
-
'"' + value.gsub(/\\/){ '\\\\' }.gsub(/"/){ '\\"' } + '"'
|
332
|
-
else
|
333
|
-
quote( value ).sub(/^'/,'').sub(/'$/,'')
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
324
|
def parse_type_name(type_name)
|
338
325
|
case type_name
|
339
326
|
when 'bool' then DBI::Type::Boolean
|
@@ -427,7 +414,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
427
414
|
def __blob_import(file)
|
428
415
|
start_transaction unless @in_transaction
|
429
416
|
@connection.lo_import(file)
|
430
|
-
rescue
|
417
|
+
rescue PG::Error => err
|
431
418
|
raise DBI::DatabaseError.new(err.message)
|
432
419
|
end
|
433
420
|
|
@@ -437,7 +424,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
437
424
|
def __blob_export(oid, file)
|
438
425
|
start_transaction unless @in_transaction
|
439
426
|
@connection.lo_export(oid.to_i, file)
|
440
|
-
rescue
|
427
|
+
rescue PG::Error => err
|
441
428
|
raise DBI::DatabaseError.new(err.message)
|
442
429
|
end
|
443
430
|
|
@@ -447,7 +434,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
447
434
|
def __blob_create(mode=PGconn::INV_READ)
|
448
435
|
start_transaction unless @in_transaction
|
449
436
|
@connection.lo_creat(mode)
|
450
|
-
rescue
|
437
|
+
rescue PG::Error => err
|
451
438
|
raise DBI::DatabaseError.new(err.message)
|
452
439
|
end
|
453
440
|
|
@@ -457,7 +444,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
457
444
|
def __blob_open(oid, mode=PGconn::INV_READ)
|
458
445
|
start_transaction unless @in_transaction
|
459
446
|
@connection.lo_open(oid.to_i, mode)
|
460
|
-
rescue
|
447
|
+
rescue PG::Error => err
|
461
448
|
raise DBI::DatabaseError.new(err.message)
|
462
449
|
end
|
463
450
|
|
@@ -467,7 +454,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
467
454
|
def __blob_unlink(oid)
|
468
455
|
start_transaction unless @in_transaction
|
469
456
|
@connection.lo_unlink(oid.to_i)
|
470
|
-
rescue
|
457
|
+
rescue PG::Error => err
|
471
458
|
raise DBI::DatabaseError.new(err.message)
|
472
459
|
end
|
473
460
|
|
@@ -486,7 +473,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
486
473
|
# FIXME it doesn't like to close here either.
|
487
474
|
# @connection.lo_close(blob)
|
488
475
|
data
|
489
|
-
rescue
|
476
|
+
rescue PG::Error => err
|
490
477
|
raise DBI::DatabaseError.new(err.message)
|
491
478
|
end
|
492
479
|
|
@@ -502,7 +489,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
502
489
|
# up before release.
|
503
490
|
# @connection.lo_close(blob)
|
504
491
|
return res
|
505
|
-
rescue
|
492
|
+
rescue PG::Error => err
|
506
493
|
raise DBI::DatabaseError.new(err.message)
|
507
494
|
end
|
508
495
|
|
@@ -511,7 +498,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
511
498
|
#
|
512
499
|
def __set_notice_processor(proc)
|
513
500
|
@connection.set_notice_processor proc
|
514
|
-
rescue
|
501
|
+
rescue PG::Error => err
|
515
502
|
raise DBI::DatabaseError.new(err.message)
|
516
503
|
end
|
517
504
|
end # Database
|
data/lib/dbd/pg/statement.rb
CHANGED
@@ -18,7 +18,7 @@ class DBI::DBD::Pg::Statement < DBI::BaseStatement
|
|
18
18
|
@result = nil
|
19
19
|
@bindvars = []
|
20
20
|
@prepared = false
|
21
|
-
rescue
|
21
|
+
rescue PG::Error => err
|
22
22
|
raise DBI::ProgrammingError.new(err.message)
|
23
23
|
end
|
24
24
|
|
@@ -58,7 +58,7 @@ class DBI::DBD::Pg::Statement < DBI::BaseStatement
|
|
58
58
|
end
|
59
59
|
|
60
60
|
@result = DBI::DBD::Pg::Tuples.new(@db, pg_result)
|
61
|
-
rescue
|
61
|
+
rescue PG::Error, RuntimeError => err
|
62
62
|
raise DBI::ProgrammingError.new(err.message)
|
63
63
|
end
|
64
64
|
|
data/readme.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# Release a new ydbi gem
|
2
|
+
|
3
|
+
* rake ydbd-pg:clobber_package rake ydbd-pg:clobber_package; rake ydbi:gem ydbd-pg:gem
|
4
|
+
* gem push ydbd-pg-0.5.4.gem
|
5
|
+
* gem push ydbi-0.5.4.gem
|
6
|
+
|
1
7
|
# Description
|
2
8
|
The DBI package is a vendor independent interface for accessing databases.
|
3
9
|
It is similar, but not identical to, Perl's DBI module.
|
@@ -75,6 +81,15 @@
|
|
75
81
|
gem install dbd-sqlite3
|
76
82
|
gem install dbd-sqlite
|
77
83
|
|
84
|
+
If you have a non standard path of postgres use something like
|
85
|
+
|
86
|
+
gem install pg -- --with-pg-config=/usr/local/pgsql-10.1/bin/pg_config
|
87
|
+
|
88
|
+
Or if you are using bundler
|
89
|
+
|
90
|
+
bundle config build.pg --with-pg-config=/usr/local/pgsql-10.1/bin/pg_config
|
91
|
+
bundle install
|
92
|
+
|
78
93
|
## Without rubygems:
|
79
94
|
|
80
95
|
ruby setup.rb config
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ydbd-pg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Hollensbe
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-01-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ydbi
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.5.
|
20
|
+
version: 0.5.5
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.5.
|
27
|
+
version: 0.5.5
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: pg
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|