pg_conn 0.17.2 → 0.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pg_conn/session_methods.rb +6 -7
- data/lib/pg_conn/version.rb +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: ef63ee68c793ec597f74abe4f85815b489199f5f71db4e92f583e3a7789b58ef
|
4
|
+
data.tar.gz: 073d54f4b5000882ce86b6b09ae92b4fa8d2230015198ad07f54d0b6ed465c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52d717e25fbbe755c2bceaa77c1da02bfbe82dabc30f0ce22673f1791b9fbfe50cc0f6539221c766db526d42f224baeb1da22f29cba861ada5ea8334413b2899
|
7
|
+
data.tar.gz: 54fe0f036e61099b2fd5807da67e1528930ce79386a91f570eb11ba9d6eac5d5c63a89e4c2702b5304a9680cecf904577860ef9fa251a4485d344fea31b61cdd
|
@@ -84,16 +84,16 @@ module PgConn
|
|
84
84
|
|
85
85
|
# Return true if session triggers are enabled. Triggers are enabled by
|
86
86
|
# default by Postgres
|
87
|
-
def triggers?() conn.value "select current_setting('session_replication_role')
|
87
|
+
def triggers?() conn.value "select current_setting('session_replication_role') <> 'replica'" end
|
88
88
|
|
89
89
|
# Enable session triggers
|
90
90
|
def enable_triggers()
|
91
|
-
conn.execute "set session session_replication_role =
|
91
|
+
conn.execute "set session session_replication_role = DEFAULT"
|
92
92
|
end
|
93
93
|
|
94
94
|
# Disable session triggers
|
95
95
|
def disable_triggers()
|
96
|
-
conn.execute "set session session_replication_role =
|
96
|
+
conn.execute "set session session_replication_role = replica"
|
97
97
|
end
|
98
98
|
|
99
99
|
# Execute block with session triggers on or off
|
@@ -107,10 +107,9 @@ module PgConn
|
|
107
107
|
end
|
108
108
|
yield
|
109
109
|
ensure
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
enable_triggers
|
110
|
+
case active
|
111
|
+
when true; enable_triggers if !triggers?
|
112
|
+
when false; disable_triggers if triggers?
|
114
113
|
end
|
115
114
|
end
|
116
115
|
end
|
data/lib/pg_conn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_conn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|