module Sequel::Dataset::StoredProcedures

  1. lib/sequel/adapters/utils/stored_procedures.rb
Parent: Dataset

Methods

Public Instance

  1. call_sproc
  2. prepare_sproc

Public Instance methods

call_sproc (type, name, *args)

For the given type (:select, :first, :insert, :update, or :delete), run the database stored procedure with the given name with the given arguments.

[show source]
# File lib/sequel/adapters/utils/stored_procedures.rb, line 52
def call_sproc(type, name, *args)
  prepare_sproc(type, name).call(*args)
end
prepare_sproc (type, name)

Transform this dataset into a stored procedure that you can call multiple times with new arguments.

[show source]
# File lib/sequel/adapters/utils/stored_procedures.rb, line 58
def prepare_sproc(type, name)
  sp = clone
  prepare_extend_sproc(sp)
  sp.sproc_type = type
  sp.sproc_name = name
  sp
end