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 26
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 31
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 36
def setup_connection(conn)
  mysql_connection_setting_sqls.each{|sql| log_yield(sql){conn.create_command(sql).execute_non_query}}
  super
end