Sha256: 26f8747400ee45841ae81c9afd843e5382fee5925734e03394783d3ee46c74ad
Contents?: true
Size: 916 Bytes
Versions: 16
Compression:
Stored size: 916 Bytes
Contents
module Brillo module Dumper class MysqlDumper include Helpers::ExecHelper include Logger attr_reader :config def initialize(config) @config = config end def dump db = config.db execute!( "mysqldump", host_arg, "-u #{db[:username]}", password_arg, "--no-data", "--single-transaction", # InnoDB only. Prevent MySQL locking the whole database during dump. "#{db[:database]}", "> #{config.dump_path}" ) end private def password_arg if password = config.db[:password].presence "--password=#{password}" else "" end end def host_arg if (host = config.db[:host].presence) && host != 'localhost' "-h #{host}" else "" end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems