Re: Switching database backends at runtime?

2009-03-17 Thread Oliver Beattie
Nope, seems this is actually impossible (at least using manage.py shell), since it will load all of the models and hold references to them on initialization until termination, so the settings-definte backend is tied to BaseQuery forever :( On Mar 17, 12:01 pm, Oliver Beattie wrote: > Thanks for

Re: Switching database backends at runtime?

2009-03-17 Thread Oliver Beattie
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 s

Re: Switching database backends at runtime?

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 6:20 PM, Oliver Beattie 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_bac

Switching database backends at runtime?

2009-03-16 Thread Oliver Beattie
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-le