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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3663201d44383fe14f66bd716f1276cdd7920eb14aeaf588621ed874ab433aa
4
- data.tar.gz: 437a7d18d43c2edc61f4a05759db7fa4fa206292e66d68ed6b917f097d296123
3
+ metadata.gz: d8ce98d7cce6b660795290077c80a235c062a98279e851040c252fd6b9c4123b
4
+ data.tar.gz: 173d4951be58b1d7302e6f90805719cf72f4335971f16217b0a4f91c24c1990a
5
5
  SHA512:
6
- metadata.gz: d7d2d575ad7cf93c0c625728eaaa4fe9a5002148395d772c3d3d89078b837f72ca0b78205fb371164e0da13b9ce2088e218103da337fd0a98900943f456712a1
7
- data.tar.gz: 77c2eb5eebabbd7436c48f9fada27d0d129bd7056779a5121a82f5456eeee65b79e9b4fb879b7a2baa0423559f55efa71c405836814baccca75e742c137881b5
6
+ metadata.gz: c043ec458818b3751db13d6600e546446ca9ca4b77acecb2bdadf62decb6d8b632fe27ae07bf22c68df0645ffc80d5a2605ccdb45294a66ed7eaa9de5e9a901a
7
+ data.tar.gz: f79356676876df5b2a52fb34d408cea11192af27db9a635f8495b2a11bb95d9f05b807567f81e93e8a39739e12109b204ba5f9f316f68788c8616714a7a39398
@@ -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
- @out_client.client.query("SET FOREIGN_KEY_CHECKS = 0")
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
- logger.error("Query execution failed: #{e.message}")
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GammaReplication
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  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
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-02-18 00:00:00.000000000 Z
11
+ date: 2025-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport