Class: DataDuck::MysqlSource

Inherits:
SqlDbSource show all
Defined in:
lib/dataduck/mysql_source.rb

Instance Attribute Summary

Attributes inherited from SqlDbSource

#database, #host, #password, #port, #username

Attributes inherited from Database

#name

Instance Method Summary collapse

Methods inherited from SqlDbSource

#connection, #initialize, #query, #table_names

Methods inherited from Source

load_config!, only_source, #schema, skip_these_table_names, source, source_config

Methods inherited from Database

#connection, #initialize, #query, #table_names

Constructor Details

This class inherits a constructor from DataDuck::SqlDbSource

Instance Method Details

#db_typeObject



7
8
9
# File 'lib/dataduck/mysql_source.rb', line 7

def db_type
  'mysql'
end

#dbconsole(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/dataduck/mysql_source.rb', line 11

def dbconsole(options = {})
  args = []
  args << "--host=#{ self.host }"
  args << "--user=#{ self.username }"
  args << "--database=#{ self.database }"
  args << "--port=#{ self.port }"
  args << "--password=#{ self.password }"

  self.find_command_and_execute("mysql", *args)
end

#escape_charObject



22
23
24
# File 'lib/dataduck/mysql_source.rb', line 22

def escape_char
  '`'
end