Module Sequel::MySQL::PreparedStatements::DatabaseMethods
In: lib/sequel/adapters/shared/mysql_prepared_statements.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/shared/mysql_prepared_statements.rb, line 22
22:         def call_sproc(name, opts=OPTS, &block)
23:           args = opts[:args] || [] 
24:           execute("CALL #{name}#{args.empty? ? '()' : literal(args)}", opts.merge(:sproc=>false), &block)
25:         end

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

[Source]

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

[Validate]