Thanks for your quick reply :)
Basically, what I want to do has to apply to every query made to the
database, not just one query. Basically, I want to do a dry-run of
some things before doing them. Since MySQL doesn't support schema
alterations inside a transaction, I can't do it that way.
I'm sadly bound to using the release version of Django… so will this
apply?
On Mar 16, 10:25 pm, Alex Gaynor <
alex.gay...@gmail.com> wrote:
> On Mon, Mar 16, 2009 at 6:20 PM, Oliver Beattie <
oli...@obeattie.com> wrote:
>
> > Does anyone know if it's possible to switch the database backend in
> > Django at runtime (let's say I want to use dummy for something, but
> > then switch it back to the original after I'm done).
>
> > Is this possible using django.db.load_backend or something (I'm
> > doubting it as I see there is some module-level code in there that
> > takes info directly from settings).
>
> > I know it's a bit of a cardinal sin, but would altering settings at
> > runtime have any effect? Again probably no since there will still be
> > things pointing to the old backend instance, but worth a shot.
>
> It sort of depends on what you're trying to do, if you want to work with a
> queryset using a different database you can do something like this:
http://www.eflorenzano.com/blog/post/easy-multi-database-support-djan...