sequel-activerecord_connection 1.2.0 → 1.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72a4a1bf22a4a83664c7925b1d0b78ee5d20777eb12ffec4df9bd4b0c60a9930
|
4
|
+
data.tar.gz: 58c32e5d224d136cb797453bd8ac70f40d964160c4996377909349c8bb324af5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cc94ff1690360f805eec685404d9017b9df0f327c32110e54694dd1da148f1141990a468b69787896ea5e9a4b13d84c41783d4dcee0fd8b1f020defd9288961
|
7
|
+
data.tar.gz: b67647d492d7d31478ca6db7ba4b107914d8ba692bd41bf4596cab5f06a16ee62b2f19ab199dfce9566234ac876b349c212199a23cbec2c15884108cf1e41f79
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.2.1 (2020-01-10)
|
2
|
+
|
3
|
+
* Fix original mysql2 query options not being restored after nested `DB#synchronize` calls, e.g. when using Sequel transactions (@janko)
|
4
|
+
|
1
5
|
## 1.2.0 (2020-11-15)
|
2
6
|
|
3
7
|
* Attempt support for [activerecord-sqlserver-adapter](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter) (@janko)
|
@@ -5,6 +5,10 @@ module Sequel
|
|
5
5
|
module Mysql2
|
6
6
|
def synchronize(*)
|
7
7
|
super do |conn|
|
8
|
+
if conn.instance_variable_defined?(:@sequel_default_query_options)
|
9
|
+
return yield(conn)
|
10
|
+
end
|
11
|
+
|
8
12
|
# required for prepared statements
|
9
13
|
conn.instance_variable_set(:@sequel_default_query_options, conn.query_options.dup)
|
10
14
|
Utils.add_prepared_statements_cache(conn)
|
@@ -14,7 +18,7 @@ module Sequel
|
|
14
18
|
begin
|
15
19
|
yield conn
|
16
20
|
ensure
|
17
|
-
conn.query_options.replace(conn.
|
21
|
+
conn.query_options.replace(conn.remove_instance_variable(:@sequel_default_query_options))
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
@@ -32,20 +32,12 @@ module Sequel
|
|
32
32
|
module ConnectionMethods
|
33
33
|
# The underlying exception classes to reraise as disconnect errors
|
34
34
|
# instead of regular database errors.
|
35
|
-
DISCONNECT_ERROR_CLASSES =
|
35
|
+
DISCONNECT_ERROR_CLASSES = Sequel::Postgres::Adapter::DISCONNECT_ERROR_CLASSES
|
36
36
|
|
37
37
|
# Since exception class based disconnect checking may not work,
|
38
38
|
# also trying parsing the exception message to look for disconnect
|
39
39
|
# errors.
|
40
|
-
DISCONNECT_ERROR_REGEX =
|
41
|
-
"ERROR: cached plan must not change result type",
|
42
|
-
"could not receive data from server",
|
43
|
-
"no connection to the server",
|
44
|
-
"connection not open",
|
45
|
-
"connection is closed",
|
46
|
-
"terminating connection due to administrator command",
|
47
|
-
"PQconsumeInput() "
|
48
|
-
])}/
|
40
|
+
DISCONNECT_ERROR_REGEX = Sequel::Postgres::Adapter::DISCONNECT_ERROR_RE
|
49
41
|
|
50
42
|
def async_exec_params(sql, args)
|
51
43
|
defined?(super) ? super : async_exec(sql, args)
|
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.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|