Module: GhostAdapter

Defined in:
lib/ghost_adapter.rb,
lib/ghost_adapter/config.rb,
lib/ghost_adapter/command.rb,
lib/ghost_adapter/railtie.rb,
lib/ghost_adapter/version.rb,
lib/ghost_adapter/migrator.rb,
lib/ghost_adapter/env_parser.rb,
lib/ghost_adapter/version_checker.rb,
lib/generators/ghost_adapter/install_generator.rb

Defined Under Namespace

Modules: Generators, Internal Classes: Command, Config, EnvParser, IncompatibleVersion, MigrationError, Migrator, Railtie, VersionChecker

Constant Summary collapse

CONFIG_KEYS =
i[aliyun_rds
allow_master_master
allow_nullable_unique_key
allow_on_master
allow_zero_in_date
approve_renamed_columns
assume_master_host
assume_rbr
attempt_instant_ddl
azure
binlogsyncer_max_reconnect_attempts
check_flag
chunk_size
concurrent_rowcount
conf
critical_load
critical_load_hibernate_seconds
critical_load_interval_millis
cut_over
cut_over_exponential_backoff
cut_over_lock_timeout_seconds
database
debug
default_retries
discard_foreign_keys
dml_batch_size
exact_rowcount
exponential_backoff_max_interval
force_named_cut_over
force_named_panic
force_table_names
gcp
heartbeat_interval_millis
hooks_hint
hooks_hint_owner
hooks_hint_token
hooks_path
host
ignore_http_errors
initially_drop_ghost_table
initially_drop_old_table
initially_drop_socket_file
master_password
master_user
max_lag_millis
max_load
migrate_on_replica
mysql_timeout
nice_ratio
ok_to_drop_table
panic_flag_file
password
port
postpone_cut_over_flag_file
quiet
replica_server_id
serve_socket_file
serve_tcp_port
skip_foreign_key_checks
skip_renamed_columns
skip_strict_mode
ssl
ssl_allow_insecure
ssl_ca
ssl_cert
ssl_key
stack
switch_to_rbr
test_on_replica
test_on_replica_skip_replica_stop
throttle_additional_flag_file
throttle_control_replicas
throttle_flag_file
throttle_http
throttle_http_interval_millis
throttle_http_timeout_millis
throttle_query
timestamp_old_table
tungsten
user
verbose].freeze
VERSION =
'0.7.0'.freeze

Class Method Summary collapse

Class Method Details

.clear_configObject



27
28
29
# File 'lib/ghost_adapter.rb', line 27

def self.clear_config
  @@config = GhostAdapter::Config.new # rubocop:disable Style/ClassVars
end

.configObject



11
12
13
# File 'lib/ghost_adapter.rb', line 11

def self.config
  @@config ||= GhostAdapter::Config.new # rubocop:disable Style/ClassVars
end

.setup(options = {}) {|@@config| ... } ⇒ Object

Yields:



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ghost_adapter.rb', line 15

def self.setup(options = {})
  new_config = GhostAdapter::Config.new(options)

  if defined? @@config
    @@config.merge!(new_config)
  else
    @@config = new_config # rubocop:disable Style/ClassVars
  end

  yield @@config if block_given?
end