module Sequel::DataObjects::MySQL::DatabaseMethods

Database instance methods for MySQL databases accessed via DataObjects.

Private Instance Methods

database_name() click to toggle source

The database name for the given database. Need to parse it out of the connection string, since the DataObjects does no parsing on the given connection string by default.

# File lib/sequel/adapters/do/mysql.rb, line 27
def database_name
  (m = /\/(.*)/.match(URI.parse(uri).path)) && m[1]
end
schema_column_type(db_type) click to toggle source

Recognize the tinyint(1) column as boolean.

# File lib/sequel/adapters/do/mysql.rb, line 32
def schema_column_type(db_type)
  db_type =~ /\Atinyint\(1\)/ ? :boolean : super
end
setup_connection(conn) click to toggle source

Apply the connectiong setting SQLs for every new connection.

Calls superclass method
# File lib/sequel/adapters/do/mysql.rb, line 37
def setup_connection(conn)
  mysql_connection_setting_sqls.each{|sql| log_connection_yield(sql, conn){conn.create_command(sql).execute_non_query}}
  super
end