gamma_replication 0.1.4 → 0.1.5
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 +4 -4
- data/exe/gamma_replication +1 -0
- data/lib/gamma_replication/command/start.rb +6 -4
- data/lib/gamma_replication/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: d8ce98d7cce6b660795290077c80a235c062a98279e851040c252fd6b9c4123b
|
4
|
+
data.tar.gz: 173d4951be58b1d7302e6f90805719cf72f4335971f16217b0a4f91c24c1990a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c043ec458818b3751db13d6600e546446ca9ca4b77acecb2bdadf62decb6d8b632fe27ae07bf22c68df0645ffc80d5a2605ccdb45294a66ed7eaa9de5e9a901a
|
7
|
+
data.tar.gz: f79356676876df5b2a52fb34d408cea11192af27db9a635f8495b2a11bb95d9f05b807567f81e93e8a39739e12109b204ba5f9f316f68788c8616714a7a39398
|
data/exe/gamma_replication
CHANGED
@@ -14,6 +14,7 @@ class GammaReplicationCLI < Thor
|
|
14
14
|
option :maxwell_config, aliases: "-m", desc: "Maxwell configuration file path", required: true
|
15
15
|
option :enable_stats, type: :boolean, desc: "Enable statistics output (default: true)"
|
16
16
|
option :stats_interval, type: :numeric, desc: "Statistics output interval in seconds (default: 10800)"
|
17
|
+
option :force, type: :boolean, desc: "Disable foreign key checks during replication", default: false
|
17
18
|
def start
|
18
19
|
GammaReplication::Command::Start.new(options).execute
|
19
20
|
end
|
@@ -3,9 +3,10 @@
|
|
3
3
|
module GammaReplication
|
4
4
|
module Command
|
5
5
|
class Start < BaseReplication
|
6
|
-
def initialize(
|
6
|
+
def initialize(opts)
|
7
7
|
super
|
8
|
-
@
|
8
|
+
@force_mode = opts[:force]
|
9
|
+
@out_client.client.query("SET FOREIGN_KEY_CHECKS = 0") if @force_mode
|
9
10
|
end
|
10
11
|
|
11
12
|
def apply_mode?
|
@@ -16,11 +17,12 @@ module GammaReplication
|
|
16
17
|
logger.info("Executing: #{query}") if ENV["DEBUG"]
|
17
18
|
@out_client.client.query(query)
|
18
19
|
rescue StandardError => e
|
19
|
-
|
20
|
+
error_message = e.message.to_s.split("\n").first
|
21
|
+
logger.error("Query execution failed: #{error_message.gsub(/\s+/, " ")}")
|
20
22
|
end
|
21
23
|
|
22
24
|
def finalize
|
23
|
-
@out_client.client.query("SET FOREIGN_KEY_CHECKS = 1")
|
25
|
+
@out_client.client.query("SET FOREIGN_KEY_CHECKS = 1") if @force_mode
|
24
26
|
super
|
25
27
|
end
|
26
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gamma_replication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinsuke Nishio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|