I''m building an application in which I''d like groups of users to have their own dedicated MySQL/SQLite database for the application. How can I configure Rails so that ActiveRecord uses that group''s dedicated database from the start? -- _________________________________ Joshua S. Martin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Joshua Martin wrote:> I''m building an application in which I''d like groups of users to have > their > own dedicated MySQL/SQLite database for the application. > > How can I configure Rails so that ActiveRecord uses that group''s > dedicated > database from the start?That question comes up fairly frequently on this list. The usual answer: that''s a bad idea -- don''t do it. You shouldn''t need to have separate databases for groups. If you can explain more about why you think you want to do this, we can offer alternative suggestions.> > -- > _________________________________ > > Joshua S. MartinBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I see. It''s not the fact that I want the data to be separated that made me consider multiple DBs, it''s the fact that I want the user to be able to make a full SQL or CSV backup of his account that can be restored from within my application or into another database. Perhaps the better question is, how would I make an SQL or CSV export (within Rails) of only certain data in the database (the key here being only certain data) ? On Tue, May 18, 2010 at 1:38 PM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Joshua Martin wrote: > > I''m building an application in which I''d like groups of users to have > > their > > own dedicated MySQL/SQLite database for the application. > > > > How can I configure Rails so that ActiveRecord uses that group''s > > dedicated > > database from the start? > > That question comes up fairly frequently on this list. The usual > answer: that''s a bad idea -- don''t do it. You shouldn''t need to have > separate databases for groups. > > If you can explain more about why you think you want to do this, we can > offer alternative suggestions. > > > > > -- > > _________________________________ > > > > Joshua S. Martin > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- _________________________________ Joshua S. Martin CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney client or other legal privileges, and or proprietary non public information. If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution, or reproduction of this message and or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Joshua Martin wrote:> I see. It''s not the fact that I want the data to be separated that made > me > consider multiple DBs, it''s the fact that I want the user to be able to > make > a full SQL or CSV backup of his account that can be restored from within > my > application or into another database. > > Perhaps the better question is, how would I make an SQL or CSV export > (within Rails) of only certain data in the database (the key here being > only > certain data) ?You can easily generate CSV or SQL just like any other view template. However, for mass SQL backups, I think I''d advise just having Rails call the database''s own dump script. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.