Class: Lotus::Model::Adapters::Sql::Consoles::Mysql

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/model/adapters/sql/consoles/mysql.rb

Overview

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Mysql

Returns a new instance of Mysql.

Since:

  • 0.1.0



8
9
10
# File 'lib/lotus/model/adapters/sql/consoles/mysql.rb', line 8

def initialize(uri)
  @uri = uri
end

Instance Method Details

#connection_stringObject

Since:

  • 0.1.0



12
13
14
15
16
17
18
19
20
# File 'lib/lotus/model/adapters/sql/consoles/mysql.rb', line 12

def connection_string
  str = 'mysql'
  str << host
  str << database
  str << port if port
  str << username if username
  str << password if password
  str
end