postgresql_cursor 0.6.6 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postgresql_cursor/cursor.rb +8 -10
- data/lib/postgresql_cursor/version.rb +1 -1
- data/postgresql_cursor.gemspec +5 -9
- data/test/test_postgresql_cursor.rb +2 -2
- data/test-app/Gemfile +4 -11
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c85acb2e98683cf55a34048f3b4b20ee78b210741f22dcb634bd5c4a2fe53395
|
4
|
+
data.tar.gz: 2c9c6bef23d6a18d6e878b8bf0cd5f85ec94c4fe013238ca95fa1a95f9af8ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707d3922478b915d36b503a9e3ef4973e2064d7e1b0388b2b31191e91e4bef1e118ac3d08eb8aaeae4a7b94e6c099c522116d7651aa23f0645f16541e8b68793
|
7
|
+
data.tar.gz: 7bda9582106b1d8472a7c09d3ce9db8e66a519f2f22f2903c9e29b5f9814083f81ffa3df3c2aa171b5e2f8445c2bf05f0fac5025176c77ef74ae7c7733c0dec6
|
@@ -229,16 +229,14 @@ module PostgreSQLCursor
|
|
229
229
|
types = {}
|
230
230
|
fields = @result.fields
|
231
231
|
fields.each_with_index do |fname, i|
|
232
|
-
ftype = @result.ftype
|
233
|
-
fmod = @result.fmod
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
end
|
241
|
-
end
|
232
|
+
ftype = @result.ftype(i)
|
233
|
+
fmod = @result.fmod(i)
|
234
|
+
|
235
|
+
# From @netrusov 2023-01-18. This is the same call used in the PostgreSQL Adapter
|
236
|
+
types[fname] = @connection.send(:get_oid_type, ftype, fmod, fname)
|
237
|
+
|
238
|
+
# # From @simi 2023-01-18 (Works as well, used old calling method)
|
239
|
+
# types[fname] = @connection.get_type_map.fetch(ftype)
|
242
240
|
end
|
243
241
|
|
244
242
|
@column_types = types
|
data/postgresql_cursor.gemspec
CHANGED
@@ -27,18 +27,14 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
|
31
|
-
# spec.
|
32
|
-
|
33
|
-
spec.add_dependency "activerecord", ">= 3.1.0"
|
34
|
-
# spec.add_dependency 'activerecord', '~> 3.1.0'
|
35
|
-
# spec.add_dependency 'activerecord', '~> 4.1.0'
|
36
|
-
# spec.add_dependency 'activerecord', '~> 5.0.0'
|
37
|
-
# spec.add_dependency 'activerecord', '~> 6.0.0'
|
30
|
+
spec.add_dependency "activerecord", ">= 6.0"
|
31
|
+
# spec.add_development_dependency "activerecord", "~> 6.1"
|
32
|
+
# spec.add_development_dependency "activerecord", "~> 7.0"
|
38
33
|
|
34
|
+
# PG dependency held back for Jruby. See pg_jruby or jdbc-postgres-adapter gems.
|
35
|
+
spec.add_development_dependency "pg" unless RUBY_PLATFORM == "java"
|
39
36
|
spec.add_development_dependency "irb"
|
40
37
|
spec.add_development_dependency "minitest"
|
41
|
-
spec.add_development_dependency "pg"
|
42
38
|
spec.add_development_dependency "rake"
|
43
39
|
spec.add_development_dependency "appraisal"
|
44
40
|
end
|
@@ -150,7 +150,7 @@ class TestPostgresqlCursor < Minitest::Test
|
|
150
150
|
Product.connection.execute("select kaboom")
|
151
151
|
end
|
152
152
|
rescue => e
|
153
|
-
assert_match(/PG::InFailedSqlTransaction/, e.message)
|
153
|
+
assert_match(/PG::(InFailedSqlTransaction|UndefinedColumn)/, e.message)
|
154
154
|
end
|
155
155
|
|
156
156
|
def test_batch_exception_in_failed_transaction
|
@@ -158,7 +158,7 @@ class TestPostgresqlCursor < Minitest::Test
|
|
158
158
|
Product.connection.execute("select kaboom")
|
159
159
|
end
|
160
160
|
rescue => e
|
161
|
-
assert_match(/PG::InFailedSqlTransaction/, e.message)
|
161
|
+
assert_match(/PG::(InFailedSqlTransaction|UndefinedColumn)/, e.message)
|
162
162
|
end
|
163
163
|
|
164
164
|
def test_cursor
|
data/test-app/Gemfile
CHANGED
@@ -1,15 +1,8 @@
|
|
1
1
|
# A sample Gemfile
|
2
2
|
source "https://rubygems.org"
|
3
3
|
|
4
|
-
gem
|
5
|
-
#gem 'activerecord', '~>
|
6
|
-
#gem 'activerecord', '~> 4.0.0'
|
7
|
-
#gem 'activerecord', '~> 4.1.0'
|
8
|
-
#gem 'activerecord', '4.1.2.rc1'
|
4
|
+
gem "activerecord", "~> 7.0.4.1"
|
5
|
+
# gem 'activerecord', '~> 6.1.7.1'
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
#gem 'arel', github: 'rails/arel', branch: 'master'
|
13
|
-
|
14
|
-
gem 'pg'
|
15
|
-
gem 'postgresql_cursor', path:"../"
|
7
|
+
gem "pg"
|
8
|
+
gem "postgresql_cursor", path: "../"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postgresql_cursor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Fair
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,16 +16,16 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: pg
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: irb
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|