I really like how Active Record logs the SQL that is executed inside of rails. Is there a way to get the SQL output when using Active Record outside of rails? Thanks, phil _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
try google on the very title of your message http://www.google.com/search?q=activerecord%20outside%20of%20rails You''ll be amazed by the result. http://www.cultkanaal.nl/Tech/google-bart.jpg Alain -- Posted via http://www.ruby-forum.com/.
Alain Ravet wrote:> try google on the very title of your message > > http://www.google.com/search?q=activerecord%20outside%20of%20rails > You''ll be amazed by the result.Really? It doesn''t obviously contain the answer to the OP''s question (which was about how to log the SQL when using AR outside of Rails)
> Really? It doesn''t obviously contain the answer to the OP''squestion > (which was about how to log the SQL when using AR outside of Rails) I reacted on the title and the main sentence that says "... a way to get SQL output..." (SQL output = result, not log). I guess that Phil wants the "logged SQL commands", and not the "SQL output". I Should have noticed the ambiguity of the message. My bad. Alain -- Posted via http://www.ruby-forum.com/.
On 16-dec-2005, at 1:39, Phil Swenson wrote:> I really like how Active Record logs the SQL that is executed > inside of rails. Is there a way to get the SQL output when using > Active Record outside of rails?require ''rubygems'' require ''active_record'' ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/ debug.log") ActiveRecord::Base.establish_connection(hash_of_params) -- Julian ''Julik'' Tarkhanov me at julik.nl
Thank you very much! I guess I need to start digging in to the rails/active record source so I can figure this stuff out.... phil -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Julian ''Julik'' Tarkhanov Sent: Friday, December 16, 2005 6:16 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] active record outside of rails On 16-dec-2005, at 1:39, Phil Swenson wrote:> I really like how Active Record logs the SQL that is executed > inside of rails. Is there a way to get the SQL output when using > Active Record outside of rails?require ''rubygems'' require ''active_record'' ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/ debug.log") ActiveRecord::Base.establish_connection(hash_of_params) -- Julian ''Julik'' Tarkhanov me at julik.nl _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails