activerecord-cockroachdb-adapter 6.0.0 → 6.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d570f0cc045c61b9fb3fd82bfa64462f34aa086295dff104b559f52e4b6b5ef
4
- data.tar.gz: 9995b9883f98e7eba7f429f977eadc8001d3d4e91aa6b7e3eb4d8976f9e78ff1
3
+ metadata.gz: a5cdb80a2174df8da1c60cd3b1bc52e70840e229d0cd87bb2e426921ba67f399
4
+ data.tar.gz: e9211907e6648c24ab5e15ae1b5213ec223560b9d0134be3a14db4770b6dae62
5
5
  SHA512:
6
- metadata.gz: 6c2ec381be5f87497c1dd10521956475ebe8ed57b013e89296d29afc1b30764ef18952cafa7127b02df0dba6c8eb97315819e42d658235f41bccf5c86fd2b46c
7
- data.tar.gz: 675854788950b2182be1e44864f2a2b03ef768ace4346660f2075437de4ee90dc28717e48d7346d23cece34b9aabb8c493cfa6d93fce494c02b396ad19f3a002
6
+ metadata.gz: 2eaf028eb110e51d2e59521cc788115f34049fb3bba04077481082cb1040e072a0825bb6dead5f39428845a828f1363a0180808dc4bdcdf7b11c2b11ff91f7ae
7
+ data.tar.gz: dd9597f2f0f9578372d56a638eecabcd2d6f82e599e89e0ae88a408349c02b7961df5b3ed78fb8dcf3181835bb3442df2b03e67703efdc13c165e5502f97b2bb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.1 - 2021-05-14
4
+
5
+ - Fix a bug where starting the driver can result in a NoDatabaseError.
6
+
3
7
  ## 6.0.0 - 2021-04-26
4
8
 
5
9
  - Add a telemetry query on start-up. This helps the Cockroach Labs team
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "activerecord-cockroachdb-adapter"
7
- spec.version = "6.0.0"
7
+ spec.version = "6.0.1"
8
8
  spec.licenses = ["Apache-2.0"]
9
9
  spec.authors = ["Cockroach Labs"]
10
10
  spec.email = ["cockroach-db@googlegroups.com"]
@@ -58,18 +58,23 @@ module ActiveRecord
58
58
  adapter = spec.config[:adapter]
59
59
  return if disable_telemetry || adapter != "cockroachdb"
60
60
 
61
- with_connection do |conn|
62
- if conn.active?
63
- begin
64
- query = "SELECT crdb_internal.increment_feature_counter('ActiveRecord %d.%d')"
65
- conn.execute(query % [ActiveRecord::VERSION::MAJOR, ActiveRecord::VERSION::MINOR])
66
- rescue ActiveRecord::StatementInvalid
67
- # The increment_feature_counter built-in is not supported on this
68
- # CockroachDB version. Ignore.
69
- rescue StandardError => e
70
- conn.logger.warn "Unexpected error when incrementing feature counter: #{e}"
61
+
62
+ begin
63
+ with_connection do |conn|
64
+ if conn.active?
65
+ begin
66
+ query = "SELECT crdb_internal.increment_feature_counter('ActiveRecord %d.%d')"
67
+ conn.execute(query % [ActiveRecord::VERSION::MAJOR, ActiveRecord::VERSION::MINOR])
68
+ rescue ActiveRecord::StatementInvalid
69
+ # The increment_feature_counter built-in is not supported on this
70
+ # CockroachDB version. Ignore.
71
+ rescue StandardError => e
72
+ conn.logger.warn "Unexpected error when incrementing feature counter: #{e}"
73
+ end
71
74
  end
72
75
  end
76
+ rescue ActiveRecord::NoDatabaseError
77
+ # Prevent failures on db creation and parallel testing.
73
78
  end
74
79
  end
75
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-cockroachdb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cockroach Labs
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-28 00:00:00.000000000 Z
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -99,7 +99,7 @@ licenses:
99
99
  - Apache-2.0
100
100
  metadata:
101
101
  allowed_push_host: https://rubygems.org
102
- post_install_message:
102
+ post_install_message:
103
103
  rdoc_options: []
104
104
  require_paths:
105
105
  - lib
@@ -114,8 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.1.4
118
- signing_key:
117
+ rubygems_version: 3.0.3
118
+ signing_key:
119
119
  specification_version: 4
120
120
  summary: CockroachDB adapter for ActiveRecord.
121
121
  test_files: []