[PyGreSQL] DB API-2.0 + copy from stdin

Christopher Sean Hilton chris at vindaloo.com
Wed Sep 24 09:10:11 EDT 2008


On Sep 24, 2008, at 4:24 AM, Christoph Zwerschke wrote:

> I think that's a reasonable suggestion. If I understand you right,  
> then
> all we need to do is:
>
> 1) Add a parameter "db" to the pg.DB class. If it is set to None (the
> default), then a new connection will be established, otherwise the  
> given
> connection will be used. (I suggest the name "db" instead of "cnx"
> because the name of the corresponding attribute is already "db".)
>
> 2) Add an attribute "_closeable" to pg.DB which will be set when the
> instance has not been created with a preestablihed connection. The
> close() and reopen() methods of pg.DB will then raise an exception  
> when
> _closeable is false.
>
> 3) Add a pdb.pgdbCnx method for getting a classic pg.DB instance.
> Maybe we don't even need that, since getting it is as easy as
> DB(db=con._cnx) when con is a pgdb connection. So the pgdb module  
> would
> normally not need to import the pg module, and it would be clearer  
> that
> you're leaving the DB-API2 world if you're using this feature.
>
> An additional suggestion from my site is making the (pseudo) private
> attributes of pg.DB public, as we did with the private attributes in
> pgdb. A single underscore should suffice to indicate that these should
> not be used from outside unless really necessary as in cases like  
> this.
>

Is there anonymous CVS access so I could check out the CVS version of  
the code and submit a patch?

-- Chris


Chris Hilton                       tildeChris -- http://myblog.vindaloo.com
                                         email -- chris/at/vindaloo/ 
dot/com
.~ 
~ 
.--.~ 
~.--.~~.--.~~.--.~~.--.~~.--.~~.--.~~.--.~~.--.~~.--.~~.--.~~.--.~~.
                          "I'm on the outside looking inside, What do  
I see?
                                Much confusion, disillution, all  
around me."
                                          -- Ian McDonald / Peter  
Sinfield



More information about the PyGreSQL mailing list