Apart from what Ted said, you can let glimpses of SQL shine through using
this snippet (I mainly use it in tests)

http://pastie.org/1843979

cheers
snusnu

On Thu, Apr 28, 2011 at 18:56, Ted Han <[email protected]> wrote:

> You can also play with the adapter endpoint itself to see what select
> statements its generating as well.
>
> Datamapper.repository.adapter.send(:select_statement,
> Thing.all(:foo=>/bar/).query)
>
> that'll give you the statements and the bind vars. (syntax is off the top
> of my head, plz check what methods are available in the dm-do-adapter if
> that doesn't work)
>
> -T
>
> On Thu, Apr 28, 2011 at 12:21 PM, Kane Baccigalupi 
> <[email protected]>wrote:
>
>> Is there an easy way to get to the raw sql generated by a query?
>>
>> We are having to do a lot of tuning of our raw sql to get postgres
>> efficient. Right now we are running queries via our tests or in
>> development, finding queries in the log and then looping.
>>
>> It would be great if we could cut this loop short.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "DataMapper" 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/datamapper?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "DataMapper" 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/datamapper?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en.

Reply via email to