ydbd-pg 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ChangeLog +4 -0
- data/lib/dbd/pg/database.rb +5 -5
- data/lib/dbd/pg/statement.rb +1 -1
- data/lib/dbd/pg/type.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 42c01f8c1922a051c7b04b9a3d763af5ef65551485273de3b4e3a4c9513a51f9
|
4
|
+
data.tar.gz: c63db7945dd72312410f9592c5085fa4d3b52cc7dcee09aa20f407306f9c1e61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 142ffc1ef338062bd7886a32947518b8a54731e87831577dd0c1ab94f4cb75f8c2958d4aa571b915abd350960d5b45da998626282503548ab987260aaab83250
|
7
|
+
data.tar.gz: 92251913a560d06ffb890689826dc398464f5fd59991994144b049511157bb575599cfe8ea29d6253117bcaab5607dd8fdc5e1798e70dbe500d020e97f9a04a2
|
data/ChangeLog
CHANGED
data/lib/dbd/pg/database.rb
CHANGED
@@ -49,7 +49,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
49
49
|
hash['host'] ||= 'localhost'
|
50
50
|
hash['port'] = hash['port'].to_i unless hash['port'].nil?
|
51
51
|
|
52
|
-
@connection =
|
52
|
+
@connection = PG::Connection.new(hash['host'], hash['port'], hash['options'], hash['tty'],
|
53
53
|
hash['dbname'] || hash['database'], user, auth)
|
54
54
|
|
55
55
|
@exec_method = :exec
|
@@ -431,7 +431,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
431
431
|
#
|
432
432
|
# Create a BLOB.
|
433
433
|
#
|
434
|
-
def __blob_create(mode=
|
434
|
+
def __blob_create(mode=PG::Connection::INV_READ)
|
435
435
|
start_transaction unless @in_transaction
|
436
436
|
@connection.lo_creat(mode)
|
437
437
|
rescue PG::Error => err
|
@@ -441,7 +441,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
441
441
|
#
|
442
442
|
# Open a BLOB.
|
443
443
|
#
|
444
|
-
def __blob_open(oid, mode=
|
444
|
+
def __blob_open(oid, mode=PG::Connection::INV_READ)
|
445
445
|
start_transaction unless @in_transaction
|
446
446
|
@connection.lo_open(oid.to_i, mode)
|
447
447
|
rescue PG::Error => err
|
@@ -462,7 +462,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
462
462
|
# Read a BLOB and return the data.
|
463
463
|
#
|
464
464
|
def __blob_read(oid, length)
|
465
|
-
blob = @connection.lo_open(oid.to_i,
|
465
|
+
blob = @connection.lo_open(oid.to_i, PG::Connection::INV_READ)
|
466
466
|
|
467
467
|
if length.nil?
|
468
468
|
data = @connection.lo_read(blob)
|
@@ -482,7 +482,7 @@ class DBI::DBD::Pg::Database < DBI::BaseDatabase
|
|
482
482
|
#
|
483
483
|
def __blob_write(oid, value)
|
484
484
|
start_transaction unless @in_transaction
|
485
|
-
blob = @connection.lo_open(oid.to_i,
|
485
|
+
blob = @connection.lo_open(oid.to_i, PG::Connection::INV_WRITE)
|
486
486
|
res = @connection.lo_write(blob, value)
|
487
487
|
# FIXME not sure why PG doesn't like to close here -- seems to be
|
488
488
|
# working but we should make sure it's not eating file descriptors
|
data/lib/dbd/pg/statement.rb
CHANGED
@@ -36,7 +36,7 @@ class DBI::DBD::Pg::Statement < DBI::BaseStatement
|
|
36
36
|
# replace DBI::Binary object by oid returned by lo_import
|
37
37
|
@bindvars.collect! do |var|
|
38
38
|
if var.is_a? DBI::Binary then
|
39
|
-
oid = @db.__blob_create(
|
39
|
+
oid = @db.__blob_create(PG::Connection::INV_WRITE)
|
40
40
|
@db.__blob_write(oid, var.to_s)
|
41
41
|
oid
|
42
42
|
else
|
data/lib/dbd/pg/type.rb
CHANGED
@@ -32,7 +32,7 @@ module DBI::DBD::Pg::Type
|
|
32
32
|
# Escapes the supplied data. Has no effect on the object.
|
33
33
|
#
|
34
34
|
def escape_bytea(str)
|
35
|
-
|
35
|
+
PG::Connection.escape_bytea(str)
|
36
36
|
end
|
37
37
|
|
38
38
|
#
|
@@ -62,7 +62,7 @@ module DBI::DBD::Pg::Type
|
|
62
62
|
#
|
63
63
|
# Fix this for now, but beware that we'll have to unfix this as
|
64
64
|
# soon as they fix their end.
|
65
|
-
ret =
|
65
|
+
ret = PG::Connection.unescape_bytea(obj)
|
66
66
|
|
67
67
|
# XXX
|
68
68
|
# String#split does not properly create a full array if the the
|
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.6
|
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: 2018-01-
|
12
|
+
date: 2018-01-23 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.6
|
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.6
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: pg
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project: ydbi
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.7.3
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: PostgreSQL DBI DBD
|