What about simply using the MockDatabase and MockDatasets in the
spec_helper.rb file?

Michael

On Mon, Apr 11, 2011 at 12:07 PM, Jeremy Evans <[email protected]> wrote:
> On Apr 11, 1:18 am, John Anderson <[email protected]> wrote:
>> Hi everyone
>>
>> I need to generate SQL insert statements (for mysql), without a live db
>> connection. Is this possible?
>>
>> I could just generate the SQL without Sequel, but it would be nice to
>> know that quoting and escaping and type conversion are taken care of.
>
> On some level, it is possible, as bin/sequel without a database
> argument can do so.  However, often adapters will make the dataset
> subclass dependent on a database connection (commonly for string
> escaping), in which case it won't work correctly.  Since you
> specifically mention escaping, you should note that Sequel will often
> call the connection's escaping method to escape strings, and if a
> connection isn't available, that won't work.
>
> However, you probably won't need adapter specific code to do what you
> want. Look at the source code to bin/sequel around line 115, that
> should help.
>
> 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.
>
>



-- 
http://codeconnoisseur.org

-- 
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