Module Sequel::MySQL::MysqlMysql2::DatabaseMethods
In: lib/sequel/adapters/utils/mysql_mysql2.rb

Methods

Constants

MYSQL_DATABASE_DISCONNECT_ERRORS = /\A#{Regexp.union(disconnect_errors)}/o   Error messages for mysql and mysql2 that indicate the current connection should be disconnected

Public Instance methods

Support stored procedures on MySQL

[Source]

    # File lib/sequel/adapters/utils/mysql_mysql2.rb, line 24
24:         def call_sproc(name, opts=OPTS, &block)
25:           args = opts[:args] || [] 
26:           execute("CALL #{name}#{args.empty? ? '()' : literal(args)}", opts.merge(:sproc=>false), &block)
27:         end

Executes the given SQL using an available connection, yielding the connection if the block is given.

[Source]

    # File lib/sequel/adapters/utils/mysql_mysql2.rb, line 31
31:         def execute(sql, opts=OPTS, &block)
32:           if opts[:sproc]
33:             call_sproc(sql, opts, &block)
34:           elsif sql.is_a?(Symbol)
35:             execute_prepared_statement(sql, opts, &block)
36:           else
37:             synchronize(opts[:server]){|conn| _execute(conn, sql, opts, &block)}
38:           end
39:         end

[Validate]