Class: PerconaMigrator::DSN

Inherits:
Object
  • Object
show all
Defined in:
lib/percona_migrator/dsn.rb

Overview

Represents the ‘DSN’ argument of Percona’s pt-online-schema-change See www.percona.com/doc/percona-toolkit/2.0/pt-online-schema-change.html#dsn-options

Instance Method Summary collapse

Constructor Details

#initialize(database, table_name) ⇒ DSN

Constructor

Parameters:

  • database (String, Symbol)
  • table_name (String, Symbol)


11
12
13
14
# File 'lib/percona_migrator/dsn.rb', line 11

def initialize(database, table_name)
  @database = database
  @table_name = table_name
end

Instance Method Details

#to_sObject

Returns the pt-online-schema-change DSN string. See www.percona.com/doc/percona-toolkit/2.0/pt-online-schema-change.html#dsn-options



18
19
20
# File 'lib/percona_migrator/dsn.rb', line 18

def to_s
  "D=#{database},t=#{table_name}"
end