Re: SQLite inserts slow

Sebastien Bigaret <[email protected]> 01 Jul 2004 20:29:10 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
Ernesto Revilla <[email protected]> wrote:
> Yes, I have the same opinion as Mario:
> 1. the adaptor (name) to be used should not be part of the model, but read
> in vía config. file, although I know that code generation is a bit different
> for each db adaptor. (I hope that soon dynamic will get a big push and
> within a year everyone uses dynamic, so we have no code generation phase:
> just change the config file and reinit the application, and voilà, you use
> another database backend.)

OProvided that you've not noticed that already, you'll be pleased to
know that this is already possible!  Look at the models used in the
tests: they do not have the adaptorName set, but they get it from the
files Postgresql.cfg, MySQL.cfg etc.

This is driven by the env. variable MDL_DB_CONNECTIONS_CFG, described
at: http://modeling.sourceforge.net/UserGuide/env-vars-core.html

> 2. there should be hooks on a per db adaptor base (at least, at db creation
> time, and at connection time). Perhaps, which instructions to send to the
> database should be part of either a general config file with a section for
> each db adaptor, or a different config file for each db adaptor.

Agreed, I've just added this to the TODO list; BTW, I'm more inclined to
have specific python hooks that could be triggered at creation time and
at connection time.


-- Sébastien.



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com