Sha256: 163d7fdcb750a37390d8424b2dad8223a48cb67075bbe2bef8211681242238c0

Contents?: true

Size: 686 Bytes

Versions: 6

Compression:

Stored size: 686 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

6 entries across 6 versions & 1 rubygems

Version Path
departure-4.0.1 lib/departure/dsn.rb
departure-4.0.0 lib/departure/dsn.rb
departure-2.0.1 lib/departure/dsn.rb
departure-3.0.1 lib/departure/dsn.rb
departure-3.0.0 lib/departure/dsn.rb
departure-2.0.0 lib/departure/dsn.rb