module Sequel::Dataset::StoredProcedureMethods

  1. lib/sequel/adapters/utils/stored_procedures.rb

Methods

Public Instance

  1. call
  2. inspect
  3. run
  4. sproc_name

Public Instance methods

call(*args, &block)

Call the stored procedure with the given args

[show source]
   # File lib/sequel/adapters/utils/stored_procedures.rb
12 def call(*args, &block)
13   clone(:sproc_args=>args).run(&block)
14 end
inspect()

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

[show source]
   # File lib/sequel/adapters/utils/stored_procedures.rb
18 def inspect
19   "<#{self.class.name}/StoredProcedure name=#{@sproc_name}>"
20 end
run(&block)

Run the stored procedure with the current args on the database

[show source]
   # 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()

The name of the stored procedure to call

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