Jeremy,

This is working out well so far, thanks for the help.  Do you or
anyone else have any suggestions for database clean up from tests?
I have heard of database cleaner, but it does not list Sequel has
being supported.  Could I surround tests with transactions and do a
rollback at the appropriate time?

Thanks again.

GregD

On Jun 2, 3:48 pm, Jeremy Evans <[email protected]> wrote:
> On Jun 2, 11:28 am, GregD <[email protected]> wrote:
>
> > Jeremy,
>
> > One more question(s).  Probably not the last.
>
> > A lot of these stored procs have a standard of returning a single
> > record with a single column with an error message in it.  I'd like to
> > capture this in a Sequel::Model class. Can you have Sequel::Model not
> > be associated to a database table?  How would you cast (not the right
> > word) the dataset created from the call_sproc to this Sequel::Model
> > class?
>
> I would not recommend Sequel::Model for this.  If it is just a single
> row/single column containing an error message string:
>
> stored_proc_dataset = DB.dataset
> stored_proc_dataset.row_proc = proc{|h| h.values.first}
> stored_proc_dataset.call_sproc(:first, :sp_name, :arg1, :arg2) #
> should return a string
>
> Sequel datasets do not depend on models (though Sequel models depend
> on datasets), so you can use your own model classes with datasets, via
> a custom row_proc.  In this case, since you are just dealing with a
> single error message string, returning the string directly seems to
> make the most sense to me.
>
> 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