| Module | Sequel::MySQL::MysqlMysql2::DatabaseMethods |
| In: |
lib/sequel/adapters/utils/mysql_mysql2.rb
|
| MYSQL_DATABASE_DISCONNECT_ERRORS | = | /\A#{Regexp.union(disconnect_errors)}/ | Error messages for mysql and mysql2 that indicate the current connection should be disconnected |
Executes the given SQL using an available connection, yielding the connection if the block is given.
# File lib/sequel/adapters/utils/mysql_mysql2.rb, line 33
33: def execute(sql, opts=OPTS, &block)
34: if opts[:sproc]
35: call_sproc(sql, opts, &block)
36: elsif sql.is_a?(Symbol)
37: execute_prepared_statement(sql, opts, &block)
38: else
39: synchronize(opts[:server]){|conn| _execute(conn, sql, opts, &block)}
40: end
41: end