On Wednesday 14 March 2007 09:56, Ed Leafe wrote:
> "pg8000 is a Pure-Python interface to the PostgreSQL database engine.
> It is one of many PostgreSQL interfaces for the Python programming
> language. pg8000 is somewhat distinctive in that it is written
> entirely in Python and does not rely on any external libraries (such
> as a compiled python module, or PostgreSQL's libpq library).
> pg8000's name comes from the belief that it is probably about the
> 8000th PostgreSQL interface for Python.
>
> pg8000 supports the standard DB-API 2.0 as documented in PEP-249 (as
> of pg8000 v1.02)."
>
>       Haven't tried it, but it looks interesting...
>
>
>
> http://pybrary.net/pg8000/

Hmm interesting.  I like the fact that it is written python.   It works.   But 
it is not following the standard API as I understand it.  It does not have 
any of the "fetch" functions.  
Uses several other functions:
for row in pg8000.Cursor.iterate_dict(cur):
   print row

This statement is interesting:
 The database connection is derived from the Cursor class, which provides a 
default cursor for running queries. It also provides transaction control via 
the 'begin', 'commit', and 'rollback' methods. Without beginning a 
transaction explicitly, all statements will autocommit to the database.

There is that word again "autocommit".

I really like the multi-cursor one connection thing.
db = pg8000.Connection(string)
cur1 = pg8000.Cursor(db)
cur2 = pg8000.Cursor(db)

Is this a fetchmany:

row_cache_size [#]
Determines the number of rows to read from the database server at once. 
Reading more rows increases performance at the cost of memory. The default 
value is 100 rows. The affect of this parameter is transparent. That is, the 
library reads more rows when the cache is empty automatically.

Interesting last line.
-- 
John Fabiani

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to