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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8aed2634af7f5f9be7ea31ff6a9b0757eadead1df98b48326e02716453b1a2ff
4
- data.tar.gz: a6187a116e1f4e3151d39d834c9b00f665594fd94e80182eccbceb23fbce73e5
3
+ metadata.gz: c85acb2e98683cf55a34048f3b4b20ee78b210741f22dcb634bd5c4a2fe53395
4
+ data.tar.gz: 2c9c6bef23d6a18d6e878b8bf0cd5f85ec94c4fe013238ca95fa1a95f9af8ada
5
5
  SHA512:
6
- metadata.gz: 04fd5c71657bb4702af5d73efb7ae55c0f3e0e59b625d4331c0c202766faca9f2f3effcfc56bbb26e5aafc9cace30b719c2db7232413d600a3970b39d46393da
7
- data.tar.gz: a3dff976f877302d6f0ffa8bfee195eb509c36c18ec3e8c4c81c07ec6bc57b0434d9fd9b63528b39da43ade976c61b47888d3a3451df9c1eedf24f8561e35aa0
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 i
233
- fmod = @result.fmod i
234
- types[fname] = @connection.get_type_map.fetch(ftype, fmod) do |oid, mod|
235
- warn "unknown OID: #{fname}(#{oid}) (#{sql})"
236
- if ::ActiveRecord::VERSION::MAJOR <= 4
237
- ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Identity.new
238
- else
239
- ::ActiveRecord::Type::Value.new
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostgresqlCursor
4
- VERSION = "0.6.6"
4
+ VERSION = "0.6.8"
5
5
  end
@@ -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
- # Remove this for jruby which should use 'activerecord-jdbcpostgresql-adapter'
31
- # spec.add_dependency 'pg'
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 'activerecord', '~> 5.2.0'
5
- #gem 'activerecord', '~> 3.2.0'
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
- # For testing against Edge Rails
11
- #gem 'activerecord', github: 'rails/rails', branch: 'master'
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.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: 2022-10-31 00:00:00.000000000 Z
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: 3.1.0
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: 3.1.0
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: irb
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: minitest
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: pg
56
+ name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="