On Mar 30, 10:16 am, Johnathan <[email protected]> wrote:
> Hi,
>
> was wondering if it's possible somehow to override the
> Sequel::Model.create method in a class to use stored procedure calls
> for inserting/updating? (I'm using SQL Server via ADO).

The ADO adapter doesn't support stored procedures directly, though you
may be able to drop down to SQL to use them.

> For example, to insert into a user table, I'd like to call exec
> sp_InsertUser @name, @email as the SP itself does some other stuff
> behind the scenes.
>
> Looking at the source, it seems that it calls into Dataset._save
> method, which doesn't seem to provide for such option.
>
> How would one go about doing that?

Overriding Model#_insert for the model should work.  Take a look at
the source, and if you can't get it to work, please pastie your code
with questions and I'll take a look.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to