db-postgres 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- data/lib/db/postgres/native/connection.rb +2 -3
- data/lib/db/postgres/native/result.rb +5 -1
- data/lib/db/postgres/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd023d0017d7e3a5b859c0072e9c6073b1d2f0d33a80e2602e3b10ab3fc1774a
|
4
|
+
data.tar.gz: 4df334b62fb206775e8d18bc2e9431d240098b84f67a4c6c8d04e3f1ee88f24b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d473ba682e4fc823c5945d05d6265d5c31a11edbc4946de842ee2ab42f6867fc6c1cdd01130374f11e9605f6ab4655bb7ad7232cf3655925c9ee20cf3beb9a3c
|
7
|
+
data.tar.gz: 54c94c483f379b1b1d601c2d3ce8c86477a4a7395b73b196b1a546e166413393aa4534d28f8a77a3de3179b43f386791b4798fd4fcda170adeaf8720e9da3482
|
@@ -113,6 +113,7 @@ module DB
|
|
113
113
|
values = Native.array_of_strings(options.values)
|
114
114
|
|
115
115
|
pointer = Native.connect_start_params(keys, values, 0)
|
116
|
+
Native.set_nonblocking(pointer, 1)
|
116
117
|
|
117
118
|
io = wrapper.new(Native.socket(pointer), "r+")
|
118
119
|
|
@@ -130,11 +131,9 @@ module DB
|
|
130
131
|
|
131
132
|
Native.finish(pointer)
|
132
133
|
|
133
|
-
raise "connect: #{error_message}"
|
134
|
+
raise Error, "Could not connect: #{error_message}"
|
134
135
|
end
|
135
136
|
|
136
|
-
Native.set_nonblocking(pointer, 1)
|
137
|
-
|
138
137
|
return self.new(pointer, io, types)
|
139
138
|
end
|
140
139
|
|
@@ -43,7 +43,9 @@ module DB
|
|
43
43
|
attach_function :field_count, :PQnfields, [:pointer], :int
|
44
44
|
attach_function :field_name, :PQfname, [:pointer, :int], :string
|
45
45
|
attach_function :field_type, :PQftype, [:pointer, :int], :int
|
46
|
+
|
46
47
|
attach_function :get_value, :PQgetvalue, [:pointer, :int, :int], :string
|
48
|
+
attach_function :get_is_null, :PQgetisnull, [:pointer, :int, :int], :int
|
47
49
|
|
48
50
|
attach_function :clear, :PQclear, [:pointer], :void
|
49
51
|
|
@@ -109,7 +111,9 @@ module DB
|
|
109
111
|
|
110
112
|
protected
|
111
113
|
def get_value(row, field)
|
112
|
-
Native.
|
114
|
+
if Native.get_is_null(self, row, field) == 0
|
115
|
+
Native.get_value(self, row, field)
|
116
|
+
end
|
113
117
|
end
|
114
118
|
|
115
119
|
def get_row(row)
|
data/lib/db/postgres/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: db-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
146
|
+
rubygems_version: 3.1.2
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Ruby FFI bindings for libpq C interface.
|