sequel-activerecord_connection 1.3.0 → 1.4.0

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: 57e9f74b5adc96221191cb92f1be8b2e2614d2fce446bb43d50fc603e755c3d7
4
- data.tar.gz: efdb083362ed82dec77628b75161aa913e2ef805a8b3d8bec621aaa2e1a693f7
3
+ metadata.gz: 94acb3799fdbf874ddad7c419bba8e39c75e09a4e59c724e28a69249fe434e35
4
+ data.tar.gz: 1ad5e5b556427804e682dc6948626c557a89e62030ad8b9ee2827905dea245fe
5
5
  SHA512:
6
- metadata.gz: 0bf43086bf259333fb61dde411660ea2ba65bb03c2d98e123d63283dff257b970426ffb8494d5cc5b1f1d9c4cc73f6c65140c66e7346e8346d82adb7b20598c2
7
- data.tar.gz: 83b368227d5620985878b5bdb1bc6a31ceb6a9b3f2c0b87b206126e5dcdbb05bb8a7e6917457f7bb04b37a22abac3c2ba9b6e8468bb4cf3eb27d4011ab17aa3e
6
+ metadata.gz: 876b0d32959a6263e2e6ac7309bdab3833fd07e0778ec1b5437abd8a61417b32fe7034e8473c916accae59e34f2bb64ce3e875a180d0abadfccc6c5725a98a51
7
+ data.tar.gz: b32f9486f8a3452e5c99fd5aa28dfdb6322a788267dc4307c76a8d2d01b83070de62aed105c91b41d3620a112d36d630dd114e383330bb0701430a167f32d901
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.4.0 (2024-03-19)
2
+
3
+ * Only warn when Sequel extension fails to initialize because there is no database (@janko)
4
+
5
+ * Drop support for Active Record 4.2 (@janko)
6
+
7
+ ## 1.3.1 (2023-04-22)
8
+
9
+ * Fix Active Record's query cache not being cleared in SQLite adapter (@janko)
10
+
1
11
  ## 1.3.0 (2023-04-22)
2
12
 
3
13
  * Clear Active Record query cache after Sequel executes SQL statements (@janko)
data/README.md CHANGED
@@ -8,8 +8,8 @@ This can be useful if you want to use a library that uses Sequel (e.g.
8
8
  or if you just want to use Sequel for more complex queries, and you want to
9
9
  avoid creating new database connections.
10
10
 
11
- It works on ActiveRecord 4.2+ and fully supports PostgresSQL, MySQL and SQLite
12
- adapters, both native and JDBC (JRuby). The [SQL Server] external adapter is
11
+ It works on ActiveRecord 4.2+ and fully supports PostgresSQL, MySQL and SQLite,
12
+ both the native adapters and JDBC (JRuby). The [SQL Server] external adapter is
13
13
  supported as well (`tinytds` in Sequel), and there is attempted support for
14
14
  [Oracle enhanced] (`oracle` and in Sequel). Other adapters might work too, but
15
15
  their integration hasn't been tested.
@@ -32,6 +32,12 @@ module Sequel
32
32
  raise Error, "creating a Sequel connection is not allowed"
33
33
  end
34
34
 
35
+ def extension(*)
36
+ super
37
+ rescue ActiveRecord::NoDatabaseError
38
+ warn "Sequel database extension #{@loaded_extensions.last.inspect} failed to initialize because there is no database."
39
+ end
40
+
35
41
  # Avoid calling Sequel's connection pool, instead use Active Record's.
36
42
  def synchronize(*)
37
43
  activerecord_lock do
@@ -43,6 +49,8 @@ module Sequel
43
49
 
44
50
  yield conn
45
51
  end
52
+ ensure
53
+ clear_activerecord_query_cache
46
54
  end
47
55
 
48
56
  # Log executed queries into Active Record logger as well.
@@ -57,13 +65,6 @@ module Sequel
57
65
  @timezone || activerecord_timezone
58
66
  end
59
67
 
60
- # Clear Active Record's query cache after potential data modifications.
61
- def execute(*)
62
- super
63
- ensure
64
- clear_activerecord_query_cache
65
- end
66
-
67
68
  private
68
69
 
69
70
  # Synchronizes transaction state with ActiveRecord. Sequel uses this
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "sequel-activerecord_connection"
3
- spec.version = "1.3.0"
3
+ spec.version = "1.4.0"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko.marohnic@gmail.com"]
6
6
 
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.required_ruby_version = ">= 2.4"
13
13
 
14
14
  spec.add_dependency "sequel", "~> 5.38"
15
- spec.add_dependency "activerecord", ">= 4.2", "< 8"
15
+ spec.add_dependency "activerecord", ">= 5.0", "< 8"
16
16
  spec.add_dependency "after_commit_everywhere", "~> 1.1"
17
17
 
18
18
  spec.add_development_dependency "sequel_pg" unless RUBY_ENGINE == "jruby"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-activerecord_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-22 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.2'
33
+ version: '5.0'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '8'
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '4.2'
43
+ version: '5.0'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '8'
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.4.12
141
+ rubygems_version: 3.5.3
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Allows Sequel to use ActiveRecord connection for database interaction.