Constants
| MYSQL_DATABASE_DISCONNECT_ERRORS | = | /\A#{Regexp.union(disconnect_errors)}/ |
Public Instance methods
call_sproc(name, opts=OPTS, &block)
Support stored procedures on MySQL
[show source]
# File lib/sequel/adapters/utils/mysql_mysql2.rb 37 def call_sproc(name, opts=OPTS, &block) 38 args = opts[:args] || [] 39 execute("CALL #{name}#{args.empty? ? '()' : literal(args)}", opts.merge(:sproc=>false), &block) 40 end
execute(sql, opts=OPTS, &block)
Executes the given SQL using an available connection, yielding the connection if the block is given.
[show source]
# File lib/sequel/adapters/utils/mysql_mysql2.rb 44 def execute(sql, opts=OPTS, &block) 45 if opts[:sproc] 46 call_sproc(sql, opts, &block) 47 elsif sql.is_a?(Symbol) || sql.is_a?(Sequel::Dataset::ArgumentMapper) 48 execute_prepared_statement(sql, opts, &block) 49 else 50 synchronize(opts[:server]){|conn| _execute(conn, sql, opts, &block)} 51 end 52 end