Module: Sequel::Dataset::StoredProcedures

Defined in:
lib/sequel/lib/sequel/adapters/utils/stored_procedures.rb

Instance Method Summary collapse

Instance Method Details

#call_sproc(type, name, *args) ⇒ Object

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



62
63
64
# File 'lib/sequel/lib/sequel/adapters/utils/stored_procedures.rb', line 62

def call_sproc(type, name, *args)
  prepare_sproc(type, name).call(*args)
end

#prepare_sproc(type, name) ⇒ Object

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



68
69
70
71
72
73
74
# File 'lib/sequel/lib/sequel/adapters/utils/stored_procedures.rb', line 68

def prepare_sproc(type, name)
  sp = clone
  prepare_extend_sproc(sp)
  sp.sproc_type = type
  sp.sproc_name = name
  sp
end