Sha256: 798de93ee1973504b688f86cee47c50a030223155dc5e85cbafa972b58c6da69

Contents?: true

Size: 684 Bytes

Versions: 7

Compression:

Stored size: 684 Bytes

Contents

module Departure
  # Represents the 'DSN' argument of Percona's pt-online-schema-change
  # See https://www.percona.com/doc/percona-toolkit/2.0/pt-online-schema-change.html#dsn-options
  class DSN
    # Constructor
    #
    # @param database [String, Symbol]
    # @param table_name [String, Symbol]
    def initialize(database, table_name)
      @database = database
      @table_name = table_name
    end

    # Returns the pt-online-schema-change DSN string. See
    # https://www.percona.com/doc/percona-toolkit/2.0/pt-online-schema-change.html#dsn-options
    def to_s
      "D=#{database},t=#{table_name}"
    end

    private

    attr_reader :table_name, :database
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
departure-6.4.0 lib/departure/dsn.rb
departure-6.3.0 lib/departure/dsn.rb
departure-76c9880-6.2.0 lib/departure/dsn.rb
departure-6.2.0 lib/departure/dsn.rb
departure-6.1.0 lib/departure/dsn.rb
departure-6.0.0 lib/departure/dsn.rb
departure-5.0.0 lib/departure/dsn.rb