Ian Bicking wrote:
>On Thu, 2003-07-17 at 05:37, Matt Goodall wrote:
>>Is there a good reason why DBConnection.py tries to load all supported
>>modules at the top of the module rather than where they are actually
>>required? i.e. why is psycopg imported for the whole module rather than
>>just for PostgresConnection? It should be relatively easy to refactor
>>the code so that the individual Connection classes load the DB-API
>>module as needed.
>>A change like this would certainly improve load time for the module (not
>>really all that important) but I think it will also make it easier for
>>the Connection classes to support multiple dbapi DB-API drivers, i.e.
>>psycopg, pyPgSQL etc.
>>Would you accept a patch for this?
>Yes, that would be fine.
Atatched. I've tried it for all connection types and it seems to work. I
don't know whether I like it all that much (a connection factory might
be better), see what you think. No unittest this time I'm afriad.
Oh yeah, I hope you don't mind but I rearranged the imports at the top
of the DBConnection module. I actually did it without thinking but it's
nicer now so I left it in. ;-)
I want to try to get PyPGSQL support in next, hopefully this week.
Matt Goodall, Pollenation Internet Ltd