librelist archives

« back to archive

Different database per model

Different database per model

From:
Jochen Kempf
Date:
2011-09-28 @ 22:45
Hi,

I wonder how to write documents to different db's depending on the current
model.

I just see the "CouchPotato::Config.database_name" option which doesn't
allow me to switch db's depending on the current model.

So, is it possible to use CouchPotato on different db's?

Or, why would you recommend to just use one db for all models in my app?


Thanks for your advice!

Jochen Kempf

Re: [couchpotato] Different database per model

From:
Alexander Lang
Date:
2011-09-29 @ 10:21
Hi,

instead of using only CouchPotato.database you can instantiate as many 
CouchPotato::Database instances as you want, which will then allow you to 
use different databases in couch.

Cheers,
Alex

On 29.09.2011, at 00:45, Jochen Kempf <jochenkempf@gmail.com> wrote:

> Hi,
> 
> I wonder how to write documents to different db's depending on the 
current model.
> 
> I just see the "CouchPotato::Config.database_name" option which doesn't 
allow me to switch db's depending on the current model.
> 
> So, is it possible to use CouchPotato on different db's?
> 
> Or, why would you recommend to just use one db for all models in my app?
> 
> 
> Thanks for your advice!
> 
> Jochen Kempf

Re: [couchpotato] Different database per model

From:
Jochen Kempf
Date:
2011-09-30 @ 02:55
Hi Alexander,

thanks for the hint!

2011/9/29 Alexander Lang <_@alex.io>

> Hi,
>
> instead of using only CouchPotato.database you can instantiate as many
> CouchPotato::Database instances as you want, which will then allow you to
> use different databases in couch.
>
> Cheers,
> Alex
>
> On 29.09.2011, at 00:45, Jochen Kempf <jochenkempf@gmail.com> wrote:
>
> > Hi,
> >
> > I wonder how to write documents to different db's depending on the
> current model.
> >
> > I just see the "CouchPotato::Config.database_name" option which doesn't
> allow me to switch db's depending on the current model.
> >
> > So, is it possible to use CouchPotato on different db's?
> >
> > Or, why would you recommend to just use one db for all models in my app?
> >
> >
> > Thanks for your advice!
> >
> > Jochen Kempf
>