ActiveRecord::Base.connection
On 12/4/05, gary huntress
<ghuntress-Wuw85uim5zDR7s880joybQ@public.gmane.org>
wrote:>
> Hi,
>
> I have a few database admin-related functions that I want to integrate
> into a rails app. Some specific MySQL commands are GRANT and REVOKE
> that do not return a recordset, and "SHOW PROCESSLIST" which does
return
> a recordset but does not have an underlying table.
>
> I started trying to do this by getting a new connection
> ActiveRecord::Base.establish_connection() and working with that. But
> the only way I''ve gotten it to work is to supply new connection
> credentials. It''s definitely not railsey to maintain connection
info in
> two places.
>
> How can I make a second connnection to whichever db is active in
> database.yml? (ie development, test, production)
>
> Is there a better way to execute something like "create
database..." or
> GRANT/REVOKE than making a second connection?
>
> Thanks!
>
> Gary H.
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>