sequel-activerecord_connection 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/sequel/extensions/activerecord_connection/mysql2.rb +16 -11
- data/lib/sequel/extensions/activerecord_connection/postgres.rb +4 -4
- data/lib/sequel/extensions/activerecord_connection/sqlite.rb +9 -1
- data/sequel-activerecord_connection.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bb2b81760b45990a9bea2801f8a243cfc180853ad450d652cf888cd45844033
|
4
|
+
data.tar.gz: 73ae4c6341a3c694423b4e20da86f01cce3324d37a9a29143eb2f2e420d45288
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e27142472fabc36703d3cca6828e005858d60088a88bbb8f78c58dba5f6e9a2b2ae349ff6d39451558d7dd3e4e32e92d49818af88af9bb6bc18a522c283bc38
|
7
|
+
data.tar.gz: 6dff47d6fe0adf995dc3738e932bda92b15279b56bdf22750e6c42058031ca2b2f152e26cd80b2a09e3be460a1be8695a3645df8a2bcd4a87430ebfc3243fa98
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
## 1.2.
|
1
|
+
## 1.2.2 (2021-01-11)
|
2
|
+
|
3
|
+
* Ensure Active Record queries inside a Sequel transaction are typemapped correctly in postgres adapter (@janko)
|
4
|
+
|
5
|
+
* Fix executing Active Record queries inside a Sequel transaction not working in mysql2 adapter (@janko)
|
6
|
+
|
7
|
+
## 1.2.1 (2021-01-10)
|
2
8
|
|
3
9
|
* Fix original mysql2 query options not being restored after nested `DB#synchronize` calls, e.g. when using Sequel transactions (@janko)
|
4
10
|
|
@@ -5,21 +5,26 @@ 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
|
-
|
12
8
|
# required for prepared statements
|
13
|
-
conn.instance_variable_set(:@sequel_default_query_options, conn.query_options.dup)
|
14
9
|
Utils.add_prepared_statements_cache(conn)
|
15
10
|
|
16
|
-
conn
|
11
|
+
yield conn
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def _execute(conn, sql, opts)
|
18
|
+
if conn.instance_variable_defined?(:@sequel_default_query_options)
|
19
|
+
return super
|
20
|
+
end
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
conn.instance_variable_set(:@sequel_default_query_options, conn.query_options.dup)
|
23
|
+
conn.query_options.merge!(as: :hash, symbolize_keys: true, cache_rows: false)
|
24
|
+
begin
|
25
|
+
super
|
26
|
+
ensure
|
27
|
+
conn.query_options.replace(conn.remove_instance_variable(:@sequel_default_query_options))
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
@@ -10,9 +10,7 @@ module Sequel
|
|
10
10
|
|
11
11
|
Utils.add_prepared_statements_cache(conn)
|
12
12
|
|
13
|
-
|
14
|
-
yield conn
|
15
|
-
end
|
13
|
+
yield conn
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
@@ -84,7 +82,9 @@ module Sequel
|
|
84
82
|
# Return the PG::Result containing the query results.
|
85
83
|
def execute_query(sql, args)
|
86
84
|
@db.log_connection_yield(sql, self, args) do
|
87
|
-
|
85
|
+
Utils.set_value(self, :type_map_for_results, PG::TypeMapAllStrings.new) do
|
86
|
+
args ? async_exec_params(sql, args) : async_exec(sql)
|
87
|
+
end
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -15,8 +15,16 @@ module Sequel
|
|
15
15
|
|
16
16
|
Utils.add_prepared_statements_cache(conn)
|
17
17
|
|
18
|
+
yield conn
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def _execute(type, sql, opts, &block)
|
25
|
+
synchronize(opts[:server]) do |conn|
|
18
26
|
Utils.set_value(conn, :results_as_hash, nil) do
|
19
|
-
|
27
|
+
super
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|