Sha256: 0a43933b273f469dc5a2224ea5cb5c4d3d1321fcd53bdcb063d50270a11d0d2b

Contents?: true

Size: 692 Bytes

Versions: 2

Compression:

Stored size: 692 Bytes

Contents

module PerconaMigrator

  # 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

2 entries across 2 versions & 1 rubygems

Version Path
percona_migrator-3.0.0 lib/percona_migrator/dsn.rb
percona_migrator-1.1.0 lib/percona_migrator/dsn.rb