module Sequel::Dataset::StoredProcedureMethods

Public Instance Methods

call(*args, &block) click to toggle source

Call the stored procedure with the given args

# File lib/sequel/adapters/utils/stored_procedures.rb, line 14
def call(*args, &block)
  clone(:sproc_args=>args).run(&block)
end
inspect() click to toggle source

Programmer friendly string showing this is a stored procedure, showing the name of the procedure.

# File lib/sequel/adapters/utils/stored_procedures.rb, line 20
def inspect
  "<#{self.class.name}/StoredProcedure name=#{@sproc_name}>"
end
run(&block) click to toggle source

Run the stored procedure with the current args on the database

# File lib/sequel/adapters/utils/stored_procedures.rb, line 25
def run(&block)
  case @opts[:sproc_type]
  when :select, :all
    all(&block)
  when :first
    first
  when :insert
    insert
  when :update
    update
  when :delete
    delete
  end
end
sproc_name() click to toggle source

The name of the stored procedure to call

# File lib/sequel/adapters/utils/stored_procedures.rb, line 9
def sproc_name
  @opts[:sproc_name]
end