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
12 def call(*args, &block)
13   clone(:sproc_args=>args).run(&block)
14 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
18 def inspect
19   "<#{self.class.name}/StoredProcedure name=#{@sproc_name}>"
20 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
23 def run(&block)
24   case @opts[:sproc_type]
25   when :select, :all
26     all(&block)
27   when :first
28     first
29   when :insert
30     insert
31   when :update
32     update
33   when :delete
34     delete
35   end
36 end
sproc_name() click to toggle source

The name of the stored procedure to call

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