Class Index [+]

Quicksearch

Sequel::Dataset::StoredProcedureMethods

Attributes

sproc_name[RW]

The name of the stored procedure to call

sproc_args[W]

The name of the stored procedure to call

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

Set the type of the stored procedure and override the corresponding _sql method to return the empty string (since the result will be ignored anyway).

    # File lib/sequel/adapters/utils/stored_procedures.rb, line 42
42:       def sproc_type=(type)
43:         @sproc_type = type
44:         @opts[:sql] = ''
45:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.