fibered_mysql2 0.1.5 → 0.2.0.jeb.1

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: 12737e2836857c7444a5de1f3add445a20d66d010e94ab249bb44b5da64836fa
4
- data.tar.gz: b5cdeef7a0ca7b28831db24860bac71a0102d1cc0f54a0d5f60547198df5c4e4
3
+ metadata.gz: f5a0be4a68409bcf17463e91e3da6de8b018a431f1c71b41c84d67e84d55cc0e
4
+ data.tar.gz: 6516de3e5623c12a0261032da60ce0051a99452a989cc5830ce71e3d6621c42c
5
5
  SHA512:
6
- metadata.gz: 44d9d175284c4d15c51f9abe2b3e5058e7e5259e188d52cbf75dfb9d73c2c59ad164f7ae6b4c2911d31863a11b4c963babd63b5709d922a0ce6554f12a27942b
7
- data.tar.gz: 6697e8ba2ca37124f4a51fc2e591205dc5ff7b0ff88eda62d021ac83f7723558b3abb60a99ac17e044b95eb62d2846ea63929a5be4de956b0ed8a70722fdef78
6
+ metadata.gz: 6e8cf5e983a443d230960f3f5b34c067e988ac164a17ac2dd9937b578e0db023e0642c759e011abf49b92297f84658d1c77ff1f59a7b5060e42b54c9dfa3b45f
7
+ data.tar.gz: b3aff276ae0357bfe88b99c7d67f0fb244ef1cc3682fb799ecbeab2a7430a39f8ae51c7a4a3ea9f0d252a71cc04eaab8e5617ee3cc2e2e294a3c896b496ff4af
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.2.0] - Unreleased
8
+ ### Added
9
+ - Added support for Rails 6+ by adding knowledge of lazy transactions to the adapter.
10
+
7
11
  ## [0.1.5] - 2022-03-25
8
12
  ### Changed
9
13
  - Upgraded Bundler to 2.2.29 and Ruby to 2.7.5. Removed support for Rails 4.
@@ -37,6 +41,7 @@ threaded, not fibered.
37
41
  - Added TravisCI unit test pipeline.
38
42
  - Added coverage reports via Coveralls.
39
43
 
44
+ [0.2.0]: https://github.com/Invoca/fibered_mysql2/compare/v0.1.5..v0.2.0
40
45
  [0.1.5]: https://github.com/Invoca/fibered_mysql2/compare/v0.1.4..v0.1.5
41
46
  [0.1.4]: https://github.com/Invoca/fibered_mysql2/compare/v0.1.3..v0.1.4
42
47
  [0.1.3]: https://github.com/Invoca/fibered_mysql2/compare/v0.1.2..v0.1.3
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
 
8
8
  gem 'appraisal'
9
9
  gem 'coveralls', require: false
10
- gem 'mysql2', '~> 0.4.5'
10
+ gem 'mysql2', '~> 0.5'
11
11
  gem 'nokogiri', '< 1.13'
12
12
  gem 'pry', '~> 0.13'
13
13
  gem 'pry-byebug', '~> 3.9'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fibered_mysql2 (0.1.5)
4
+ fibered_mysql2 (0.2.0.jeb.1)
5
5
  em-synchrony (~> 1.0)
6
6
  rails (>= 5.2, < 7)
7
7
 
@@ -103,7 +103,7 @@ GEM
103
103
  mini_mime (1.0.2)
104
104
  mini_portile2 (2.6.1)
105
105
  minitest (5.14.3)
106
- mysql2 (0.4.10)
106
+ mysql2 (0.5.3)
107
107
  nio4r (2.5.4)
108
108
  nokogiri (1.12.5)
109
109
  mini_portile2 (~> 2.6.1)
@@ -191,7 +191,7 @@ DEPENDENCIES
191
191
  appraisal
192
192
  coveralls
193
193
  fibered_mysql2!
194
- mysql2 (~> 0.4.5)
194
+ mysql2 (~> 0.5)
195
195
  nokogiri (< 1.13)
196
196
  pry (~> 0.13)
197
197
  pry-byebug (~> 3.9)
@@ -3,13 +3,13 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "bundler", "~> 2.2"
7
6
  gem "coveralls", require: false
8
- gem "mysql2", "~> 0.4.5"
7
+ gem "mysql2", "~> 0.5"
8
+ gem "nokogiri", "< 1.13"
9
9
  gem "pry", "~> 0.13"
10
10
  gem "pry-byebug", "~> 3.9"
11
11
  gem "rails", "~> 5.2"
12
- gem "rake", "~> 10.0"
12
+ gem "rake", "~> 13.0"
13
13
  gem "rspec", "~> 3.0"
14
14
 
15
15
  gemspec path: "../"
@@ -3,13 +3,13 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "bundler", "~> 2.2"
7
6
  gem "coveralls", require: false
8
- gem "mysql2", "~> 0.4.5"
7
+ gem "mysql2", "~> 0.5"
8
+ gem "nokogiri", "< 1.13"
9
9
  gem "pry", "~> 0.13"
10
10
  gem "pry-byebug", "~> 3.9"
11
11
  gem "rails", "~> 6.0.0"
12
- gem "rake", "~> 10.0"
12
+ gem "rake", "~> 13.0"
13
13
  gem "rspec", "~> 3.0"
14
14
 
15
15
  gemspec path: "../"
@@ -47,6 +47,44 @@ module EM::Synchrony
47
47
  transaction
48
48
  end
49
49
  end
50
+
51
+ def materialize_transactions
52
+ return if @materializing_transactions
53
+ return unless @has_unmaterialized_transactions
54
+
55
+ @connection.lock.synchronize do
56
+ begin
57
+ @materializing_transactions = true
58
+ _current_stack.each { |t| t.materialize! unless t.materialized? }
59
+ ensure
60
+ @materializing_transactions = false
61
+ end
62
+ @has_unmaterialized_transactions = false
63
+ end
64
+ end
65
+
66
+ def commit_transaction
67
+ @connection.lock.synchronize do
68
+ transaction = _current_stack.last
69
+
70
+ begin
71
+ transaction.before_commit_records
72
+ ensure
73
+ _current_stack.pop
74
+ end
75
+
76
+ transaction.commit
77
+ transaction.commit_records
78
+ end
79
+ end
80
+
81
+ def rollback_transaction(transaction = nil)
82
+ @connection.lock.synchronize do
83
+ transaction ||= @_current_stack.pop
84
+ transaction.rollback
85
+ transaction.rollback_records
86
+ end
87
+ end
50
88
  end
51
89
  end
52
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FiberedMysql2
4
- VERSION = "0.1.5"
4
+ VERSION = "0.2.0.jeb.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fibered_mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0.jeb.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-synchrony
@@ -89,9 +89,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ">="
92
+ - - ">"
93
93
  - !ruby/object:Gem::Version
94
- version: '0'
94
+ version: 1.3.1
95
95
  requirements: []
96
96
  rubygems_version: 3.1.6
97
97
  signing_key: